genericize ui fragments (#12810)

This commit is contained in:
Nemanja
2022-12-02 17:46:58 -05:00
committed by GitHub
parent d52cbdc18e
commit 64f57aceb2
8 changed files with 32 additions and 29 deletions

View File

@@ -0,0 +1,25 @@
using Robust.Client.GameObjects;
using Robust.Client.UserInterface;
namespace Content.Client.UserInterface.Fragments;
/// <summary>
/// Specific ui fragments need to inherit this class. The subclass is then used in yaml to tell a main ui to use it as a ui fragment.
/// </summary>
/// <example>
/// This is an example from the yaml definition from the notekeeper ui
/// <code>
/// - type: CartridgeUi
/// ui: !type:NotekeeperUi
/// </code>
/// </example>
[ImplicitDataDefinitionForInheritors]
public abstract class UIFragment
{
public abstract Control GetUIFragmentRoot();
public abstract void Setup(BoundUserInterface userInterface);
public abstract void UpdateState(BoundUserInterfaceState state);
}