2025-05-29 00:22:47 +03:00
|
|
|
using Content.Server.Cargo.Systems;
|
2024-10-15 15:22:06 +03:00
|
|
|
using Content.Server.Popups;
|
|
|
|
|
using Content.Server.Stack;
|
|
|
|
|
using Content.Shared._CP14.Currency;
|
|
|
|
|
using Content.Shared.Examine;
|
|
|
|
|
using Content.Shared.Whitelist;
|
|
|
|
|
using Robust.Server.Audio;
|
|
|
|
|
using Robust.Shared.Prototypes;
|
2024-11-13 17:56:07 +03:00
|
|
|
|
2024-10-15 15:22:06 +03:00
|
|
|
namespace Content.Server._CP14.Currency;
|
|
|
|
|
|
|
|
|
|
public sealed partial class CP14CurrencySystem : CP14SharedCurrencySystem
|
|
|
|
|
{
|
|
|
|
|
[Dependency] private readonly PopupSystem _popup = default!;
|
|
|
|
|
[Dependency] private readonly EntityWhitelistSystem _whitelist = default!;
|
|
|
|
|
[Dependency] private readonly StackSystem _stack = default!;
|
|
|
|
|
[Dependency] private readonly AudioSystem _audio = default!;
|
|
|
|
|
[Dependency] private readonly IPrototypeManager _proto = default!;
|
2025-05-29 00:22:47 +03:00
|
|
|
[Dependency] private readonly PricingSystem _price = default!;
|
2024-11-13 17:56:07 +03:00
|
|
|
|
2024-10-15 15:22:06 +03:00
|
|
|
public override void Initialize()
|
|
|
|
|
{
|
|
|
|
|
base.Initialize();
|
|
|
|
|
|
2024-10-27 17:09:06 +03:00
|
|
|
InitializeConverter();
|
2024-10-15 15:22:06 +03:00
|
|
|
|
2024-10-27 17:09:06 +03:00
|
|
|
SubscribeLocalEvent<CP14CurrencyExaminableComponent, ExaminedEvent>(OnExamine);
|
2025-03-06 12:01:43 +03:00
|
|
|
}
|
2024-10-15 15:22:06 +03:00
|
|
|
|
2024-10-27 17:09:06 +03:00
|
|
|
private void OnExamine(Entity<CP14CurrencyExaminableComponent> currency, ref ExaminedEvent args)
|
2024-10-15 15:22:06 +03:00
|
|
|
{
|
2025-05-29 00:22:47 +03:00
|
|
|
var price = _price.GetPrice(currency);
|
2024-10-27 17:09:06 +03:00
|
|
|
var push = Loc.GetString("cp14-currency-examine-title");
|
2025-05-29 00:22:47 +03:00
|
|
|
push += GetCurrencyPrettyString((int)price);
|
2024-10-27 17:09:06 +03:00
|
|
|
args.PushMarkup(push);
|
2024-10-15 15:22:06 +03:00
|
|
|
}
|
|
|
|
|
}
|