fish-station/Content.Server/Store/Systems/StoreSystem.Ui.cs
Vigers Ray d0f5e8d361 Merge remote-tracking branch 'space-wizards/master'
# Conflicts:
#	.github/workflows/validate-rgas.yml
#	.github/workflows/validate-rsis.yml
#	Content.Client/Changelog/ChangelogTab.xaml.cs
#	Content.Client/Humanoid/HumanoidAppearanceSystem.cs
#	Content.Client/Options/UI/OptionsMenu.xaml.cs
#	Content.Client/SubFloor/SubFloorHideSystem.cs
#	Content.Client/UserInterface/Systems/Ghost/Widgets/GhostGui.xaml.cs
#	Content.Server/Advertise/EntitySystems/SpeakOnUIClosedSystem.cs
#	Content.Server/Antag/AntagSelectionSystem.cs
#	Content.Server/Arcade/SpaceVillainGame/SpaceVillainArcadeSystem.cs
#	Content.Server/Explosion/EntitySystems/TriggerSystem.cs
#	Content.Server/Mindshield/MindShieldSystem.cs
#	Content.Server/Objectives/Systems/KillPersonConditionSystem.cs
#	Content.Server/Standing/StandingStateSystem.cs
#	Content.Server/Station/Systems/StationJobsSystem.Roundstart.cs
#	Content.Server/VendingMachines/VendingMachineSystem.cs
#	Content.Server/Zombies/ZombieSystem.Transform.cs
#	Content.Server/Zombies/ZombieSystem.cs
#	Content.Shared/Damage/Systems/DamageableSystem.cs
#	Content.Shared/Humanoid/HumanoidAppearanceComponent.cs
#	Content.Shared/Humanoid/Markings/MarkingManager.cs
#	Content.Shared/Humanoid/NamingSystem.cs
#	Content.Shared/Humanoid/Prototypes/SpeciesPrototype.cs
#	Content.Shared/Humanoid/SharedHumanoidAppearanceSystem.cs
#	Content.Shared/Implants/Components/SubdermalImplantComponent.cs
#	Content.Shared/Standing/StandingStateSystem.cs
#	Content.Shared/VendingMachines/SharedVendingMachineSystem.cs
#	Content.Shared/VendingMachines/VendingMachineComponent.cs
#	Resources/Audio/Lobby/attributions.yml
#	Resources/Locale/en-US/_strings/administration/commands/forceghost.ftl
#	Resources/Locale/en-US/_strings/clothing/components/fire-protection-component.ftl
#	Resources/Locale/en-US/_strings/components/storage-voice-control-component.ftl
#	Resources/Locale/en-US/_strings/prototypes/roles/antags.ftl
#	Resources/Locale/en-US/_strings/reagents/meta/physical-desc.ftl
#	Resources/Locale/en-US/lathe/lathe-categories.ftl
#	Resources/Prototypes/Access/command.yml
#	Resources/Prototypes/Catalog/Fills/Books/bookshelf.yml
#	Resources/Prototypes/Catalog/Fills/Lockers/heads.yml
#	Resources/Prototypes/Catalog/Fills/Lockers/misc.yml
#	Resources/Prototypes/Catalog/VendingMachines/Inventories/chemvend.yml
#	Resources/Prototypes/Catalog/thief_toolbox_sets.yml
#	Resources/Prototypes/Datasets/Names/Operation_prefix.yml
#	Resources/Prototypes/Datasets/Names/Operation_suffix.yml
#	Resources/Prototypes/Datasets/Names/arachnid_first.yml
#	Resources/Prototypes/Datasets/Names/arachnid_last.yml
#	Resources/Prototypes/Datasets/Names/borg.yml
#	Resources/Prototypes/Datasets/Names/cargo_shuttle.yml
#	Resources/Prototypes/Datasets/Names/clown.yml
#	Resources/Prototypes/Datasets/Names/diona.yml
#	Resources/Prototypes/Datasets/Names/fake_human_first.yml
#	Resources/Prototypes/Datasets/Names/fake_human_last.yml
#	Resources/Prototypes/Datasets/Names/first.yml
#	Resources/Prototypes/Datasets/Names/first_female.yml
#	Resources/Prototypes/Datasets/Names/first_male.yml
#	Resources/Prototypes/Datasets/Names/fortunes.yml
#	Resources/Prototypes/Datasets/Names/hologram.yml
#	Resources/Prototypes/Datasets/Names/last.yml
#	Resources/Prototypes/Datasets/Names/military.yml
#	Resources/Prototypes/Datasets/Names/moth_first_female.yml
#	Resources/Prototypes/Datasets/Names/moth_first_male.yml
#	Resources/Prototypes/Datasets/Names/moth_last.yml
#	Resources/Prototypes/Datasets/Names/mushman_first.yml
#	Resources/Prototypes/Datasets/Names/mushman_last.yml
#	Resources/Prototypes/Datasets/Names/ninja.yml
#	Resources/Prototypes/Datasets/Names/ninja_title.yml
#	Resources/Prototypes/Datasets/Names/regalrat.yml
#	Resources/Prototypes/Datasets/Names/reptilian_female.yml
#	Resources/Prototypes/Datasets/Names/reptilian_male.yml
#	Resources/Prototypes/Datasets/Names/revenant.yml
#	Resources/Prototypes/Datasets/Names/skeleton_first.yml
#	Resources/Prototypes/Datasets/Names/syndicate.yml
#	Resources/Prototypes/Datasets/Names/vox.yml
#	Resources/Prototypes/Datasets/Names/wizard_first.yml
#	Resources/Prototypes/Datasets/Names/wizard_last.yml
#	Resources/Prototypes/Datasets/adjectives.yml
#	Resources/Prototypes/Datasets/corporations.yml
#	Resources/Prototypes/Datasets/criminal_records.yml
#	Resources/Prototypes/Datasets/rat_king_commands.yml
#	Resources/Prototypes/Datasets/verbs.yml
#	Resources/Prototypes/Entities/Clothing/Head/specific.yml
#	Resources/Prototypes/Entities/Clothing/OuterClothing/coats.yml
#	Resources/Prototypes/Entities/Clothing/OuterClothing/specific.yml
#	Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml
#	Resources/Prototypes/Entities/Mobs/NPCs/revenant.yml
#	Resources/Prototypes/Entities/Mobs/Player/human.yml
#	Resources/Prototypes/Entities/Mobs/Player/humanoid.yml
#	Resources/Prototypes/Entities/Mobs/Species/arachnid.yml
#	Resources/Prototypes/Entities/Mobs/Species/base.yml
#	Resources/Prototypes/Entities/Mobs/Species/moth.yml
#	Resources/Prototypes/Entities/Mobs/Species/vox.yml
#	Resources/Prototypes/Entities/Objects/Devices/pda.yml
#	Resources/Prototypes/Entities/Objects/Misc/paper.yml
#	Resources/Prototypes/Entities/Objects/Misc/subdermal_implants.yml
#	Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/shotgun.yml
#	Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml
#	Resources/Prototypes/Entities/Stations/nanotrasen.yml
#	Resources/Prototypes/Entities/Structures/Furniture/carpets.yml
#	Resources/Prototypes/Entities/Structures/Storage/Closets/wall_lockers.yml
#	Resources/Prototypes/GameRules/roundstart.yml
#	Resources/Prototypes/Procedural/salvage_loot.yml
#	Resources/Prototypes/Reagents/Consumable/Drink/alcohol.yml
#	Resources/Prototypes/Recipes/Lathes/biogen.yml
#	Resources/Prototypes/Recipes/Lathes/categories.yml
#	Resources/Prototypes/Roles/Jobs/Security/warden.yml
#	Resources/Prototypes/Species/arachnid.yml
#	Resources/Prototypes/Species/diona.yml
#	Resources/Prototypes/Species/moth.yml
#	Resources/Prototypes/ai_factions.yml
#	Resources/Prototypes/game_presets.yml
#	Resources/ServerInfo/Guidebook/Mobs/SlimePerson.xml
#	Resources/ServerInfo/Guidebook/ServerRules/SpaceLaw/SpaceLaw.xml
#	Resources/ServerInfo/Guidebook/Service/Botany.xml
#	Resources/Textures/Clothing/Eyes/Glasses/glasses.rsi/meta.json
#	Resources/Textures/Clothing/Eyes/Glasses/jamjar.rsi/meta.json
#	Resources/Textures/Clothing/Eyes/Glasses/mercglasses.rsi/meta.json
#	Resources/Textures/Clothing/Eyes/Glasses/meson.rsi/meta.json
#	Resources/Textures/Clothing/Eyes/Glasses/ninjavisor.rsi/meta.json
#	Resources/Textures/Clothing/Eyes/Glasses/outlawglasses.rsi/meta.json
#	Resources/Textures/Clothing/Eyes/Glasses/science.rsi/meta.json
#	Resources/Textures/Clothing/Eyes/Glasses/secglasses.rsi/meta.json
#	Resources/Textures/Clothing/Eyes/Glasses/sunglasses.rsi/meta.json
#	Resources/Textures/Clothing/Eyes/Glasses/thermal.rsi/meta.json
#	Resources/Textures/Clothing/Eyes/Hud/beergoggles.rsi/inhand-left.png
#	Resources/Textures/Clothing/Eyes/Hud/beergoggles.rsi/inhand-right.png
#	Resources/Textures/Clothing/Eyes/Hud/beergoggles.rsi/meta.json
#	Resources/Textures/Clothing/Eyes/Hud/synd.rsi/meta.json
#	Resources/Textures/Clothing/Eyes/Hud/syndagent.rsi/meta.json
#	Resources/Textures/Clothing/Head/Hats/capcap.rsi/inhand-left.png
#	Resources/Textures/Clothing/Head/Hats/capcap.rsi/inhand-right.png
#	Resources/Textures/Clothing/Head/Hats/capcap.rsi/meta.json
#	Resources/Textures/Interface/Misc/program_icons.rsi/meta.json
#	Resources/Textures/Objects/Misc/Lights/lights.rsi/meta.json
#	Resources/Textures/Objects/Misc/bureaucracy.rsi/meta.json
#	Resources/Textures/Objects/Specific/Hydroponics/aloe.rsi/meta.json
#	Resources/Textures/Objects/Specific/Hydroponics/apple.rsi/meta.json
#	Resources/Textures/Objects/Specific/Hydroponics/carrot.rsi/meta.json
#	Resources/Textures/Objects/Specific/Hydroponics/chanterelle.rsi/meta.json
#	Resources/Textures/Objects/Specific/Hydroponics/chili.rsi/meta.json
#	Resources/Textures/Objects/Specific/Hydroponics/eggplant.rsi/meta.json
#	Resources/Textures/Objects/Specific/Hydroponics/gatfruit.rsi/meta.json
#	Resources/Textures/Objects/Specific/Hydroponics/lemon.rsi/meta.json
#	Resources/Textures/Objects/Specific/Hydroponics/onion_red.rsi/meta.json
#	Resources/Textures/Objects/Specific/Hydroponics/potato.rsi/meta.json
#	Resources/Textures/Objects/Specific/Hydroponics/sugarcane.rsi/meta.json
#	Resources/Textures/Objects/Specific/Hydroponics/tomato.rsi/meta.json
#	Resources/Textures/Objects/Specific/Robotics/borgmodule.rsi/meta.json
#	Resources/Textures/Objects/Specific/Robotics/cyborg_parts.rsi/meta.json
#	Resources/Textures/Objects/Tools/spray_painter.rsi/meta.json
#	Resources/Textures/Objects/Weapons/Grenades/flashbang.rsi/meta.json
#	Resources/Textures/Objects/Weapons/Grenades/grenade.rsi/meta.json
#	Resources/Textures/Objects/Weapons/Grenades/nukenade.rsi/meta.json
#	Resources/migration.yml
#	Tools/actions_changelogs_since_last_run.py
2025-03-25 11:30:01 +03:00

