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

(cherry picked from commit 5896e68752)
This commit is contained in:
metalgearsloth
2024-05-03 00:15:32 +02:00
committed by null
parent c585cd9610
commit 1d63b4cfcb
279 changed files with 1305 additions and 1580 deletions
@@ -285,20 +285,17 @@ internal sealed partial class PowerMonitoringConsoleSystem : SharedPowerMonitori
var query = AllEntityQuery<PowerMonitoringConsoleComponent>();
while (query.MoveNext(out var ent, out var console))
{
if (!_userInterfaceSystem.TryGetUi(ent, PowerMonitoringConsoleUiKey.Key, out var bui))
if (!_userInterfaceSystem.IsUiOpen(ent, PowerMonitoringConsoleUiKey.Key))
continue;
foreach (var session in bui.SubscribedSessions)
UpdateUIState(ent, console, session);
UpdateUIState(ent, console);
}
}
}
public void UpdateUIState(EntityUid uid, PowerMonitoringConsoleComponent component, ICommonSession session)
private void UpdateUIState(EntityUid uid, PowerMonitoringConsoleComponent component)
{
if (!_userInterfaceSystem.TryGetUi(uid, PowerMonitoringConsoleUiKey.Key, out var bui))
return;
var consoleXform = Transform(uid);
if (consoleXform?.GridUid == null)
@@ -421,15 +418,15 @@ internal sealed partial class PowerMonitoringConsoleSystem : SharedPowerMonitori
}
// Set the UI state
_userInterfaceSystem.SetUiState(bui,
_userInterfaceSystem.SetUiState(uid,
PowerMonitoringConsoleUiKey.Key,
new PowerMonitoringConsoleBoundInterfaceState
(totalSources,
totalBatteryUsage,
totalLoads,
allEntries.ToArray(),
sourcesForFocus.ToArray(),
loadsForFocus.ToArray()),
session);
loadsForFocus.ToArray()));
}
private double GetPrimaryPowerValues(EntityUid uid, PowerMonitoringDeviceComponent device, out double powerSupplied, out double powerUsage, out double batteryUsage)