Skip to content

Commit

Permalink
Merge branch 'space-wizards:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
RonRonstation authored Sep 27, 2024
2 parents 7769a90 + 4e86095 commit 49e404a
Show file tree
Hide file tree
Showing 88 changed files with 6,917 additions and 4,501 deletions.
9 changes: 5 additions & 4 deletions Content.Client/Ensnaring/EnsnareableSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Content.Shared.Ensnaring.Components;
using Robust.Client.GameObjects;

namespace Content.Client.Ensnaring.Visualizers;
namespace Content.Client.Ensnaring;

public sealed class EnsnareableSystem : SharedEnsnareableSystem
{
Expand All @@ -12,13 +12,14 @@ public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<EnsnareableComponent, ComponentInit>(OnComponentInit);
SubscribeLocalEvent<EnsnareableComponent, AppearanceChangeEvent>(OnAppearanceChange);
}

private void OnComponentInit(EntityUid uid, EnsnareableComponent component, ComponentInit args)
protected override void OnEnsnareInit(Entity<EnsnareableComponent> ent, ref ComponentInit args)
{
if(!TryComp<SpriteComponent>(uid, out var sprite))
base.OnEnsnareInit(ent, ref args);

if(!TryComp<SpriteComponent>(ent.Owner, out var sprite))
return;

// TODO remove this, this should just be in yaml.
Expand Down
4 changes: 2 additions & 2 deletions Content.Client/Inventory/StrippableBoundUserInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public void UpdateMenu()
StyleClasses = { StyleBase.ButtonOpenRight }
};

button.OnPressed += (_) => SendMessage(new StrippingEnsnareButtonPressed());
button.OnPressed += (_) => SendPredictedMessage(new StrippingEnsnareButtonPressed());

_strippingMenu.SnareContainer.AddChild(button);
}
Expand Down Expand Up @@ -177,7 +177,7 @@ private void SlotPressed(GUIBoundKeyEventArgs ev, SlotControl slot)
// So for now: only stripping & examining
if (ev.Function == EngineKeyFunctions.Use)
{
SendMessage(new StrippingSlotButtonPressed(slot.SlotName, slot is HandButton));
SendPredictedMessage(new StrippingSlotButtonPressed(slot.SlotName, slot is HandButton));
return;
}

Expand Down
7 changes: 6 additions & 1 deletion Content.Client/Popups/PopupSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,12 @@ private void PopupCursorInternal(string? message, PopupType type, bool recordRep
}

public override void PopupCursor(string? message, PopupType type = PopupType.Small)
=> PopupCursorInternal(message, type, true);
{
if (!_timing.IsFirstTimePredicted)
return;

PopupCursorInternal(message, type, true);
}

public override void PopupCursor(string? message, ICommonSession recipient, PopupType type = PopupType.Small)
{
Expand Down
67 changes: 56 additions & 11 deletions Content.Client/Silicons/StationAi/StationAiSystem.Airlock.cs
Original file line number Diff line number Diff line change
@@ -1,30 +1,75 @@
using Content.Shared.Doors.Components;
using Content.Shared.Electrocution;
using Content.Shared.Silicons.StationAi;
using Robust.Shared.Utility;

namespace Content.Client.Silicons.StationAi;

public sealed partial class StationAiSystem
{
private readonly ResPath _aiActionsRsi = new ResPath("/Textures/Interface/Actions/actions_ai.rsi");

private void InitializeAirlock()
{
SubscribeLocalEvent<DoorBoltComponent, GetStationAiRadialEvent>(OnDoorBoltGetRadial);
SubscribeLocalEvent<AirlockComponent, GetStationAiRadialEvent>(OnEmergencyAccessGetRadial);
SubscribeLocalEvent<ElectrifiedComponent, GetStationAiRadialEvent>(OnDoorElectrifiedGetRadial);
}

private void OnDoorBoltGetRadial(Entity<DoorBoltComponent> ent, ref GetStationAiRadialEvent args)
{
args.Actions.Add(new StationAiRadial()
{
Sprite = ent.Comp.BoltsDown ?
new SpriteSpecifier.Rsi(
new ResPath("/Textures/Structures/Doors/Airlocks/Standard/basic.rsi"), "open") :
new SpriteSpecifier.Rsi(
new ResPath("/Textures/Structures/Doors/Airlocks/Standard/basic.rsi"), "closed"),
Tooltip = ent.Comp.BoltsDown ? Loc.GetString("bolt-open") : Loc.GetString("bolt-close"),
Event = new StationAiBoltEvent()
args.Actions.Add(
new StationAiRadial
{
Sprite = ent.Comp.BoltsDown
? new SpriteSpecifier.Rsi(_aiActionsRsi, "unbolt_door")
: new SpriteSpecifier.Rsi(_aiActionsRsi, "bolt_door"),
Tooltip = ent.Comp.BoltsDown
? Loc.GetString("bolt-open")
: Loc.GetString("bolt-close"),
Event = new StationAiBoltEvent
{
Bolted = !ent.Comp.BoltsDown,
}
}
);
}

private void OnEmergencyAccessGetRadial(Entity<AirlockComponent> ent, ref GetStationAiRadialEvent args)
{
args.Actions.Add(
new StationAiRadial
{
Sprite = ent.Comp.EmergencyAccess
? new SpriteSpecifier.Rsi(_aiActionsRsi, "emergency_off")
: new SpriteSpecifier.Rsi(_aiActionsRsi, "emergency_on"),
Tooltip = ent.Comp.EmergencyAccess
? Loc.GetString("emergency-access-off")
: Loc.GetString("emergency-access-on"),
Event = new StationAiEmergencyAccessEvent
{
EmergencyAccess = !ent.Comp.EmergencyAccess,
}
}
);
}

private void OnDoorElectrifiedGetRadial(Entity<ElectrifiedComponent> ent, ref GetStationAiRadialEvent args)
{
args.Actions.Add(
new StationAiRadial
{
Bolted = !ent.Comp.BoltsDown,
Sprite = ent.Comp.Enabled
? new SpriteSpecifier.Rsi(_aiActionsRsi, "door_overcharge_off")
: new SpriteSpecifier.Rsi(_aiActionsRsi, "door_overcharge_on"),
Tooltip = ent.Comp.Enabled
? Loc.GetString("electrify-door-off")
: Loc.GetString("electrify-door-on"),
Event = new StationAiElectrifiedEvent
{
Electrified = !ent.Comp.Enabled,
}
}
});
);
}
}
1 change: 1 addition & 0 deletions Content.Client/VoiceMask/VoiceMaskBoundUserInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ protected override void Open()

_window = this.CreateWindow<VoiceMaskNameChangeWindow>();
_window.ReloadVerbs(_protomanager);
_window.AddVerbs();

_window.OnNameChange += OnNameSelected;
_window.OnVerbChange += verb => SendMessage(new VoiceMaskChangeVerbMessage(verb));
Expand Down
4 changes: 1 addition & 3 deletions Content.Client/VoiceMask/VoiceMaskNameChangeWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ public VoiceMaskNameChangeWindow()
OnVerbChange?.Invoke((string?) args.Button.GetItemMetadata(args.Id));
SpeechVerbSelector.SelectId(args.Id);
};

