diff --git a/Content.Client/Inventory/ClientInventorySystem.cs b/Content.Client/Inventory/ClientInventorySystem.cs index dce401eefda54e..f51319b0af487f 100644 --- a/Content.Client/Inventory/ClientInventorySystem.cs +++ b/Content.Client/Inventory/ClientInventorySystem.cs @@ -163,11 +163,12 @@ public void SetSlotHighlight(EntityUid owner, InventorySlotsComponent component, } public void UpdateSlot(EntityUid owner, InventorySlotsComponent component, string slotName, - bool? blocked = null, bool? highlight = null) + bool? blocked = null, bool? highlight = null, bool? stuckOnEquip = null)//ss220 StuckOnEquip { var oldData = component.SlotData[slotName]; var newHighlight = oldData.Highlighted; var newBlocked = oldData.Blocked; + var newStuckOnEquip = oldData.StuckOnEquip;//ss220 StuckOnEquip if (blocked != null) newBlocked = blocked.Value; @@ -175,6 +176,11 @@ public void UpdateSlot(EntityUid owner, InventorySlotsComponent component, strin if (highlight != null) newHighlight = highlight.Value; + //ss220 StuckOnEquip begin + if (stuckOnEquip != null) + newStuckOnEquip = stuckOnEquip.Value; + //ss220 StuckOnEquip end + var newData = component.SlotData[slotName] = new SlotData(component.SlotData[slotName], newHighlight, newBlocked); if (owner == _playerManager.LocalEntity) @@ -255,6 +261,7 @@ public sealed class SlotData public EntityUid? HeldEntity => Container?.ContainedEntity; public bool Blocked; public bool Highlighted; + public bool StuckOnEquip; //ss220 StuckOnEquip [ViewVariables] public ContainerSlot? Container; @@ -268,20 +275,22 @@ public sealed class SlotData public string FullTextureName => SlotDef.FullTextureName; public SlotData(SlotDefinition slotDef, ContainerSlot? container = null, bool highlighted = false, - bool blocked = false) + bool blocked = false, bool stuckOnEquip = false)//ss220 StuckOnEquip { SlotDef = slotDef; Highlighted = highlighted; Blocked = blocked; Container = container; + StuckOnEquip = stuckOnEquip; //ss220 StuckOnEquip } - public SlotData(SlotData oldData, bool highlighted = false, bool blocked = false) + public SlotData(SlotData oldData, bool highlighted = false, bool blocked = false, bool stuckOnEquip = false)//ss220 StuckOnEquip { SlotDef = oldData.SlotDef; Highlighted = highlighted; Container = oldData.Container; Blocked = blocked; + StuckOnEquip = stuckOnEquip; //ss220 StuckOnEquip } public static implicit operator SlotData(SlotDefinition s) diff --git a/Content.Client/SS220/Bible/ExorcismPerformerSystem.cs b/Content.Client/SS220/Bible/ExorcismPerformerSystem.cs new file mode 100644 index 00000000000000..bd8924ef56c54f --- /dev/null +++ b/Content.Client/SS220/Bible/ExorcismPerformerSystem.cs @@ -0,0 +1,38 @@ +// © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt +using Content.Client.Light.Components; +using Content.Client.Light.EntitySystems; +using Content.Shared.SS220.Bible; +using Robust.Client.GameObjects; + +namespace Content.Client.SS220.Bible; + +public sealed class ExorcismPerformerSystem : SharedExorcismPerformerSystem +{ + + [Dependency] private readonly LightBehaviorSystem _lightBehavior = default!; + public override void Initialize() + { + SubscribeLocalEvent(OnAppearanceChanged); + } + + private void OnAppearanceChanged(Entity entity, ref AppearanceChangeEvent args) + { + if (!args.AppearanceData.TryGetValue(ExorcismPerformerVisualState.State, out var value) || value is not ExorcismPerformerVisualState state) + { + return; + } + //ToDo its broken ... Stalen? + /* + if (TryComp(entity, out LightBehaviourComponent? lightBehaviour)) + { + // Reset any running behaviour to reset the animated properties back to the original value, to avoid conflicts between resets + _lightBehavior.StopLightBehaviour((entity, lightBehaviour)); + + if (state == ExorcismPerformerVisualState.Performing) + { + _lightBehavior.StartLightBehaviour(entity.Comp.LightBehaviourId); + } + } + */ + } +} diff --git a/Content.Client/SS220/Bible/UI/ExorcismBoundUserInterface.cs b/Content.Client/SS220/Bible/UI/ExorcismBoundUserInterface.cs new file mode 100644 index 00000000000000..b2617b2e5af805 --- /dev/null +++ b/Content.Client/SS220/Bible/UI/ExorcismBoundUserInterface.cs @@ -0,0 +1,51 @@ +// © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt +using Content.Shared.SS220.Bible; + +namespace Content.Client.SS220.Bible.UI; + +public sealed class ExorcismBoundUserInterface : BoundUserInterface +{ + [ViewVariables] + private ExorcismMenu? _menu; + + [ViewVariables] + public int LengthMin { get; private set; } + [ViewVariables] + public int LengthMax { get; private set; } + + + public ExorcismBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) + { + } + + protected override void Open() + { + _menu = new ExorcismMenu(this); + _menu.OnClose += Close; + _menu.OpenCentered(); + } + + public void ReadButtonPressed(string message) + { + SendMessage(new ExorcismReadMessage(message)); + _menu?.Close(); + } + + protected override void UpdateState(BoundUserInterfaceState state) + { + if (state is not ExorcismInterfaceState exorcismState) + return; + + LengthMin = exorcismState.LengthMin; + LengthMax = exorcismState.LengthMax; + _menu?.RefreshLengthCounter(); + } + + protected override void Dispose(bool disposing) + { + base.Dispose(disposing); + if (!disposing) return; + + _menu?.Dispose(); + } +} diff --git a/Content.Client/SS220/Bible/UI/ExorcismMenu.xaml b/Content.Client/SS220/Bible/UI/ExorcismMenu.xaml new file mode 100644 index 00000000000000..58d5f334d66704 --- /dev/null +++ b/Content.Client/SS220/Bible/UI/ExorcismMenu.xaml @@ -0,0 +1,11 @@ + + + + + +