Files
crystall-punk-14/Content.Shared/_CP14/Trading/Systems/CP14SharedTradingPlatformSystem.UI.cs
Red a3ae67a762 Trade reputation rework + Merchants back + Mining contract (#1347)
* refactor unlocking

* fix contract debug crashing

* Update dev_map.yml

* bugfixes and content rebalance

* ore buy contract
2025-06-01 15:10:36 +03:00

41 lines
1.1 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, BeforeActivatableUIOpenEvent>(OnBeforeUIOpen);
}
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);
}
}