Content update for UI prediction (#27214)
* Content update for UI refactor * Big update * Sharing * Remaining content updates * First big update * Prototype updates * AUGH * Fix UI comp ref * Cleanup - Fix predicted message, fix item slots, fix interaction range check. * Fix regressions * Make this predictive idk why it wasn't. * Fix slime merge * Merge conflict * Fix merge
This commit is contained in:
@@ -54,21 +54,20 @@ public sealed partial class CargoSystem
|
||||
|
||||
private void UpdatePalletConsoleInterface(EntityUid uid)
|
||||
{
|
||||
var bui = _uiSystem.GetUi(uid, CargoPalletConsoleUiKey.Sale);
|
||||
if (Transform(uid).GridUid is not EntityUid gridUid)
|
||||
{
|
||||
_uiSystem.SetUiState(bui,
|
||||
_uiSystem.SetUiState(uid, CargoPalletConsoleUiKey.Sale,
|
||||
new CargoPalletConsoleInterfaceState(0, 0, false));
|
||||
return;
|
||||
}
|
||||
GetPalletGoods(gridUid, out var toSell, out var amount);
|
||||
_uiSystem.SetUiState(bui,
|
||||
_uiSystem.SetUiState(uid, CargoPalletConsoleUiKey.Sale,
|
||||
new CargoPalletConsoleInterfaceState((int) amount, toSell.Count, true));
|
||||
}
|
||||
|
||||
private void OnPalletUIOpen(EntityUid uid, CargoPalletConsoleComponent component, BoundUIOpenedEvent args)
|
||||
{
|
||||
var player = args.Session.AttachedEntity;
|
||||
var player = args.Actor;
|
||||
|
||||
if (player == null)
|
||||
return;
|
||||
@@ -86,7 +85,7 @@ public sealed partial class CargoSystem
|
||||
|
||||
private void OnPalletAppraise(EntityUid uid, CargoPalletConsoleComponent component, CargoPalletAppraiseMessage args)
|
||||
{
|
||||
var player = args.Session.AttachedEntity;
|
||||
var player = args.Actor;
|
||||
|
||||
if (player == null)
|
||||
return;
|
||||
@@ -108,8 +107,8 @@ public sealed partial class CargoSystem
|
||||
var orders = GetProjectedOrders(station ?? EntityUid.Invalid, orderDatabase, shuttle);
|
||||
var shuttleName = orderDatabase?.Shuttle != null ? MetaData(orderDatabase.Shuttle.Value).EntityName : string.Empty;
|
||||
|
||||
if (_uiSystem.TryGetUi(uid, CargoConsoleUiKey.Shuttle, out var bui))
|
||||
_uiSystem.SetUiState(bui, new CargoShuttleConsoleBoundUserInterfaceState(
|
||||
if (_uiSystem.HasUi(uid, CargoConsoleUiKey.Shuttle))
|
||||
_uiSystem.SetUiState(uid, CargoConsoleUiKey.Shuttle, 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
|
||||
@@ -314,17 +313,16 @@ public sealed partial class CargoSystem
|
||||
|
||||
private void OnPalletSale(EntityUid uid, CargoPalletConsoleComponent component, CargoPalletSellMessage args)
|
||||
{
|
||||
var player = args.Session.AttachedEntity;
|
||||
var player = args.Actor;
|
||||
|
||||
if (player == null)
|
||||
return;
|
||||
|
||||
var bui = _uiSystem.GetUi(uid, CargoPalletConsoleUiKey.Sale);
|
||||
var xform = Transform(uid);
|
||||
|
||||
if (xform.GridUid is not EntityUid gridUid)
|
||||
{
|
||||
_uiSystem.SetUiState(bui,
|
||||
_uiSystem.SetUiState(uid, CargoPalletConsoleUiKey.Sale,
|
||||
new CargoPalletConsoleInterfaceState(0, 0, false));
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user