Cleaner BoundUserInterfaces (#17736)

This commit is contained in:
TemporalOroboros
2023-07-08 09:02:17 -07:00
committed by GitHub
parent 55b4fb1649
commit 3ac4cf85db
137 changed files with 1069 additions and 972 deletions

View File

@@ -198,7 +198,9 @@ public sealed partial class InstrumentSystem : SharedInstrumentSystem
// Just in case
Clean((instrument).Owner);
instrument.UserInterface?.CloseAll();
if (instrument.UserInterface is not null)
_userInterfaceSystem.CloseAll(instrument.UserInterface);
}
instrument.Timer += frameTime;
@@ -217,7 +219,7 @@ public sealed partial class InstrumentSystem : SharedInstrumentSystem
if (!Resolve(uid, ref component))
return;
var ui = uid.GetUIOrNull(InstrumentUiKey.Key);
ui?.Toggle(session);
if (_userInterfaceSystem.TryGetUi(uid, InstrumentUiKey.Key, out var bui))
_userInterfaceSystem.ToggleUi(bui, session);
}
}