- fix: borer ui
This commit is contained in:
@@ -44,6 +44,8 @@ public sealed class ReagentUIController : UIController, IOnSystemChanged<Actions
|
||||
CommandBinds.Builder
|
||||
.Bind(ContentKeyFunctions.OpenActionsMenu, InputCmdHandler.FromDelegate(_ => OpenWindow()))
|
||||
.Register<ReagentWindow>();
|
||||
|
||||
_reagentsLoaded = false;
|
||||
}
|
||||
|
||||
private void UnloadGui()
|
||||
@@ -55,6 +57,7 @@ public sealed class ReagentUIController : UIController, IOnSystemChanged<Actions
|
||||
}
|
||||
|
||||
CommandBinds.Unregister<ReagentWindow>();
|
||||
_reagentsLoaded = false;
|
||||
}
|
||||
|
||||
private void OnInjectReagent(string protoId, int cost)
|
||||
@@ -68,6 +71,9 @@ public sealed class ReagentUIController : UIController, IOnSystemChanged<Actions
|
||||
if (_window == null || _window.IsOpen || !ent.HasValue)
|
||||
return;
|
||||
|
||||
var entManager = IoCManager.Resolve<EntityManager>();
|
||||
if (entManager.HasComponent<InfestedBorerComponent>(ent))
|
||||
{
|
||||
if (!_reagentsLoaded)
|
||||
{
|
||||
foreach (var reagent in _borerSystem.GetReagents(ent.Value))
|
||||
@@ -87,6 +93,7 @@ public sealed class ReagentUIController : UIController, IOnSystemChanged<Actions
|
||||
|
||||
_window.Open();
|
||||
}
|
||||
}
|
||||
|
||||
public void OnSystemLoaded(ActionsSystem system)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user