AddVerbs();
}

public void ReloadVerbs(IPrototypeManager proto)
Expand All @@ -44,7 +42,7 @@ public void ReloadVerbs(IPrototypeManager proto)
_verbs.Sort((a, b) => a.Item1.CompareTo(b.Item1));
}

private void AddVerbs()
public void AddVerbs()
{
SpeechVerbSelector.Clear();

Expand Down
22 changes: 12 additions & 10 deletions Content.Client/Voting/UI/VoteCallMenu.xaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<ui:VoteCallMenu xmlns="https://spacestation14.io"
<ui:VoteCallMenu xmlns="https://spacestation14.io"
xmlns:ui="clr-namespace:Content.Client.Voting.UI"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
MouseFilter="Stop" MinSize="350 150">
MouseFilter="Stop" MinSize="350 200">
<PanelContainer StyleClasses="AngleRect" />
<BoxContainer Orientation="Vertical">
<BoxContainer Margin="8 0" Orientation="Horizontal">
Expand All @@ -13,16 +13,18 @@
<controls:HighDivider />

<BoxContainer Orientation="Vertical" Margin="8 2 8 0" VerticalExpand="True" VerticalAlignment="Top">
<BoxContainer Orientation="Horizontal">
<OptionButton Name="VoteTypeButton" HorizontalExpand="True" />
<Control HorizontalExpand="True">
<OptionButton Name="VoteSecondButton" Visible="False" />
</Control>
<BoxContainer Orientation="Vertical">
<OptionButton Margin="2 1" Name="VoteTypeButton" HorizontalExpand="False" />
<BoxContainer Name="VoteOptionsButtonContainer" HorizontalExpand="False" Orientation="Vertical">
</BoxContainer>
<Button Margin="64 4" Name="FollowButton" Text="{Loc 'ui-vote-follow-button'}" Visible="False" />
<Label Margin="2 2" Name="VoteNotTrustedLabel" Text="{Loc 'ui-vote-trusted-users-notice'}" Visible="False" />
<Label Margin="2 2" Name="VoteWarningLabel" Text="{Loc 'ui-vote-abuse-warning'}" Visible="False" HorizontalAlignment="Center"/>
</BoxContainer>
<Label Name="VoteTypeTimeoutLabel" Visible="False" />
<Label Margin="8 2" Name="VoteTypeTimeoutLabel" Visible="False" />
</BoxContainer>

<Button Margin="8 2" Name="CreateButton" Text="{Loc 'ui-vote-create-button'}" />
<Button Margin="8 32 8 2" Name="CreateButton" Text="{Loc 'ui-vote-create-button'}" />

<PanelContainer StyleClasses="LowDivider" />
<Label Margin="12 0 0 0" StyleClasses="LabelSubText" Text="{Loc 'ui-vote-fluff'}" />
Expand Down
Loading

0 comments on commit 49e404a

Please sign in to comment.