Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into fract-war-ebent-u…
Browse files Browse the repository at this point in the history
…pdate-v0.7
  • Loading branch information
Kirus59 committed Jan 3, 2025
2 parents 7b6d4c3 + c6bba03 commit 6b27c81
Show file tree
Hide file tree
Showing 1,062 changed files with 79,414 additions and 59,633 deletions.
3 changes: 3 additions & 0 deletions Content.Client/Input/ContentContexts.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Content.Shared.Input;
using Content.Shared.SS220.Input;
using Robust.Shared.Input;

namespace Content.Client.Input
Expand Down Expand Up @@ -57,6 +58,7 @@ public static void SetupContexts(IInputContextContainer contexts)
human.AddFunction(EngineKeyFunctions.Walk);
human.AddFunction(ContentKeyFunctions.SwapHands);
human.AddFunction(ContentKeyFunctions.Drop);
human.AddFunction(KeyFunctions220.ItemOffer); // SS220 ItemOffer bind
human.AddFunction(ContentKeyFunctions.UseItemInHand);
human.AddFunction(ContentKeyFunctions.AltUseItemInHand);
human.AddFunction(ContentKeyFunctions.OpenCharacterMenu);
Expand All @@ -78,6 +80,7 @@ public static void SetupContexts(IInputContextContainer contexts)
human.AddFunction(ContentKeyFunctions.RotateObjectClockwise);
human.AddFunction(ContentKeyFunctions.RotateObjectCounterclockwise);
human.AddFunction(ContentKeyFunctions.FlipObject);
human.AddFunction(KeyFunctions220.ResistFire); // SS220 resist fire bind
human.AddFunction(ContentKeyFunctions.ArcadeUp);
human.AddFunction(ContentKeyFunctions.ArcadeDown);
human.AddFunction(ContentKeyFunctions.ArcadeLeft);
Expand Down
15 changes: 12 additions & 3 deletions Content.Client/Inventory/ClientInventorySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,18 +163,24 @@ 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;

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)
Expand Down Expand Up @@ -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;
Expand All @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions Content.Client/Options/UI/Tabs/KeyRebindTab.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Content.Client.Stylesheets;
using Content.Shared.CCVar;
using Content.Shared.Input;
using Content.Shared.SS220.Input;
using Robust.Client.AutoGenerated;
using Robust.Client.Input;
using Robust.Client.UserInterface;
Expand Down Expand Up @@ -179,6 +180,7 @@ void AddCheckBox(string checkBoxName, bool currentState, Action<BaseButton.Butto
AddButton(ContentKeyFunctions.ActivateItemInWorld);
AddButton(ContentKeyFunctions.AltActivateItemInWorld);
AddButton(ContentKeyFunctions.Drop);
AddButton(KeyFunctions220.ItemOffer); // SS220 ItemOffer bind
AddButton(ContentKeyFunctions.ExamineEntity);
AddButton(ContentKeyFunctions.SwapHands);
AddButton(ContentKeyFunctions.MoveStoredItem);
Expand All @@ -199,6 +201,7 @@ void AddCheckBox(string checkBoxName, bool currentState, Action<BaseButton.Butto
AddButton(ContentKeyFunctions.RotateObjectClockwise);
AddButton(ContentKeyFunctions.RotateObjectCounterclockwise);
AddButton(ContentKeyFunctions.FlipObject);
AddButton(KeyFunctions220.ResistFire); // SS220 resist fire bind

AddHeader("ui-options-header-ui");
AddButton(ContentKeyFunctions.FocusChat);
Expand Down
38 changes: 38 additions & 0 deletions Content.Client/SS220/Bible/ExorcismPerformerSystem.cs
Original file line number Diff line number Diff line change
@@ -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<ExorcismPerformerComponent, AppearanceChangeEvent>(OnAppearanceChanged);
}

private void OnAppearanceChanged(Entity<ExorcismPerformerComponent> 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);
}
}
*/
}
}
51 changes: 51 additions & 0 deletions Content.Client/SS220/Bible/UI/ExorcismBoundUserInterface.cs
Original file line number Diff line number Diff line change
@@ -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();
}
}
11 changes: 11 additions & 0 deletions Content.Client/SS220/Bible/UI/ExorcismMenu.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt -->
<controls:FancyWindow xmlns="https://spacestation14.io"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
Title="{Loc 'bible-exorcism-menu-title'}"
MinSize="400 225">
<BoxContainer Orientation="Vertical" HorizontalExpand="True" VerticalExpand="True" Margin="5">
<TextEdit Name="MessageInput" HorizontalExpand="True" VerticalExpand="True" Margin="0 0 0 5" MinHeight="100" />
<Label Name="LengthLabel"></Label>
<Button Name="ReadButton" Text="{Loc 'bible-exorcism-menu-read-button'}" StyleClasses="OpenLeft" Access="Public" />
</BoxContainer>
</controls:FancyWindow>
76 changes: 76 additions & 0 deletions Content.Client/SS220/Bible/UI/ExorcismMenu.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
// © 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.UserInterface.Controls;
using Content.Shared.SS220.Bible;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Utility;

