mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-10-01 08:37:26 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user