Clean up store system (#28463)

This commit is contained in:
Nemanja
2024-06-01 11:29:17 -04:00
committed by GitHub
parent 19be94c9ea
commit be6f55a090
26 changed files with 127 additions and 209 deletions

View File

@@ -10,6 +10,7 @@ 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;
@@ -82,16 +83,11 @@ public sealed partial class StoreSystem
/// <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>
/// <param name="ui"></param>
public void UpdateUserInterface(EntityUid? user, EntityUid store, StoreComponent? component = null)
{
if (!Resolve(store, ref component))
return;
// TODO: Why is the state not being set unless this?
if (!_ui.HasUi(store, StoreUiKey.Key))
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
{
@@ -259,7 +255,8 @@ public sealed partial class StoreSystem
}
//log dat shit.
_admin.Add(LogType.StorePurchase, LogImpact.Low,
_admin.Add(LogType.StorePurchase,
LogImpact.Low,
$"{ToPrettyString(buyer):player} purchased listing \"{ListingLocalisationHelpers.GetLocalisedNameOrEntityName(listing, _prototypeManager)}\" from {ToPrettyString(uid)}");
listing.PurchaseAmount++; //track how many times something has been purchased