StoreUi.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. using Content.Shared.FixedPoint;
  2. using Robust.Shared.Prototypes;
  3. using Robust.Shared.Serialization;
  4. namespace Content.Shared.Store;
  5. [Serializable, NetSerializable]
  6. public enum StoreUiKey : byte
  7. {
  8. Key
  9. }
  10. [Serializable, NetSerializable]
  11. public sealed class StoreUpdateState : BoundUserInterfaceState
  12. {
  13. public readonly HashSet<ListingDataWithCostModifiers> Listings;
  14. public readonly Dictionary<ProtoId<CurrencyPrototype>, FixedPoint2> Balance;
  15. public readonly bool ShowFooter;
  16. public readonly bool AllowRefund;
  17. public StoreUpdateState(HashSet<ListingDataWithCostModifiers> listings, Dictionary<ProtoId<CurrencyPrototype>, FixedPoint2> balance, bool showFooter, bool allowRefund)
  18. {
  19. Listings = listings;
  20. Balance = balance;
  21. ShowFooter = showFooter;
  22. AllowRefund = allowRefund;
  23. }
  24. }
  25. [Serializable, NetSerializable]
  26. public sealed class StoreRequestUpdateInterfaceMessage : BoundUserInterfaceMessage
  27. {
  28. }
  29. [Serializable, NetSerializable]
  30. public sealed class StoreBuyListingMessage(ProtoId<ListingPrototype> listing) : BoundUserInterfaceMessage
  31. {
  32. public ProtoId<ListingPrototype> Listing = listing;
  33. }
  34. [Serializable, NetSerializable]
  35. public sealed class StoreRequestWithdrawMessage : BoundUserInterfaceMessage
  36. {
  37. public string Currency;
  38. public int Amount;
  39. public StoreRequestWithdrawMessage(string currency, int amount)
  40. {
  41. Currency = currency;
  42. Amount = amount;
  43. }
  44. }
  45. /// <summary>
  46. /// Used when the refund button is pressed
  47. /// </summary>
  48. [Serializable, NetSerializable]
  49. public sealed class StoreRequestRefundMessage : BoundUserInterfaceMessage
  50. {
  51. }