diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index 53fad99b1a161..caad947fdd9a7 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -14,7 +14,7 @@
Small fixes/refactors are exempt. Media may be used in SS14 progress reports with credit. -->
## Requirements
-
+
- [ ] I have read and am following the [Pull Request and Changelog Guidelines](https://docs.spacestation14.com/en/general-development/codebase-info/pull-request-guidelines.html).
- [ ] I have added media to this PR or it does not require an in-game showcase.
diff --git a/Content.Client/Administration/AdminNameOverlay.cs b/Content.Client/Administration/AdminNameOverlay.cs
index abeed657323b0..d1a9f6f7a72a0 100644
--- a/Content.Client/Administration/AdminNameOverlay.cs
+++ b/Content.Client/Administration/AdminNameOverlay.cs
@@ -134,7 +134,7 @@ protected override void Draw(in OverlayDrawArgs args)
? null
: _prototypeManager.Index(playerInfo.RoleProto.Value);
- var roleName = Loc.GetString(rolePrototype?.Name ?? RoleTypePrototype.FallbackName);
+ var roleName = rolePrototype?.Name ?? RoleTypePrototype.FallbackName;
var roleColor = rolePrototype?.Color ?? RoleTypePrototype.FallbackColor;
var roleSymbol = rolePrototype?.Symbol ?? RoleTypePrototype.FallbackSymbol;
@@ -213,7 +213,7 @@ protected override void Draw(in OverlayDrawArgs args)
{
color = Color.GreenYellow;
color.A = alpha;
- args.ScreenHandle.DrawString(_font, screenCoordinates + currentOffset, Loc.GetString(playerInfo.StartingJob), uiScale, playerInfo.Connected ? color : colorDisconnected);
+ args.ScreenHandle.DrawString(_font, screenCoordinates + currentOffset, playerInfo.StartingJob, uiScale, playerInfo.Connected ? color : colorDisconnected);
currentOffset += lineoffset;
}
@@ -241,7 +241,7 @@ protected override void Draw(in OverlayDrawArgs args)
color = roleColor;
symbol = IsFiltered(playerInfo.RoleProto) ? symbol : string.Empty;
text = IsFiltered(playerInfo.RoleProto)
- ? roleName.ToUpper()
+ ? Loc.GetString(roleName).ToUpper()
: string.Empty;
break;
case AdminOverlayAntagFormat.Subtype:
diff --git a/Content.Client/Chemistry/UI/ChemMasterBoundUserInterface.cs b/Content.Client/Chemistry/UI/ChemMasterBoundUserInterface.cs
index a669a8da4c179..d0a9f5644cfac 100644
--- a/Content.Client/Chemistry/UI/ChemMasterBoundUserInterface.cs
+++ b/Content.Client/Chemistry/UI/ChemMasterBoundUserInterface.cs
@@ -48,6 +48,10 @@ protected override void Open()
(uint) _window.BottleDosage.Value, _window.LabelLine));
_window.BufferSortButton.OnPressed += _ => SendMessage(
new ChemMasterSortingTypeCycleMessage());
+ _window.OutputBufferDraw.OnPressed += _ => SendMessage(
+ new ChemMasterOutputDrawSourceMessage(ChemMasterDrawSource.Internal));
+ _window.OutputBeakerDraw.OnPressed += _ => SendMessage(
+ new ChemMasterOutputDrawSourceMessage(ChemMasterDrawSource.External));
for (uint i = 0; i < _window.PillTypeButtons.Length; i++)
{
diff --git a/Content.Client/Chemistry/UI/ChemMasterWindow.xaml b/Content.Client/Chemistry/UI/ChemMasterWindow.xaml
index 5bc640ab44786..cc2a1991727a1 100644
--- a/Content.Client/Chemistry/UI/ChemMasterWindow.xaml
+++ b/Content.Client/Chemistry/UI/ChemMasterWindow.xaml
@@ -79,10 +79,13 @@
-
+
+
+
-
-
+
+
+
diff --git a/Content.Client/Chemistry/UI/ChemMasterWindow.xaml.cs b/Content.Client/Chemistry/UI/ChemMasterWindow.xaml.cs
index d610f34b29f18..a8aab1d35f08b 100644
--- a/Content.Client/Chemistry/UI/ChemMasterWindow.xaml.cs
+++ b/Content.Client/Chemistry/UI/ChemMasterWindow.xaml.cs
@@ -150,7 +150,17 @@ public void UpdateState(BoundUserInterfaceState state)
// Ensure the Panel Info is updated, including UI elements for Buffer Volume, Output Container and so on
UpdatePanelInfo(castState);
- BufferCurrentVolume.Text = $" {castState.BufferCurrentVolume?.Int() ?? 0}u";
+ switch (castState.DrawSource)
+ {
+ case ChemMasterDrawSource.Internal:
+ SetBufferText(castState.BufferCurrentVolume, "chem-master-output-buffer-draw");
+ break;
+ case ChemMasterDrawSource.External:
+ SetBufferText(castState.InputContainerInfo?.CurrentVolume, "chem-master-output-beaker-draw");
+ break;
+ default:
+ throw new($"Chemmaster {castState.OutputContainerInfo} draw source is not set");
+ }
InputEjectButton.Disabled = castState.InputContainerInfo is null;
OutputEjectButton.Disabled = castState.OutputContainerInfo is null;
@@ -168,9 +178,14 @@ private void UpdateDosageFields(ChemMasterBoundUserInterfaceState castState)
var holdsReagents = output?.Reagents != null;
var pillNumberMax = holdsReagents ? 0 : remainingCapacity;
var bottleAmountMax = holdsReagents ? remainingCapacity : 0;
- var bufferVolume = castState.BufferCurrentVolume?.Int() ?? 0;
+ var outputVolume = castState.DrawSource switch
+ {
+ ChemMasterDrawSource.Internal => castState.BufferCurrentVolume?.Int() ?? 0,
+ ChemMasterDrawSource.External => castState.InputContainerInfo?.CurrentVolume.Int() ?? 0,
+ _ => 0,
+ };
- PillDosage.Value = (int)Math.Min(bufferVolume, castState.PillDosageLimit);
+ PillDosage.Value = (int)Math.Min(outputVolume, castState.PillDosageLimit);
PillTypeButtons[castState.SelectedPillType].Pressed = true;
@@ -186,25 +201,35 @@ private void UpdateDosageFields(ChemMasterBoundUserInterfaceState castState)
// Avoid division by zero
if (PillDosage.Value > 0)
{
- PillNumber.Value = Math.Min(bufferVolume / PillDosage.Value, pillNumberMax);
+ PillNumber.Value = Math.Min(outputVolume / PillDosage.Value, pillNumberMax);
}
else
{
PillNumber.Value = 0;
}
- BottleDosage.Value = Math.Min(bottleAmountMax, bufferVolume);
+ BottleDosage.Value = Math.Min(bottleAmountMax, outputVolume);
}
///
- /// Generate a product label based on reagents in the buffer.
+ /// Generate a product label based on reagents in the buffer or beaker.
///
/// State data sent by the server.
private string GenerateLabel(ChemMasterBoundUserInterfaceState state)
{
- if (state.BufferCurrentVolume == 0)
+ if (
+ state.BufferCurrentVolume == 0 && state.DrawSource == ChemMasterDrawSource.Internal ||
+ state.InputContainerInfo?.CurrentVolume == 0 && state.DrawSource == ChemMasterDrawSource.External ||
+ state.InputContainerInfo?.Reagents == null
+ )
return "";
- var reagent = state.BufferReagents.OrderBy(r => r.Quantity).First().Reagent;
+ var reagent = (state.DrawSource switch
+ {
+ ChemMasterDrawSource.Internal => state.BufferReagents,
+ ChemMasterDrawSource.External => state.InputContainerInfo.Reagents ?? [],
+ _ => throw new($"Chemmaster {state.OutputContainerInfo} draw source is not set"),
+ }).MinBy(r => r.Quantity)
+ .Reagent;
_prototypeManager.TryIndex(reagent.Prototype, out ReagentPrototype? proto);
return proto?.LocalizedName ?? "";
}
@@ -233,6 +258,8 @@ private void UpdatePanelInfo(ChemMasterBoundUserInterfaceState state)
_ => Loc.GetString("chem-master-window-sort-type-none")
};
+ OutputBufferDraw.Pressed = state.DrawSource == ChemMasterDrawSource.Internal;
+ OutputBeakerDraw.Pressed = state.DrawSource == ChemMasterDrawSource.External;
if (!state.BufferReagents.Any())
{
@@ -414,6 +441,12 @@ public string LabelLine
get => LabelLineEdit.Text;
set => LabelLineEdit.Text = value;
}
+
+ private void SetBufferText(FixedPoint2? volume, string text)
+ {
+ BufferCurrentVolume.Text = $" {volume ?? FixedPoint2.Zero}u";
+ DrawSource.Text = Loc.GetString(text);
+ }
}
public sealed class ReagentButton : Button
diff --git a/Content.Client/CombatMode/CombatModeIndicatorsOverlay.cs b/Content.Client/CombatMode/CombatModeIndicatorsOverlay.cs
index b2bdf2893df53..d852e20c45771 100644
--- a/Content.Client/CombatMode/CombatModeIndicatorsOverlay.cs
+++ b/Content.Client/CombatMode/CombatModeIndicatorsOverlay.cs
@@ -4,10 +4,8 @@
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Client.Input;
-using Robust.Client.Serialization;
using Robust.Client.UserInterface;
using Robust.Shared.Enums;
-using Robust.Shared.Graphics;
using Robust.Shared.Utility;
namespace Content.Client.CombatMode;
diff --git a/Content.Client/Construction/UI/ConstructionMenuPresenter.cs b/Content.Client/Construction/UI/ConstructionMenuPresenter.cs
index d5fee2bdda79c..6041b405c9112 100644
--- a/Content.Client/Construction/UI/ConstructionMenuPresenter.cs
+++ b/Content.Client/Construction/UI/ConstructionMenuPresenter.cs
@@ -30,7 +30,10 @@ internal sealed class ConstructionMenuPresenter : IDisposable
[Dependency] private readonly IUserInterfaceManager _uiManager = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;
[Dependency] private readonly IClientPreferencesManager _preferencesManager = default!;
+ [Dependency] private readonly ILogManager _logManager = default!;
+
private readonly SpriteSystem _spriteSystem;
+ private readonly ISawmill _sawmill;
private readonly IConstructionMenuView _constructionView;
private readonly EntityWhitelistSystem _whitelistSystem;
@@ -90,6 +93,7 @@ public ConstructionMenuPresenter()
_constructionView = new ConstructionMenu();
_whitelistSystem = _entManager.System();
_spriteSystem = _entManager.System();
+ _sawmill = _logManager.GetSawmill("construction.ui");
// This is required so that if we load after the system is initialized, we can bind to it immediately
if (_systemManager.TryGetEntitySystem(out var constructionSystem))
@@ -284,7 +288,7 @@ private void PopulateGrid(GridContainer recipesGrid,
if (!_constructionSystem!.TryGetRecipePrototype(recipe.ID, out var targetProtoId))
{
- Logger.Error("Cannot find the target prototype in the recipe cache with the id \"{0}\" of {1}.",
+ _sawmill.Error("Cannot find the target prototype in the recipe cache with the id \"{0}\" of {1}.",
recipe.ID,
nameof(ConstructionPrototype));
continue;
diff --git a/Content.Client/Guidebook/Controls/GuidebookRichPrototypeLink.cs b/Content.Client/Guidebook/Controls/GuidebookRichPrototypeLink.cs
index b54dd8b701ef7..1e8b524997d6d 100644
--- a/Content.Client/Guidebook/Controls/GuidebookRichPrototypeLink.cs
+++ b/Content.Client/Guidebook/Controls/GuidebookRichPrototypeLink.cs
@@ -42,7 +42,7 @@ public GuidebookRichPrototypeLink() : base()
public void SetMessage(FormattedMessage message)
{
_message = message;
- _richTextLabel.SetMessage(_message);
+ _richTextLabel.SetMessage(_message, tagsAllowed: null);
}
public IPrototype? LinkedPrototype { get; set; }
diff --git a/Content.Client/Guidebook/DocumentParsingManager.static.cs b/Content.Client/Guidebook/DocumentParsingManager.static.cs
index 3e37942381c02..c702ac97ad0b0 100644
--- a/Content.Client/Guidebook/DocumentParsingManager.static.cs
+++ b/Content.Client/Guidebook/DocumentParsingManager.static.cs
@@ -82,7 +82,7 @@ public sealed partial class DocumentParsingManager
}
msg.Pop();
- rt.SetMessage(msg);
+ rt.SetMessage(msg, tagsAllowed: null);
return rt;
},
TextParser)
diff --git a/Content.Client/Info/InfoSection.xaml.cs b/Content.Client/Info/InfoSection.xaml.cs
index 9e10a4d7b4b71..95a74c72c79c0 100644
--- a/Content.Client/Info/InfoSection.xaml.cs
+++ b/Content.Client/Info/InfoSection.xaml.cs
@@ -18,7 +18,7 @@ public void SetText(string title, string text, bool markup = false)
{
TitleLabel.Text = title;
if (markup)
- Content.SetMessage(FormattedMessage.FromMarkupOrThrow(text.Trim()));
+ Content.SetMessage(FormattedMessage.FromMarkupOrThrow(text.Trim()), tagsAllowed: null);
else
Content.SetMessage(text);
}
diff --git a/Content.Client/Info/ServerInfo.cs b/Content.Client/Info/ServerInfo.cs
index 901fc91337414..a28a3d4a6eab7 100644
--- a/Content.Client/Info/ServerInfo.cs
+++ b/Content.Client/Info/ServerInfo.cs
@@ -24,7 +24,7 @@ public ServerInfo()
}
public void SetInfoBlob(string markup)
{
- _richTextLabel.SetMessage(FormattedMessage.FromMarkupOrThrow(markup));
+ _richTextLabel.SetMessage(FormattedMessage.FromMarkupOrThrow(markup), tagsAllowed: null);
}
}
}
diff --git a/Content.Client/Kitchen/EntitySystems/ReagentGrinderSystem.cs b/Content.Client/Kitchen/EntitySystems/ReagentGrinderSystem.cs
new file mode 100644
index 0000000000000..5eebd4a0fba4c
--- /dev/null
+++ b/Content.Client/Kitchen/EntitySystems/ReagentGrinderSystem.cs
@@ -0,0 +1,8 @@
+using Content.Shared.Kitchen.EntitySystems;
+using JetBrains.Annotations;
+
+namespace Content.Client.Kitchen.EntitySystems;
+
+[UsedImplicitly]
+public sealed class ReagentGrinderSystem : SharedReagentGrinderSystem;
+
diff --git a/Content.Client/Launcher/LauncherConnecting.cs b/Content.Client/Launcher/LauncherConnecting.cs
index 33d31cc52d85f..9b9c472781ea4 100644
--- a/Content.Client/Launcher/LauncherConnecting.cs
+++ b/Content.Client/Launcher/LauncherConnecting.cs
@@ -20,8 +20,10 @@ public sealed class LauncherConnecting : Robust.Client.State.State
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IConfigurationManager _cfg = default!;
[Dependency] private readonly IClipboardManager _clipboard = default!;
+ [Dependency] private readonly ILogManager _logManager = default!;
private LauncherConnectingGui? _control;
+ private ISawmill _sawmill = default!;
private Page _currentPage;
private string? _connectFailReason;
@@ -61,6 +63,8 @@ protected override void Startup()
{
_control = new LauncherConnectingGui(this, _random, _prototypeManager, _cfg, _clipboard);
+ _sawmill = _logManager.GetSawmill("launcher-ui");
+
_userInterfaceManager.StateRoot.AddChild(_control);
_clientNetManager.ConnectFailed += OnConnectFailed;
@@ -115,12 +119,12 @@ public bool Redial()
}
else
{
- Logger.InfoS("launcher-ui", $"Redial not possible, no Ss14Address");
+ _sawmill.Info($"Redial not possible, no Ss14Address");
}
}
catch (Exception ex)
{
- Logger.ErrorS("launcher-ui", $"Redial exception: {ex}");
+ _sawmill.Error($"Redial exception: {ex}");
}
return false;
}
diff --git a/Content.Client/Power/Visualizers/PowerDeviceVisuals.cs b/Content.Client/Power/Visualizers/PowerDeviceVisuals.cs
index 5cc86d203d569..057dabae5d1f5 100644
--- a/Content.Client/Power/Visualizers/PowerDeviceVisuals.cs
+++ b/Content.Client/Power/Visualizers/PowerDeviceVisuals.cs
@@ -3,5 +3,6 @@ namespace Content.Client.Power;
/// Remains in use by portable scrubbers and lathes.
public enum PowerDeviceVisualLayers : byte
{
- Powered
+ Powered,
+ Charging
}
diff --git a/Content.Client/Research/ResearchSystem.cs b/Content.Client/Research/ResearchSystem.cs
index 7086fc928bcbe..55d953527293c 100644
--- a/Content.Client/Research/ResearchSystem.cs
+++ b/Content.Client/Research/ResearchSystem.cs
@@ -1,5 +1,8 @@
-using Content.Shared.Research.Systems;
+using Content.Shared.Research.Systems;
namespace Content.Client.Research;
-public sealed class ResearchSystem : SharedResearchSystem;
+public sealed class ResearchSystem : SharedResearchSystem
+{
+
+}
diff --git a/Content.Client/Research/UI/ResearchConsoleBoundUserInterface.cs b/Content.Client/Research/UI/ResearchConsoleBoundUserInterface.cs
index d5202eea5db15..2895ada61fbb9 100644
--- a/Content.Client/Research/UI/ResearchConsoleBoundUserInterface.cs
+++ b/Content.Client/Research/UI/ResearchConsoleBoundUserInterface.cs
@@ -7,22 +7,23 @@
namespace Content.Client.Research.UI;
[UsedImplicitly]
-public sealed class ResearchConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : BoundUserInterface(owner, uiKey)
+public sealed class ResearchConsoleBoundUserInterface : BoundUserInterface
{
[ViewVariables]
private ResearchConsoleMenu? _consoleMenu;
+ public ResearchConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
+ {
+ }
+
protected override void Open()
{
base.Open();
- _consoleMenu = this.CreateWindow();
- _consoleMenu.SetEntity(Owner);
+ var owner = Owner;
- _consoleMenu.OnTechnologyRediscoverPressed += () =>
- {
- SendMessage(new ConsoleRediscoverTechnologyMessage());
- };
+ _consoleMenu = this.CreateWindow();
+ _consoleMenu.SetEntity(owner);
_consoleMenu.OnTechnologyCardPressed += id =>
{
@@ -55,7 +56,6 @@ protected override void UpdateState(BoundUserInterfaceState state)
if (state is not ResearchConsoleBoundInterfaceState castState)
return;
-
_consoleMenu?.UpdatePanels(castState);
_consoleMenu?.UpdateInformationPanel(castState);
}
diff --git a/Content.Client/Research/UI/ResearchConsoleMenu.xaml b/Content.Client/Research/UI/ResearchConsoleMenu.xaml
index 8e3a74f93300a..8de9827c0c10f 100644
--- a/Content.Client/Research/UI/ResearchConsoleMenu.xaml
+++ b/Content.Client/Research/UI/ResearchConsoleMenu.xaml
@@ -1,4 +1,4 @@
-
-
? OnTechnologyCardPressed;
- public Action? OnTechnologyRediscoverPressed;
public Action? OnServerButtonPressed;
[Dependency] private readonly IEntityManager _entity = default!;
[Dependency] private readonly IPrototypeManager _prototype = default!;
[Dependency] private readonly IPlayerManager _player = default!;
- [Dependency] private readonly IGameTiming _timing = default!;
-
private readonly ResearchSystem _research;
private readonly SpriteSystem _sprite;
private readonly AccessReaderSystem _accessReader;
- // if set to null - we are waiting for server info and should not let rerolls
- private TimeSpan? _nextRediscover;
- private int _rediscoverCost;
- private int _serverPoints;
-
- private TimeSpan _nextUpdate;
- private readonly TimeSpan _updateInterval = TimeSpan.FromMilliseconds(500);
-
public EntityUid Entity;
public ResearchConsoleMenu()
@@ -53,7 +41,6 @@ public ResearchConsoleMenu()
_accessReader = _entity.System();
ServerButton.OnPressed += _ => OnServerButtonPressed?.Invoke();
- RediscoverButton.OnPressed += OnRediscoverPressed;
}
public void SetEntity(EntityUid entity)
@@ -77,7 +64,9 @@ public void UpdatePanels(ResearchConsoleBoundInterfaceState state)
MinHeight = 10
});
- var hasAccess = HasAccess();
+ var hasAccess = _player.LocalEntity is not { } local ||
+ !_entity.TryGetComponent(Entity, out var access) ||
+ _accessReader.IsAllowed(local, Entity, access);
foreach (var techId in database.CurrentTechnologyCards)
{
var tech = _prototype.Index(techId);
@@ -90,12 +79,6 @@ public void UpdatePanels(ResearchConsoleBoundInterfaceState state)
SyncTechnologyList(UnlockedCardsContainer, unlockedTech);
}
- private void UpdateRediscoverButton()
- {
- RediscoverButton.Disabled = !HasAccess() || _serverPoints < _rediscoverCost || _timing.CurTime < _nextRediscover;
- RediscoverButton.Text = Loc.GetString("research-console-menu-server-rediscover-button", ("cost", _rediscoverCost));
- }
-
public void UpdateInformationPanel(ResearchConsoleBoundInterfaceState state)
{
var amountMsg = new FormattedMessage();
@@ -154,27 +137,6 @@ public void UpdateInformationPanel(ResearchConsoleBoundInterfaceState state)
};
TierDisplayContainer.AddChild(control);
}
-
- _serverPoints = state.Points;
- _rediscoverCost = state.RediscoverCost;
- _nextRediscover = state.NextRediscover;
-
- UpdateRediscoverButton();
- }
-
- private void OnRediscoverPressed(BaseButton.ButtonEventArgs args)
- {
- RediscoverButton.Disabled = true;
- _nextRediscover = null;
-
- OnTechnologyRediscoverPressed?.Invoke();
- }
-
- private bool HasAccess()
- {
- return _player.LocalEntity is not { } local
- || !_entity.TryGetComponent(Entity, out var access)
- || _accessReader.IsAllowed(local, Entity, access);
}
///
@@ -217,24 +179,5 @@ private void SyncTechnologyList(BoxContainer container, IEnumerable
- protected override void FrameUpdate(FrameEventArgs args)
- {
- base.FrameUpdate(args);
-
- if(_nextUpdate > _timing.CurTime)
- return;
-
- _nextUpdate = _timing.CurTime + _updateInterval;
-
- if (!RediscoverButton.Disabled)
- return;
-
- if (_nextRediscover == null || _nextRediscover > _timing.CurTime)
- return;
-
- UpdateRediscoverButton();
- }
}
diff --git a/Content.Client/Shuttles/BUI/IFFConsoleBoundUserInterface.cs b/Content.Client/Shuttles/BUI/IFFConsoleBoundUserInterface.cs
index 8d84abed8a5c4..704307f06b792 100644
--- a/Content.Client/Shuttles/BUI/IFFConsoleBoundUserInterface.cs
+++ b/Content.Client/Shuttles/BUI/IFFConsoleBoundUserInterface.cs
@@ -23,7 +23,6 @@ protected override void Open()
_window = this.CreateWindowCenteredLeft();
_window.ShowIFF += SendIFFMessage;
- _window.ShowVessel += SendVesselMessage;
}
protected override void UpdateState(BoundUserInterfaceState state)
@@ -44,14 +43,6 @@ private void SendIFFMessage(bool obj)
});
}
- private void SendVesselMessage(bool obj)
- {
- SendMessage(new IFFShowVesselMessage()
- {
- Show = obj,
- });
- }
-
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
diff --git a/Content.Client/Shuttles/UI/IFFConsoleWindow.xaml b/Content.Client/Shuttles/UI/IFFConsoleWindow.xaml
index dab11a7b62270..90684889a688e 100644
--- a/Content.Client/Shuttles/UI/IFFConsoleWindow.xaml
+++ b/Content.Client/Shuttles/UI/IFFConsoleWindow.xaml
@@ -9,12 +9,6 @@
-
-
-
-
-
-
diff --git a/Content.Client/Shuttles/UI/IFFConsoleWindow.xaml.cs b/Content.Client/Shuttles/UI/IFFConsoleWindow.xaml.cs
index f14ef22c3c3ab..d61486d2d8613 100644
--- a/Content.Client/Shuttles/UI/IFFConsoleWindow.xaml.cs
+++ b/Content.Client/Shuttles/UI/IFFConsoleWindow.xaml.cs
@@ -13,9 +13,7 @@ public sealed partial class IFFConsoleWindow : FancyWindow,
IComputerWindow
{
private readonly ButtonGroup _showIFFButtonGroup = new();
- private readonly ButtonGroup _showVesselButtonGroup = new();
public event Action? ShowIFF;
- public event Action? ShowVessel;
public IFFConsoleWindow()
{
@@ -24,11 +22,6 @@ public IFFConsoleWindow()
ShowIFFOnButton.Group = _showIFFButtonGroup;
ShowIFFOnButton.OnPressed += args => ShowIFFPressed(true);
ShowIFFOffButton.OnPressed += args => ShowIFFPressed(false);
-
- ShowVesselOffButton.Group = _showVesselButtonGroup;
- ShowVesselOnButton.Group = _showVesselButtonGroup;
- ShowVesselOnButton.OnPressed += args => ShowVesselPressed(true);
- ShowVesselOffButton.OnPressed += args => ShowVesselPressed(false);
}
private void ShowIFFPressed(bool pressed)
@@ -36,19 +29,14 @@ private void ShowIFFPressed(bool pressed)
ShowIFF?.Invoke(pressed);
}
- private void ShowVesselPressed(bool pressed)
- {
- ShowVessel?.Invoke(pressed);
- }
-
public void UpdateState(IFFConsoleBoundUserInterfaceState state)
{
- if ((state.AllowedFlags & IFFFlags.HideLabel) != 0x0)
+ if ((state.AllowedFlags & IFFFlags.HideLabel) != 0x0 || (state.AllowedFlags & IFFFlags.Hide) != 0x0)
{
ShowIFFOffButton.Disabled = false;
ShowIFFOnButton.Disabled = false;
- if ((state.Flags & IFFFlags.HideLabel) != 0x0)
+ if ((state.Flags & IFFFlags.HideLabel) != 0x0 || (state.Flags & IFFFlags.Hide) != 0x0)
{
ShowIFFOffButton.Pressed = true;
}
@@ -62,25 +50,5 @@ public void UpdateState(IFFConsoleBoundUserInterfaceState state)
ShowIFFOffButton.Disabled = true;
ShowIFFOnButton.Disabled = true;
}
-
- if ((state.AllowedFlags & IFFFlags.Hide) != 0x0)
- {
- ShowVesselOffButton.Disabled = false;
- ShowVesselOnButton.Disabled = false;
-
- if ((state.Flags & IFFFlags.Hide) != 0x0)
- {
- ShowVesselOffButton.Pressed = true;
- }
- else
- {
- ShowVesselOnButton.Pressed = true;
- }
- }
- else
- {
- ShowVesselOffButton.Disabled = true;
- ShowVesselOnButton.Disabled = true;
- }
}
}
diff --git a/Content.Client/Silicons/Borgs/BorgModuleControl.xaml b/Content.Client/Silicons/Borgs/BorgModuleControl.xaml
index 2f6e25f983912..1be7cea8d905f 100644
--- a/Content.Client/Silicons/Borgs/BorgModuleControl.xaml
+++ b/Content.Client/Silicons/Borgs/BorgModuleControl.xaml
@@ -3,10 +3,10 @@
StyleClasses="PanelLight"
Margin="5 5 5 0">
+
-
diff --git a/Content.Client/SmartFridge/SmartFridgeBoundUserInterface.cs b/Content.Client/SmartFridge/SmartFridgeBoundUserInterface.cs
index 60d8ea413a558..a364c8e6b9fae 100644
--- a/Content.Client/SmartFridge/SmartFridgeBoundUserInterface.cs
+++ b/Content.Client/SmartFridge/SmartFridgeBoundUserInterface.cs
@@ -19,12 +19,13 @@ protected override void Open()
_menu = this.CreateWindow();
_menu.OnItemSelected += OnItemSelected;
+ _menu.OnRemoveButtonPressed += data => SendPredictedMessage(new SmartFridgeRemoveEntryMessage(data.Entry));
Refresh();
}
public void Refresh()
{
- if (_menu is not {} menu || !EntMan.TryGetComponent(Owner, out SmartFridgeComponent? fridge))
+ if (_menu is not { } menu || !EntMan.TryGetComponent(Owner, out SmartFridgeComponent? fridge))
return;
menu.SetFlavorText(Loc.GetString(fridge.FlavorText));
diff --git a/Content.Client/SmartFridge/SmartFridgeItem.xaml b/Content.Client/SmartFridge/SmartFridgeItem.xaml
index 3960d7ce42007..17eb89801ee94 100644
--- a/Content.Client/SmartFridge/SmartFridgeItem.xaml
+++ b/Content.Client/SmartFridge/SmartFridgeItem.xaml
@@ -13,4 +13,10 @@
SizeFlagsStretchRatio="3"
HorizontalExpand="True"
ClipText="True"/>
+
diff --git a/Content.Client/SmartFridge/SmartFridgeItem.xaml.cs b/Content.Client/SmartFridge/SmartFridgeItem.xaml.cs
index c69d2e7de2372..1d1403878d057 100644
--- a/Content.Client/SmartFridge/SmartFridgeItem.xaml.cs
+++ b/Content.Client/SmartFridge/SmartFridgeItem.xaml.cs
@@ -8,11 +8,18 @@ namespace Content.Client.SmartFridge;
[GenerateTypedNameReferences]
public sealed partial class SmartFridgeItem : BoxContainer
{
+ public Action? RemoveButtonPressed;
+
public SmartFridgeItem(EntityUid uid, string text)
{
RobustXamlLoader.Load(this);
EntityView.SetEntity(uid);
NameLabel.Text = text;
+
+ RemoveButton.OnPressed += _ => RemoveButtonPressed?.Invoke();
+
+ if (uid.IsValid())
+ RemoveButton.Visible = false;
}
}
diff --git a/Content.Client/SmartFridge/SmartFridgeMenu.xaml.cs b/Content.Client/SmartFridge/SmartFridgeMenu.xaml.cs
index c896e7fada113..ee3b3a8e7a974 100644
--- a/Content.Client/SmartFridge/SmartFridgeMenu.xaml.cs
+++ b/Content.Client/SmartFridge/SmartFridgeMenu.xaml.cs
@@ -17,6 +17,7 @@ public sealed partial class SmartFridgeMenu : FancyWindow
[Dependency] private readonly IEntityManager _entityManager = default!;
public event Action? OnItemSelected;
+ public event Action? OnRemoveButtonPressed;
private readonly StyleBoxFlat _styleBox = new() { BackgroundColor = new Color(70, 73, 102) };
@@ -48,8 +49,10 @@ private void GenerateButton(ListData data, ListContainerButton button)
return;
var label = Loc.GetString("smart-fridge-list-item", ("item", entry.Entry.Name), ("amount", entry.Amount));
- button.AddChild(new SmartFridgeItem(entry.Representative, label));
+ var item = new SmartFridgeItem(entry.Representative, label);
+ item.RemoveButtonPressed += () => OnRemoveButtonPressed?.Invoke(entry);
+ button.AddChild(item);
button.ToolTip = label;
button.StyleBoxOverride = _styleBox;
}
diff --git a/Content.Client/SmartFridge/SmartFridgeSystem.cs b/Content.Client/SmartFridge/SmartFridgeSystem.cs
new file mode 100644
index 0000000000000..cd3aeb6958e10
--- /dev/null
+++ b/Content.Client/SmartFridge/SmartFridgeSystem.cs
@@ -0,0 +1,18 @@
+using Content.Shared.SmartFridge;
+
+namespace Content.Client.SmartFridge;
+
+public sealed class SmartFridgeSystem : SharedSmartFridgeSystem
+{
+ [Dependency] private readonly SharedUserInterfaceSystem _uiSystem = default!;
+
+ protected override void UpdateUI(Entity ent)
+ {
+ base.UpdateUI(ent);
+
+ if (!_uiSystem.TryGetOpenUi(ent.Owner, SmartFridgeUiKey.Key, out var bui))
+ return;
+
+ bui.Refresh();
+ }
+}
diff --git a/Content.Client/SmartFridge/SmartFridgeUISystem.cs b/Content.Client/SmartFridge/SmartFridgeUISystem.cs
deleted file mode 100644
index 4068c27e057cd..0000000000000
--- a/Content.Client/SmartFridge/SmartFridgeUISystem.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using Content.Shared.SmartFridge;
-using Robust.Shared.Analyzers;
-
-namespace Content.Client.SmartFridge;
-
-public sealed class SmartFridgeUISystem : EntitySystem
-{
- [Dependency] private readonly SharedUserInterfaceSystem _uiSystem = default!;
-
- public override void Initialize()
- {
- base.Initialize();
-
- SubscribeLocalEvent(OnSmartFridgeAfterState);
- }
-
- private void OnSmartFridgeAfterState(Entity ent, ref AfterAutoHandleStateEvent args)
- {
- if (!_uiSystem.TryGetOpenUi(ent.Owner, SmartFridgeUiKey.Key, out var bui))
- return;
-
- bui.Refresh();
- }
-}
diff --git a/Content.Client/Stylesheets/Sheetlets/LabelSheetlet.cs b/Content.Client/Stylesheets/Sheetlets/LabelSheetlet.cs
index 77c554a9f36ae..fc23f9c7fbbf7 100644
--- a/Content.Client/Stylesheets/Sheetlets/LabelSheetlet.cs
+++ b/Content.Client/Stylesheets/Sheetlets/LabelSheetlet.cs
@@ -69,10 +69,10 @@ public override StyleRule[] GetRules(PalettedStylesheet sheet, object config)
.Class(StyleClass.LabelMonospaceText)
.Prop(Label.StylePropertyFont, robotoMonoBold11),
E