1
0

StoreRefundComponent.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. using Content.Server.Store.Systems;
  2. namespace Content.Server.Store.Components;
  3. // TODO: Refund on a per-item/action level.
  4. // Requires a refund button next to each purchase (disabled/invis by default)
  5. // Interactions with ActionUpgrades would need to be modified to reset all upgrade progress and return the original action purchase to the store.
  6. /// <summary>
  7. /// Keeps track of entities bought from stores for refunds, especially useful if entities get deleted before they can be refunded.
  8. /// </summary>
  9. [RegisterComponent, Access(typeof(StoreSystem))]
  10. public sealed partial class StoreRefundComponent : Component
  11. {
  12. /// <summary>
  13. /// The store this entity was bought from
  14. /// </summary>
  15. [DataField]
  16. public EntityUid? StoreEntity;
  17. /// <summary>
  18. /// The time this entity was bought
  19. /// </summary>
  20. [DataField]
  21. public TimeSpan? BoughtTime;
  22. /// <summary>
  23. /// How long until this entity disables refund purchase?
  24. /// </summary>
  25. [DataField]
  26. public TimeSpan DisableTime = TimeSpan.FromSeconds(300);
  27. }