422 lines
15 KiB
C#

using System.Linq;
using Content.Server.Actions;
using Content.Server.Administration.Logs;
using Content.Server.PDA.Ringer;
using Content.Server.Stack;
using Content.Server.Store.Components;
using Content.Shared.Actions;
using Content.Shared.Database;
using Content.Shared.FixedPoint;
using Content.Shared.Hands.EntitySystems;
using Content.Shared.Mind;
using Content.Shared.Store;
using Content.Shared.Store.Components;
using Content.Shared.UserInterface;
using Robust.Server.GameObjects;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
namespace Content.Server.Store.Systems;
public sealed partial class StoreSystem
{
[Dependency] private readonly IAdminLogManager _admin = default!;
[Dependency] private readonly SharedHandsSystem _hands = default!;
[Dependency] private readonly ActionsSystem _actions = default!;
[Dependency] private readonly ActionContainerSystem _actionContainer = default!;
[Dependency] private readonly ActionUpgradeSystem _actionUpgrade = default!;
[Dependency] private readonly SharedMindSystem _mind = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly StackSystem _stack = default!;
[Dependency] private readonly UserInterfaceSystem _ui = default!;
private void InitializeUi()
{
SubscribeLocalEvent<StoreComponent, StoreRequestUpdateInterfaceMessage>(OnRequestUpdate);
SubscribeLocalEvent<StoreComponent, StoreBuyListingMessage>(OnBuyRequest);
SubscribeLocalEvent<StoreComponent, StoreRequestWithdrawMessage>(OnRequestWithdraw);
SubscribeLocalEvent<StoreComponent, StoreRequestRefundMessage>(OnRequestRefund);
SubscribeLocalEvent<StoreComponent, RefundEntityDeletedEvent>(OnRefundEntityDeleted);
}
private void OnRefundEntityDeleted(Entity<StoreComponent> ent, ref RefundEntityDeletedEvent args)
{
ent.Comp.BoughtEntities.Remove(args.Uid);
}
/// <summary>
/// Toggles the store Ui open and closed
/// </summary>
/// <param name="user">the person doing the toggling</param>
/// <param name="storeEnt">the store being toggled</param>
/// <param name="component"></param>
public void ToggleUi(EntityUid user, EntityUid storeEnt, StoreComponent? component = null)
{
if (!Resolve(storeEnt, ref component))
return;
if (!TryComp<ActorComponent>(user, out var actor))
return;
if (!_ui.TryToggleUi(storeEnt, StoreUiKey.Key, actor.PlayerSession))
return;
UpdateUserInterface(user, storeEnt, component);
}
/// <summary>
/// Closes the store UI for everyone, if it's open
/// </summary>
public void CloseUi(EntityUid uid, StoreComponent? component = null)
{
if (!Resolve(uid, ref component))
return;
_ui.CloseUi(uid, StoreUiKey.Key);
}
/// <summary>
/// Updates the user interface for a store and refreshes the listings
/// </summary>
/// <param name="user">The person who if opening the store ui. Listings are filtered based on this.</param>
/// <param name="store">The store entity itself</param>
/// <param name="component">The store component being refreshed.</param>
public void UpdateUserInterface(EntityUid? user, EntityUid store, StoreComponent? component = null)
{
if (!Resolve(store, ref component))
return;
//this is the person who will be passed into logic for all listing filtering.
if (user != null) //if we have no "buyer" for this update, then don't update the listings
{
component.LastAvailableListings = GetAvailableListings(component.AccountOwner ?? user.Value, store, component)
.ToHashSet();
}
//dictionary for all currencies, including 0 values for currencies on the whitelist
Dictionary<ProtoId<CurrencyPrototype>, FixedPoint2> allCurrency = new();
foreach (var supported in component.CurrencyWhitelist)
{
allCurrency.Add(supported, FixedPoint2.Zero);
if (component.Balance.TryGetValue(supported, out var value))
allCurrency[supported] = value;
}
// TODO: if multiple users are supposed to be able to interact with a single BUI & see different
// stores/listings, this needs to use session specific BUI states.
// only tell operatives to lock their uplink if it can be locked
var showFooter = HasComp<RingerUplinkComponent>(store);
var state = new StoreUpdateState(component.LastAvailableListings, allCurrency, showFooter, component.RefundAllowed);
_ui.SetUiState(store, StoreUiKey.Key, state);
}
private void OnRequestUpdate(EntityUid uid, StoreComponent component, StoreRequestUpdateInterfaceMessage args)
{
UpdateUserInterface(args.Actor, GetEntity(args.Entity), component);
}
private void BeforeActivatableUiOpen(EntityUid uid, StoreComponent component, BeforeActivatableUIOpenEvent args)
{
UpdateUserInterface(args.User, uid, component);
}
/// <summary>
/// Handles whenever a purchase was made.
/// </summary>
private void OnBuyRequest(EntityUid uid, StoreComponent component, StoreBuyListingMessage msg)
{
var listing = component.FullListingsCatalog.FirstOrDefault(x => x.ID.Equals(msg.Listing.Id));
if (listing == null) //make sure this listing actually exists
{
Log.Debug("listing does not exist");
return;
}
var buyer = msg.Actor;
//verify that we can actually buy this listing and it wasn't added
if (!ListingHasCategory(listing, component.Categories))
return;
//condition checking because why not
if (listing.Conditions != null)
{
var args = new ListingConditionArgs(component.AccountOwner ?? GetBuyerMind(buyer), uid, listing, EntityManager);
var conditionsMet = listing.Conditions.All(condition => condition.Condition(args));
if (!conditionsMet)
return;
}
//check that we have enough money
var cost = listing.Cost;
foreach (var (currency, amount) in cost)
{
if (!component.Balance.TryGetValue(currency, out var balance) || balance < amount)
{
return;
}
}
if (!IsOnStartingMap(uid, component))
DisableRefund(uid, component);
//subtract the cash
foreach (var (currency, amount) in cost)
{
component.Balance[currency] -= amount;
component.BalanceSpent.TryAdd(currency, FixedPoint2.Zero);
component.BalanceSpent[currency] += amount;
// Sunrise-Start
var ev = new SubtractCashEvent(buyer, currency, amount);
RaiseLocalEvent(buyer, ref ev);
// Sunrise-End
}
//spawn entity
if (listing.ProductEntity != null)
{
var product = Spawn(listing.ProductEntity, Transform(buyer).Coordinates);
// Sunrise-Start
var ev = new ItemPurchasedEvent(buyer);
RaiseLocalEvent(product, ref ev);
// Sunrise-End
_hands.PickupOrDrop(buyer, product);
HandleRefundComp(uid, component, product);
var xForm = Transform(product);
if (xForm.ChildCount > 0)
{
var childEnumerator = xForm.ChildEnumerator;
while (childEnumerator.MoveNext(out var child))
{
component.BoughtEntities.Add(child);
}
}
}
//give action
if (!string.IsNullOrWhiteSpace(listing.ProductAction))
{
EntityUid? actionId;
// I guess we just allow duplicate actions?
// Allow duplicate actions and just have a single list buy for the buy-once ones.
if (!_mind.TryGetMind(buyer, out var mind, out _))
actionId = _actions.AddAction(buyer, listing.ProductAction);
else
actionId = _actionContainer.AddAction(mind, listing.ProductAction);
// Add the newly bought action entity to the list of bought entities
// And then add that action entity to the relevant product upgrade listing, if applicable
if (actionId != null)
{
HandleRefundComp(uid, component, actionId.Value);
if (listing.ProductUpgradeId != null)
{
foreach (var upgradeListing in component.FullListingsCatalog)
{
if (upgradeListing.ID == listing.ProductUpgradeId)
{
upgradeListing.ProductActionEntity = actionId.Value;
break;
}
}
}
}
}
if (listing is { ProductUpgradeId: not null, ProductActionEntity: not null })
{
if (listing.ProductActionEntity != null)
{
component.BoughtEntities.Remove(listing.ProductActionEntity.Value);
}
if (!_actionUpgrade.TryUpgradeAction(listing.ProductActionEntity, out var upgradeActionId))
{
if (listing.ProductActionEntity != null)
HandleRefundComp(uid, component, listing.ProductActionEntity.Value);
return;
}
listing.ProductActionEntity = upgradeActionId;
if (upgradeActionId != null)
HandleRefundComp(uid, component, upgradeActionId.Value);
}
if (listing.ProductEvent != null)
{
if (!listing.RaiseProductEventOnUser)
RaiseLocalEvent(listing.ProductEvent);
else
RaiseLocalEvent(buyer, listing.ProductEvent);
}
if (listing.DisableRefund)
{
component.RefundAllowed = false;
}
//log dat shit.
_admin.Add(LogType.StorePurchase,
LogImpact.Low,
$"{ToPrettyString(buyer):player} purchased listing \"{ListingLocalisationHelpers.GetLocalisedNameOrEntityName(listing, _proto)}\" from {ToPrettyString(uid)}");
listing.PurchaseAmount++; //track how many times something has been purchased
_audio.PlayEntity(component.BuySuccessSound, msg.Actor, uid); //cha-ching!
var buyFinished = new StoreBuyFinishedEvent
{
PurchasedItem = listing,
StoreUid = uid
};
RaiseLocalEvent(ref buyFinished);
UpdateUserInterface(buyer, uid, component);
}
/// <summary>
/// Handles dispensing the currency you requested to be withdrawn.
/// </summary>
/// <remarks>
/// This would need to be done should a currency with decimal values need to use it.
/// not quite sure how to handle that
/// </remarks>
private void OnRequestWithdraw(EntityUid uid, StoreComponent component, StoreRequestWithdrawMessage msg)
{
if (msg.Amount <= 0)
return;
//make sure we have enough cash in the bank and we actually support this currency
if (!component.Balance.TryGetValue(msg.Currency, out var currentAmount) || currentAmount < msg.Amount)
return;
//make sure a malicious client didn't send us random shit
if (!_proto.TryIndex<CurrencyPrototype>(msg.Currency, out var proto))
return;
//we need an actually valid entity to spawn. This check has been done earlier, but just in case.
if (proto.Cash == null || !proto.CanWithdraw)
return;
var buyer = msg.Actor;
FixedPoint2 amountRemaining = msg.Amount;
var coordinates = Transform(buyer).Coordinates;
var sortedCashValues = proto.Cash.Keys.OrderByDescending(x => x).ToList();
foreach (var value in sortedCashValues)
{
var cashId = proto.Cash[value];
var amountToSpawn = (int) MathF.Floor((float) (amountRemaining / value));
var ents = _stack.SpawnMultiple(cashId, amountToSpawn, coordinates);
if (ents.FirstOrDefault() is {} ent)
_hands.PickupOrDrop(buyer, ent);
amountRemaining -= value * amountToSpawn;
}
component.Balance[msg.Currency] -= msg.Amount;
UpdateUserInterface(buyer, uid, component);
}
private void OnRequestRefund(EntityUid uid, StoreComponent component, StoreRequestRefundMessage args)
{
// TODO: Remove guardian/holopara
if (args.Actor is not { Valid: true } buyer)
return;
if (!IsOnStartingMap(uid, component))
{
DisableRefund(uid, component);
UpdateUserInterface(buyer, uid, component);
}
if (!component.RefundAllowed || component.BoughtEntities.Count == 0)
return;
_admin.Add(LogType.StoreRefund, LogImpact.Low, $"{ToPrettyString(buyer):player} has refunded their purchases from {ToPrettyString(uid):store}");
for (var i = component.BoughtEntities.Count - 1; i >= 0; i--)
{
var purchase = component.BoughtEntities[i];
if (!Exists(purchase))
continue;
component.BoughtEntities.RemoveAt(i);
if (_actions.TryGetActionData(purchase, out var actionComponent, logError: false))
{
_actionContainer.RemoveAction(purchase, actionComponent);
}
EntityManager.DeleteEntity(purchase);
}
component.BoughtEntities.Clear();
foreach (var (currency, value) in component.BalanceSpent)
{
component.Balance[currency] += value;
}
// Reset store back to its original state
RefreshAllListings(component);
component.BalanceSpent = new();
UpdateUserInterface(buyer, uid, component);
}
private void HandleRefundComp(EntityUid uid, StoreComponent component, EntityUid purchase)
{
component.BoughtEntities.Add(purchase);
var refundComp = EnsureComp<StoreRefundComponent>(purchase);
refundComp.StoreEntity = uid;
refundComp.BoughtTime = _timing.CurTime;
}
private bool IsOnStartingMap(EntityUid store, StoreComponent component)
{
var xform = Transform(store);
return component.StartingMap == xform.MapUid;
}
/// <summary>
/// Disables refunds for this store
/// </summary>
public void DisableRefund(EntityUid store, StoreComponent? component = null)
{
if (!Resolve(store, ref component))
return;
component.RefundAllowed = false;
}
}
/// <summary>
/// Event of successfully finishing purchase in store (<see cref="StoreSystem"/>.
/// </summary>
/// <param name="StoreUid">EntityUid on which store is placed.</param>
/// <param name="PurchasedItem">ListingItem that was purchased.</param>
[ByRefEvent]
public readonly record struct StoreBuyFinishedEvent(
EntityUid StoreUid,
ListingDataWithCostModifiers PurchasedItem
);