Files
crystall-punk-14/Content.Shared/_CP14/Trading/Systems/CP14SharedTradingPlatformSystem.UI.cs
Red cde388f5dd Another Merchant gameplay attempt (#1308)
* setup UI

* setup debug data

* graph control setup

* reputation trade component

* unlocking logic

* smoe real reputation costing

* remove sponsors part, add trading specific UI nodes

* port to default pricing system

* buy cooldown

* fuck off trading cabinets

* real good cooldown UI

* Cool unlock sound

* reputation earning

* cool purchare sound

* coin & sprite work

* delete old guidebooks

* cool purcharing VFX

* better ui

* victoria gardens

* Update migration.yml

* Update migration.yml

* cooldown removed

* contracts

* Update migration.yml

* remove CP14Material

* materials appraise

* food appraise

* auto economy pricing system

* alchemy reagents appraise

* coins resprite

* alchemy appraise 2

* modular weapon appraise

* selling platform

* Update PricingSystem.cs

* Update CP14TradingPlatformSystem.cs

* merchants returns + map update

* Update CP14StationEconomySystem.Price.cs
2025-05-29 00:22:47 +03:00

48 lines
1.4 KiB
C#

using Content.Shared._CP14.Trading.Components;
using Content.Shared._CP14.Trading.Prototypes;
using Content.Shared.UserInterface;
namespace Content.Shared._CP14.Trading.Systems;
public abstract partial class CP14SharedTradingPlatformSystem
{
private void InitializeUI()
{
SubscribeLocalEvent<CP14TradingPlatformComponent, CP14TradingPositionUnlockAttempt>(OnUnlockAttempt);
SubscribeLocalEvent<CP14TradingPlatformComponent, BeforeActivatableUIOpenEvent>(OnBeforeUIOpen);
}
private void OnUnlockAttempt(Entity<CP14TradingPlatformComponent> ent, ref CP14TradingPositionUnlockAttempt args)
{
TryUnlockPosition(args.Actor, args.Position);
UpdateUIState(ent, args.Actor);
}
private void OnBeforeUIOpen(Entity<CP14TradingPlatformComponent> ent, ref BeforeActivatableUIOpenEvent args)
{
UpdateUIState(ent, args.User);
}
public string GetTradeDescription(CP14TradingPositionPrototype position)
{
if (position.Desc != null)
return Loc.GetString(position.Desc);
if (position.Service is null)
return string.Empty;
return position.Service.GetDesc(Proto);
}
public string GetTradeName(CP14TradingPositionPrototype position)
{
if (position.Name != null)
return Loc.GetString(position.Name);
if (position.Service is null)
return string.Empty;
return position.Service.GetName(Proto);
}
}