перенос общих файлов из папки White в _White

This commit is contained in:
Remuchi
2024-01-28 18:37:24 +07:00
parent 1e4ad59270
commit 3a08b81d53
370 changed files with 805 additions and 812 deletions

View File

@@ -0,0 +1,30 @@
using Robust.Shared.GameStates;
namespace Content.Shared._White.Item.Tricorder;
public abstract class SharedTricorderSystem : EntitySystem
{
/// <inheritdoc/>
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<TricorderComponent, ComponentGetState>(GetTricorderState);
}
private static void GetTricorderState(EntityUid uid, TricorderComponent component, ref ComponentGetState args)
{
args.State = new TricorderComponentState(component.CurrentMode);
}
public static string GetNameByMode(TricorderMode mode)
{
return mode switch
{
TricorderMode.Multitool => "[color=yellow]мультитул[/color]",
TricorderMode.GasAnalyzer => "[color=cyan]газоанализатор[/color]",
TricorderMode.HealthAnalyzer => "[color=green]анализатор здоровья[/color]",
_ => "[color=yellow]мультитул[/color]"
};
}
}

View File

@@ -0,0 +1,36 @@
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
namespace Content.Shared._White.Item.Tricorder;
[RegisterComponent, NetworkedComponent, Access(typeof(SharedTricorderSystem))]
public sealed partial class TricorderComponent : Component
{
[DataField("currentState"), ViewVariables(VVAccess.ReadWrite)]
public TricorderMode CurrentMode = TricorderMode.Multitool;
[DataField("soundSwitchMode")]
public SoundSpecifier SoundSwitchMode = new SoundPathSpecifier("/Audio/Machines/quickbeep.ogg");
}
/// <summary>
/// Contains network state for TricorderComponent.
/// </summary>
[Serializable, NetSerializable]
public sealed class TricorderComponentState : ComponentState
{
public TricorderMode CurrentMode;
public TricorderComponentState(TricorderMode currentMode)
{
CurrentMode = currentMode;
}
}
public enum TricorderMode
{
Multitool,
GasAnalyzer,
HealthAnalyzer
}