more component ref removal + combining server/client comps (#13178)
Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>
This commit is contained in:
53
Content.Shared/Tools/Components/MultipleToolComponent.cs
Normal file
53
Content.Shared/Tools/Components/MultipleToolComponent.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Shared.Tools.Components
|
||||
{
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed class MultipleToolComponent : Component
|
||||
{
|
||||
[DataDefinition]
|
||||
public sealed class ToolEntry
|
||||
{
|
||||
[DataField("behavior", required: true)]
|
||||
public PrototypeFlags<ToolQualityPrototype> Behavior = new();
|
||||
|
||||
[DataField("useSound")]
|
||||
public SoundSpecifier? Sound;
|
||||
|
||||
[DataField("changeSound")]
|
||||
public SoundSpecifier? ChangeSound;
|
||||
|
||||
[DataField("sprite")]
|
||||
public SpriteSpecifier? Sprite;
|
||||
}
|
||||
|
||||
[DataField("entries", required: true)]
|
||||
public ToolEntry[] Entries { get; } = Array.Empty<ToolEntry>();
|
||||
|
||||
[ViewVariables]
|
||||
public uint CurrentEntry = 0;
|
||||
|
||||
[ViewVariables]
|
||||
public string CurrentQualityName = string.Empty;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public bool UiUpdateNeeded;
|
||||
|
||||
[DataField("statusShowBehavior")]
|
||||
public bool StatusShowBehavior = true;
|
||||
}
|
||||
|
||||
[NetSerializable, Serializable]
|
||||
public sealed class MultipleToolComponentState : ComponentState
|
||||
{
|
||||
public readonly uint Selected;
|
||||
|
||||
public MultipleToolComponentState(uint selected)
|
||||
{
|
||||
Selected = selected;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user