namespace Content.Client.SS220.Bible.UI;

[GenerateTypedNameReferences]
public sealed partial class ExorcismMenu : FancyWindow
{
private ExorcismBoundUserInterface Owner { get; set; }

public ExorcismMenu(ExorcismBoundUserInterface owner)
{
IoCManager.InjectDependencies(this);
RobustXamlLoader.Load(this);

Owner = owner;

var loc = IoCManager.Resolve<ILocalizationManager>();
MessageInput.Placeholder = new Rope.Leaf(loc.GetString("bible-exorcism-menu-message-placeholder"));

MessageInput.OnTextChanged += (args) =>
{
var len = GetLength();
if (len < Owner.LengthMin)
{
ReadButton.Disabled = true;
ReadButton.ToolTip = Loc.GetString("bible-exorcism-message-too-short");
}
else if (len > Owner.LengthMax)
{
ReadButton.Disabled = true;
ReadButton.ToolTip = Loc.GetString("bible-exorcism-message-too-long");
}
else
{
ReadButton.Disabled = false;
ReadButton.ToolTip = null;
}
RefreshLengthCounter(len);
};

RefreshLengthCounter();

ReadButton.OnPressed += _ => Owner.ReadButtonPressed(Rope.Collapse(MessageInput.TextRope));
ReadButton.Disabled = true;
}

public override void Close()
{
base.Close();
}

public void RefreshLengthCounter()
{
RefreshLengthCounter(GetLength());
}

protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
}

private void RefreshLengthCounter(int length)
{
LengthLabel.Text = $"{length}/{Owner.LengthMin}";
}

private int GetLength()
{
return ExorcismUtils.GetSanitazedMessageLength(Rope.Collapse(MessageInput.TextRope));
}
}
15 changes: 15 additions & 0 deletions Content.Client/SS220/CultYogg/Altar/CultYoggAltarSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// © 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.CultYogg;
using Content.Shared.SS220.CultYogg.Altar;
using Robust.Client.GameObjects;

namespace Content.Client.SS220.CultYogg.Altar;

public sealed partial class CultYoggAltarSystem : SharedCultYoggAltarSystem
{
public override void Initialize()
{
base.Initialize();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// © 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.StatusIcon;
using Content.Shared.StatusIcon.Components;
using Robust.Shared.Prototypes;
using Content.Shared.SS220.CultYogg.CultYoggIcons;
using Content.Shared.SS220.CultYogg.Sacraficials;
using Robust.Client.Player;

namespace Content.Client.SS220.CultYogg.CultYoggIcon;

public sealed class ShowCultYoggIconsSystem : EntitySystem
{
[Dependency] private readonly IPrototypeManager _prototype = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;


public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<ShowCultYoggIconsComponent, GetStatusIconsEvent>(OnGetCultistsIconsEvent);
SubscribeLocalEvent<CultYoggSacrificialComponent, GetStatusIconsEvent>(OnGetSacraficialIconsEvent);
}

private void OnGetCultistsIconsEvent(Entity<ShowCultYoggIconsComponent> uid, ref GetStatusIconsEvent ev)
{

if (!TryComp<ShowCultYoggIconsComponent>(uid, out var cultComp))
return;

var iconId = cultComp.StatusIcon;

if (_prototype.TryIndex<FactionIconPrototype>(iconId, out var iconPrototype))
ev.StatusIcons.Add(iconPrototype);
else
Log.Error($"Invalid faction icon prototype: {iconPrototype}");
}
private void OnGetSacraficialIconsEvent(Entity<CultYoggSacrificialComponent> uid, ref GetStatusIconsEvent ev)
{
var viewer = _playerManager.LocalSession?.AttachedEntity;
if (viewer == uid)
return;

if (!TryComp<CultYoggSacrificialComponent>(uid, out var sacrComp))
return;

var iconId = sacrComp.StatusIcon;

if (_prototype.TryIndex<FactionIconPrototype>(iconId, out var iconPrototype))
ev.StatusIcons.Add(iconPrototype);
else
Log.Error($"Invalid faction icon prototype: {iconPrototype}");
}
}
Loading

0 comments on commit 6b27c81

Please sign in to comment.