diff --git a/Content.Client/Eui/BaseEui.cs b/Content.Client/Eui/BaseEui.cs index 7f86ded7e4..c11ba5a9b6 100644 --- a/Content.Client/Eui/BaseEui.cs +++ b/Content.Client/Eui/BaseEui.cs @@ -55,7 +55,7 @@ public virtual void HandleMessage(EuiMessageBase msg) /// protected void SendMessage(EuiMessageBase msg) { - var netMsg = _netManager.CreateNetMessage(); + var netMsg = new MsgEuiMessage(); netMsg.Id = Id; netMsg.Message = msg; diff --git a/Content.Client/Inventory/StrippableBoundUserInterface.cs b/Content.Client/Inventory/StrippableBoundUserInterface.cs index 4ccede7f5d..5f62a7a353 100644 --- a/Content.Client/Inventory/StrippableBoundUserInterface.cs +++ b/Content.Client/Inventory/StrippableBoundUserInterface.cs @@ -187,9 +187,15 @@ private void SlotPressed(GUIBoundKeyEventArgs ev, SlotControl slot) return; if (ev.Function == ContentKeyFunctions.ExamineEntity) + { _examine.DoExamine(slot.Entity.Value); + ev.Handle(); + } else if (ev.Function == EngineKeyFunctions.UseSecondary) + { _ui.GetUIController().OpenVerbMenu(slot.Entity.Value); + ev.Handle(); + } } private void AddInventoryButton(EntityUid invUid, string slotId, InventoryComponent inv) diff --git a/Content.Client/Light/HandheldLightSystem.cs b/Content.Client/Light/HandheldLightSystem.cs index 7f18223811..773ab5fc7a 100644 --- a/Content.Client/Light/HandheldLightSystem.cs +++ b/Content.Client/Light/HandheldLightSystem.cs @@ -21,6 +21,22 @@ public override void Initialize() SubscribeLocalEvent(OnAppearanceChange); } + /// + /// TODO: Not properly predicted yet. Don't call this function if you want a the actual return value! + /// + public override bool TurnOff(Entity ent, bool makeNoise = true) + { + return true; + } + + /// + /// TODO: Not properly predicted yet. Don't call this function if you want a the actual return value! + /// + public override bool TurnOn(EntityUid user, Entity uid) + { + return true; + } + private void OnAppearanceChange(EntityUid uid, HandheldLightComponent? component, ref AppearanceChangeEvent args) { if (!Resolve(uid, ref component)) diff --git a/Content.Client/SensorMonitoring/SensorMonitoringWindow.xaml.cs b/Content.Client/SensorMonitoring/SensorMonitoringWindow.xaml.cs index 9fc132c747..c839a0d90c 100644 --- a/Content.Client/SensorMonitoring/SensorMonitoringWindow.xaml.cs +++ b/Content.Client/SensorMonitoring/SensorMonitoringWindow.xaml.cs @@ -28,6 +28,7 @@ public sealed partial class SensorMonitoringWindow : FancyWindow, IComputerWindo public SensorMonitoringWindow() { RobustXamlLoader.Load(this); + IoCManager.InjectDependencies(this); } public void UpdateState(ConsoleUIState state) diff --git a/Content.Client/Store/Ui/StoreMenu.xaml.cs b/Content.Client/Store/Ui/StoreMenu.xaml.cs index 7eb597f2f3..5501dd6aec 100644 --- a/Content.Client/Store/Ui/StoreMenu.xaml.cs +++ b/Content.Client/Store/Ui/StoreMenu.xaml.cs @@ -57,7 +57,7 @@ public void UpdateBalance(Dictionary, FixedPoint2> ba foreach (var ((_, amount), proto) in currency) { balanceStr += Loc.GetString("store-ui-balance-display", ("amount", amount), - ("currency", Loc.GetString(proto.DisplayName, ("amount", 1)))); + ("currency", Loc.GetString(proto.DisplayName, ("amount", 1)))) + "\n"; } BalanceInfo.SetMarkup(balanceStr.TrimEnd()); @@ -66,7 +66,10 @@ public void UpdateBalance(Dictionary, FixedPoint2> ba foreach (var type in currency) { if (type.Value.CanWithdraw && type.Value.Cash != null && type.Key.Item2 > 0) + { disabled = false; + break; + } } WithdrawButton.Disabled = disabled; diff --git a/Content.Client/Store/Ui/StoreWithdrawWindow.xaml.cs b/Content.Client/Store/Ui/StoreWithdrawWindow.xaml.cs index 7936855756..a8b93cd2b3 100644 --- a/Content.Client/Store/Ui/StoreWithdrawWindow.xaml.cs +++ b/Content.Client/Store/Ui/StoreWithdrawWindow.xaml.cs @@ -18,7 +18,7 @@ public sealed partial class StoreWithdrawWindow : DefaultWindow { [Dependency] private readonly IPrototypeManager _prototypeManager = default!; - private Dictionary _validCurrencies = new(); + private Dictionary _validCurrencies = new(); private HashSet _buttons = new(); public event Action? OnWithdrawAttempt; @@ -36,7 +36,7 @@ public void CreateCurrencyButtons(Dictionary, FixedPo if (!_prototypeManager.TryIndex(currency.Key, out var proto)) continue; - _validCurrencies.Add(currency.Value, proto); + _validCurrencies.Add(proto, currency.Value); } //this shouldn't ever happen but w/e @@ -47,14 +47,17 @@ public void CreateCurrencyButtons(Dictionary, FixedPo _buttons.Clear(); foreach (var currency in _validCurrencies) { + if (!currency.Key.CanWithdraw) + continue; + var button = new CurrencyWithdrawButton() { - Id = currency.Value.ID, - Amount = currency.Key, + Id = currency.Key.ID, + Amount = currency.Value, MinHeight = 20, - Text = Loc.GetString("store-withdraw-button-ui", ("currency",Loc.GetString(currency.Value.DisplayName, ("amount", currency.Key)))), + Text = Loc.GetString("store-withdraw-button-ui", ("currency",Loc.GetString(currency.Key.DisplayName, ("amount", currency.Value)))), + Disabled = false, }; - button.Disabled = false; button.OnPressed += args => { OnWithdrawAttempt?.Invoke(args, button.Id, WithdrawSlider.Value); @@ -65,7 +68,7 @@ public void CreateCurrencyButtons(Dictionary, FixedPo ButtonContainer.AddChild(button); } - var maxWithdrawAmount = _validCurrencies.Keys.Max().Int(); + var maxWithdrawAmount = _validCurrencies.Values.Max().Int(); // setup withdraw slider WithdrawSlider.MinValue = 1; diff --git a/Content.Client/UserInterface/Systems/Chat/Widgets/ChatBox.xaml.cs b/Content.Client/UserInterface/Systems/Chat/Widgets/ChatBox.xaml.cs index a33bee20f9..a68958472b 100644 --- a/Content.Client/UserInterface/Systems/Chat/Widgets/ChatBox.xaml.cs +++ b/Content.Client/UserInterface/Systems/Chat/Widgets/ChatBox.xaml.cs @@ -16,9 +16,8 @@ namespace Content.Client.UserInterface.Systems.Chat.Widgets; [GenerateTypedNameReferences] -#pragma warning disable RA0003 +[Virtual] public partial class ChatBox : UIWidget -#pragma warning restore RA0003 { private readonly ChatUIController _controller; private readonly IEntityManager _entManager; diff --git a/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleButtonsBox.xaml b/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleButtonsBox.xaml new file mode 100644 index 0000000000..32d611e771 --- /dev/null +++ b/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleButtonsBox.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRolesEntry.xaml.cs b/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleButtonsBox.xaml.cs similarity index 86% rename from Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRolesEntry.xaml.cs rename to Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleButtonsBox.xaml.cs index fc53cc72ae..7df0243416 100644 --- a/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRolesEntry.xaml.cs +++ b/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleButtonsBox.xaml.cs @@ -10,20 +10,17 @@ namespace Content.Client.UserInterface.Systems.Ghost.Controls.Roles { [GenerateTypedNameReferences] - public sealed partial class GhostRolesEntry : BoxContainer + public sealed partial class GhostRoleButtonsBox : BoxContainer { private SpriteSystem _spriteSystem; public event Action? OnRoleSelected; public event Action? OnRoleFollow; - public GhostRolesEntry(string name, string description, bool hasAccess, FormattedMessage? reason, IEnumerable roles, SpriteSystem spriteSystem) + public GhostRoleButtonsBox(bool hasAccess, FormattedMessage? reason, IEnumerable roles, SpriteSystem spriteSystem) { RobustXamlLoader.Load(this); _spriteSystem = spriteSystem; - Title.Text = name; - Description.SetMessage(description); - foreach (var role in roles) { var button = new GhostRoleEntryButtons(role); diff --git a/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleEntryButtons.xaml b/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleEntryButtons.xaml index ffde5d69f7..05c52deef1 100644 --- a/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleEntryButtons.xaml +++ b/Content.Client/UserInterface/Systems/Ghost/Controls/Roles/GhostRoleEntryButtons.xaml @@ -1,15 +1,15 @@  + Orientation="Horizontal" + HorizontalAlignment="Stretch">