Page MenuHomeFeedback Tracker

Add moddable intermediate class between InventoryStorageManagerComponent and SCR_ variants
Closed, ResolvedPublic

Description

In a scenario where all InventoryStorageManagers need to handle a certain event or receive an RPC one must copy-paste implementations right now because the base class InventoryStorageManagerComponent is not moddable and the two commonly used derivates SCR_InventoryStorageManagerComponent and SCR_VehicleInventoryStorageManagerComponent share no other base class. If game-modes add their own additional scripted implementations those would become impossible to handle for cross-mod compatibility. Right now code looks like this:

modded class SCR_InventoryStorageManagerComponent
{
	//------------------------------------------------------------------------------------------------
	override protected void OnItemAdded(BaseInventoryStorageComponent storageOwner, IEntity item)
	{
		if (EL_QuantityHandler.HandleOnItemAdded(this, storageOwner, item)) return;
		super.OnItemAdded(storageOwner, item);
	}
}

modded class SCR_VehicleInventoryStorageManagerComponent
{
	//------------------------------------------------------------------------------------------------
	override protected void OnItemAdded(BaseInventoryStorageComponent storageOwner, IEntity item)
	{
		if (EL_QuantityHandler.HandleOnItemAdded(this, storageOwner, item)) return;
		super.OnItemAdded(storageOwner, item);
	}
}

My proposed solution for it is very simple: Add something like class ScriptedInventoryStorageManagerComponent : InventoryStorageManagerComponent {} and make the SCR_ variants inherit from that. This way when modding ScriptedInventoryStorageManagerComponent a change is applied to all possible derived classes.

Details

Severity
Major
Resolution
Open
Reproducibility
N/A
Operating System
Windows 10 x64
Category
General

Event Timeline

Arkensor created this task.Sep 24 2022, 1:01 PM
Geez changed the task status from New to Acknowledged.Sep 26 2022, 3:51 PM
Geez closed this task as Resolved.Sep 29 2022, 12:02 PM
Geez claimed this task.
Geez added a subscriber: Geez.

Hello Arkensor.
This has been done internally and the change will appear in one of the future updates.
Regards,
Geez