From: Repo <47093363+Titian3@users.noreply.github.com> Date: Tue, 19 Sep 2023 23:51:15 +0000 (+1200) Subject: Option to delay uplink item purchase (#20214) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=41139bf2b2afa0166d6774e8001a18baef662b96;p=space-station-14.git Option to delay uplink item purchase (#20214) * Time delay for certain uplink stock. * Remove glitchy timer and add refresh button. --- diff --git a/Content.Client/Store/Ui/StoreBoundUserInterface.cs b/Content.Client/Store/Ui/StoreBoundUserInterface.cs index 0860abb9fa..6774ef35a0 100644 --- a/Content.Client/Store/Ui/StoreBoundUserInterface.cs +++ b/Content.Client/Store/Ui/StoreBoundUserInterface.cs @@ -2,6 +2,9 @@ using Content.Shared.Store; using JetBrains.Annotations; using Robust.Client.GameObjects; using System.Linq; +using System.Threading; +using Serilog; +using Timer = Robust.Shared.Timing.Timer; namespace Content.Client.Store.Ui; @@ -40,6 +43,11 @@ public sealed class StoreBoundUserInterface : BoundUserInterface { SendMessage(new StoreRequestWithdrawMessage(type, amount)); }; + + _menu.OnRefreshButtonPressed += (_) => + { + SendMessage(new StoreRequestUpdateInterfaceMessage()); + }; } protected override void UpdateState(BoundUserInterfaceState state) { @@ -53,6 +61,7 @@ public sealed class StoreBoundUserInterface : BoundUserInterface case StoreUpdateState msg: _menu.UpdateBalance(msg.Balance); _menu.PopulateStoreCategoryButtons(msg.Listings); + _menu.UpdateListing(msg.Listings.ToList()); _menu.SetFooterVisibility(msg.ShowFooter); break; @@ -71,7 +80,6 @@ public sealed class StoreBoundUserInterface : BoundUserInterface base.Dispose(disposing); if (!disposing) return; - _menu?.Close(); _menu?.Dispose(); } diff --git a/Content.Client/Store/Ui/StoreMenu.xaml b/Content.Client/Store/Ui/StoreMenu.xaml index 824c153671..a454e3e2b7 100644 --- a/Content.Client/Store/Ui/StoreMenu.xaml +++ b/Content.Client/Store/Ui/StoreMenu.xaml @@ -12,6 +12,11 @@ HorizontalAlignment="Left" Access="Public" HorizontalExpand="True" /> +