uplink locking/unlocking, minor pda refactor (#15842)
Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Content.Server.Mind.Components;
|
||||
using Content.Server.PDA.Ringer;
|
||||
using Content.Server.Store.Components;
|
||||
using Content.Server.UserInterface;
|
||||
using Content.Shared.FixedPoint;
|
||||
@@ -72,9 +73,9 @@ public sealed partial class StoreSystem : EntitySystem
|
||||
if (args.Target == null || !TryComp<StoreComponent>(args.Target, out var store))
|
||||
return;
|
||||
|
||||
// require the store to be open before inserting currency
|
||||
// if the store can be locked, it must be unlocked first before inserting currency
|
||||
var user = args.User;
|
||||
if (!TryComp<ActorComponent>(user, out var actor) || !_ui.SessionHasOpenUi(uid, StoreUiKey.Key, actor.PlayerSession))
|
||||
if (TryComp<RingerUplinkComponent>(args.Target, out var uplink) && !uplink.Unlocked)
|
||||
return;
|
||||
|
||||
args.Handled = TryAddCurrency(GetCurrencyValue(uid, component), args.Target.Value, store);
|
||||
@@ -183,6 +184,8 @@ public sealed partial class StoreSystem : EntitySystem
|
||||
|
||||
var ui = _ui.GetUiOrNull(uid, StoreUiKey.Key);
|
||||
if (ui != null)
|
||||
{
|
||||
_ui.SetUiState(ui, new StoreInitializeState(preset.StoreName));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user