Doloro GDK 22 .1.0 Beta
by Tauri Interactive
Storage GUI control

About

The module provides you with StorageGUIElement, a main content inspector suitable for Storage content display. The component receives StoragesDatabase.StorageContainer as content and loads its key properties to configurated GUI layout.

Explore API:


Storage GUI extensions

The inspector can be extended with AStorageGUIElementExtension derived components.
The class proofs components configuration on target game object that simplifies development comparing to manual implementation of AContentInspectorExtension<StoragesDatabase.StorageContainer> class.

The extension follows StorageGUIControl events and updates bonded GUI layout elements along with extension internal logic.

Explore API:


Development

To create a custom GUI extension, it’s enough to create a new class derived from AStorageGUIElementExtension. By overriding provided handlers you may follow common StorageGUIControl events and implement feedback on them.

Following example shows common template of GUI extension class.

using Doloro.InvetorySystem;
using Doloro.InvetorySystem.UI.Controls;
using Doloro.InvetorySystem.UI.Extension;
public class CUSTOM_STORAGE_GUI_EXTENSION : AStorageGUIElementExtension
{
protected override void OnStorageNotSelected()
{
// Handler that calls when inspector content is `null`.
// Clear the GUI elements here.
}
protected override void OnStorageModified(StoragesDatabase.StorageContainer source)
{
// Handler that calls when source storage data container data
// has been modified.
// Load data to GUI elements here.
}
}

You also may find useful using of AStorageFeatureGUIExtension{FeatureType} class instead of regular AStorageGUIElementExtension. The class bonds certain AStorageFeature with the component and allows to track internal messages and events via pre-implemented handlers.

public class CUSTOM_STORAGE_FEATURE_GUI_EXTENSION :
AStorageFeatureGUIExtension<STORAGE_FEATURE_TYPE>
{
... THE SAME MEMBERS MAP ...
protected virtual void OnFeatureModified(STORAGE_FEATURE_TYPE feature)
{
// Occurs when a bonded feature invoked `AEntityFeature.Modified` event.
// Implement GUI update here.
}
}

Where STORAGE_FEATURE_TYPE is type of AStorageFeature derived component over Storage game object that will be tracked.