Content update for NetEntities (#18935)

This commit is contained in:
metalgearsloth
2023-09-11 09:42:41 +10:00
committed by GitHub
parent 389c8d1a2c
commit 5a0fc68be2
526 changed files with 3058 additions and 2215 deletions

View File

@@ -26,8 +26,10 @@ public sealed partial class StoreSystem
return;
}
if (!EntityUid.TryParse(args[0], out var uid) || !float.TryParse(args[2], out var id))
if (!NetEntity.TryParse(args[0], out var uidNet) || !TryGetEntity(uidNet, out var uid) || !float.TryParse(args[2], out var id))
{
return;
}
if (!TryComp<StoreComponent>(uid, out var store))
return;
@@ -37,7 +39,7 @@ public sealed partial class StoreSystem
{ args[1], id }
};
TryAddCurrency(currency, uid, store);
TryAddCurrency(currency, uid.Value, store);
}
private CompletionResult AddCurrencyCommandCompletions(IConsoleShell shell, string[] args)
@@ -53,7 +55,7 @@ public sealed partial class StoreSystem
return CompletionResult.FromHintOptions(allStores, "<uid>");
}
if (args.Length == 2 && EntityUid.TryParse(args[0], out var uid))
if (args.Length == 2 && NetEntity.TryParse(args[0], out var uidNet) && TryGetEntity(uidNet, out var uid))
{
if (TryComp<StoreComponent>(uid, out var store))
return CompletionResult.FromHintOptions(store.CurrencyWhitelist, "<currency prototype>");

View File

@@ -97,12 +97,12 @@ public sealed partial class StoreSystem
// only tell operatives to lock their uplink if it can be locked
var showFooter = HasComp<RingerUplinkComponent>(store);
var state = new StoreUpdateState(component.LastAvailableListings, allCurrency, showFooter);
UserInterfaceSystem.SetUiState(ui, state);
_ui.SetUiState(ui, state);
}
private void OnRequestUpdate(EntityUid uid, StoreComponent component, StoreRequestUpdateInterfaceMessage args)
{
UpdateUserInterface(args.Session.AttachedEntity, args.Entity, component);
UpdateUserInterface(args.Session.AttachedEntity, GetEntity(args.Entity), component);
}
private void BeforeActivatableUiOpen(EntityUid uid, StoreComponent component, BeforeActivatableUIOpenEvent args)

View File

@@ -183,7 +183,7 @@ public sealed partial class StoreSystem : EntitySystem
var ui = _ui.GetUiOrNull(uid, StoreUiKey.Key);
if (ui != null)
{
UserInterfaceSystem.SetUiState(ui, new StoreInitializeState(preset.StoreName));
_ui.SetUiState(ui, new StoreInitializeState(preset.StoreName));
}
}
}