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