Option to delay uplink item purchase (#20214)
* Time delay for certain uplink stock. * Remove glitchy timer and add refresh button.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user