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

@@ -215,13 +215,15 @@ namespace Content.Server.Cargo.Systems
!TryComp<StationBankAccountComponent>(station, out var bankAccount)) return;
if (_uiSystem.TryGetUi(consoleUid, CargoConsoleUiKey.Orders, out var bui))
UserInterfaceSystem.SetUiState(bui, new CargoConsoleInterfaceState(
{
_uiSystem.SetUiState(bui, new CargoConsoleInterfaceState(
MetaData(station.Value).EntityName,
GetOutstandingOrderCount(orderDatabase),
orderDatabase.Capacity,
bankAccount.Balance,
orderDatabase.Orders
));
}
}
private void ConsolePopup(ICommonSession session, string text)

View File

@@ -95,12 +95,12 @@ public sealed partial class CargoSystem
var bui = _uiSystem.GetUi(uid, CargoPalletConsoleUiKey.Sale);
if (Transform(uid).GridUid is not EntityUid gridUid)
{
UserInterfaceSystem.SetUiState(bui,
_uiSystem.SetUiState(bui,
new CargoPalletConsoleInterfaceState(0, 0, false));
return;
}
GetPalletGoods(gridUid, out var toSell, out var amount);
UserInterfaceSystem.SetUiState(bui,
_uiSystem.SetUiState(bui,
new CargoPalletConsoleInterfaceState((int) amount, toSell.Count, true));
}
@@ -147,7 +147,7 @@ public sealed partial class CargoSystem
var shuttleName = orderDatabase?.Shuttle != null ? MetaData(orderDatabase.Shuttle.Value).EntityName : string.Empty;
if (_uiSystem.TryGetUi(uid, CargoConsoleUiKey.Shuttle, out var bui))
UserInterfaceSystem.SetUiState(bui, new CargoShuttleConsoleBoundUserInterfaceState(
_uiSystem.SetUiState(bui, new CargoShuttleConsoleBoundUserInterfaceState(
station != null ? MetaData(station.Value).EntityName : Loc.GetString("cargo-shuttle-console-station-unknown"),
string.IsNullOrEmpty(shuttleName) ? Loc.GetString("cargo-shuttle-console-shuttle-not-found") : shuttleName,
orders
@@ -324,7 +324,7 @@ public sealed partial class CargoSystem
var bui = _uiSystem.GetUi(uid, CargoPalletConsoleUiKey.Sale);
if (Transform(uid).GridUid is not EntityUid gridUid)
{
UserInterfaceSystem.SetUiState(bui,
_uiSystem.SetUiState(bui,
new CargoPalletConsoleInterfaceState(0, 0, false));
return;
}

View File

@@ -51,7 +51,7 @@ public sealed class PricingSystem : EntitySystem
foreach (var gid in args)
{
if (!EntityUid.TryParse(gid, out var gridId) || !gridId.IsValid())
if (!EntityManager.TryParseNetEntity(gid, out var gridId) || !gridId.Value.IsValid())
{
shell.WriteError($"Invalid grid ID \"{gid}\".");
continue;
@@ -90,7 +90,7 @@ public sealed class PricingSystem : EntitySystem
if (!TryComp<BodyComponent>(uid, out var body) || !TryComp<MobStateComponent>(uid, out var state))
{
Logger.ErrorS("pricing", $"Tried to get the mob price of {ToPrettyString(uid)}, which has no {nameof(BodyComponent)} and no {nameof(MobStateComponent)}.");
Log.Error($"Tried to get the mob price of {ToPrettyString(uid)}, which has no {nameof(BodyComponent)} and no {nameof(MobStateComponent)}.");
return;
}