From: keronshb <54602815+keronshb@users.noreply.github.com> Date: Sun, 4 Feb 2024 00:48:51 +0000 (-0500) Subject: Adds a refund button & action upgrades for stores (#24518) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=257909fd97c05bfde837a76afe5c5c612afc9f28;p=space-station-14.git Adds a refund button & action upgrades for stores (#24518) * adds refunds to stores * Adds method to check for starting map * comments, datafields, some requested changes * turns event into ref event * Adds datafields * Switches to entity terminating event * Changes store entity to be nullable and checks if store is terminating to remove reference. * Tryadd instead of containskey * Adds a refund disable method, disables refund on bought ent container changes if not an action * Removes datafield specification * Readds missing using statement * Removes unused using statements * What the heck is listing data --------- Co-authored-by: metalgearsloth --- diff --git a/Content.Client/Store/Ui/StoreBoundUserInterface.cs b/Content.Client/Store/Ui/StoreBoundUserInterface.cs index 6774ef35a0..b549918d7c 100644 --- a/Content.Client/Store/Ui/StoreBoundUserInterface.cs +++ b/Content.Client/Store/Ui/StoreBoundUserInterface.cs @@ -48,6 +48,11 @@ public sealed class StoreBoundUserInterface : BoundUserInterface { SendMessage(new StoreRequestUpdateInterfaceMessage()); }; + + _menu.OnRefundAttempt += (_) => + { + SendMessage(new StoreRequestRefundMessage()); + }; } protected override void UpdateState(BoundUserInterfaceState state) { @@ -64,6 +69,7 @@ public sealed class StoreBoundUserInterface : BoundUserInterface _menu.UpdateListing(msg.Listings.ToList()); _menu.SetFooterVisibility(msg.ShowFooter); + _menu.UpdateRefund(msg.AllowRefund); break; case StoreInitializeState msg: _windowName = msg.Name; diff --git a/Content.Client/Store/Ui/StoreMenu.xaml b/Content.Client/Store/Ui/StoreMenu.xaml index a454e3e2b7..4b38352a44 100644 --- a/Content.Client/Store/Ui/StoreMenu.xaml +++ b/Content.Client/Store/Ui/StoreMenu.xaml @@ -22,6 +22,11 @@ MinWidth="64" HorizontalAlignment="Right" Text="{Loc 'store-ui-default-withdraw-text'}" /> +