decouple ItemToggle from PowerCellDraw (#31392)

* remove ItemToggle from PowerCellDraw query

* add EntityQuery for resolves, make them all optional

* move integration to ToggleCellDraw

* add ToggleCellDraw to almost every PowerCellDraw prototype

* :trollface:

* :trollface:

* :trollface:

* let it disable on mapinit

* set update time on mapinit, make borg power logic consistent now

* :trollface:

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
deltanedas
2024-08-25 12:17:03 +00:00
committed by GitHub
parent 42865ae705
commit e1df251cbc
15 changed files with 99 additions and 28 deletions

View File

@@ -282,6 +282,7 @@ public sealed partial class BorgSystem : SharedBorgSystem
{
Popup.PopupEntity(Loc.GetString("borg-mind-added", ("name", Identity.Name(uid, EntityManager))), uid);
Toggle.TryActivate(uid);
_powerCell.SetDrawEnabled(uid, _mobState.IsAlive(uid));
_appearance.SetData(uid, BorgVisuals.HasPlayer, true);
}
@@ -292,6 +293,7 @@ public sealed partial class BorgSystem : SharedBorgSystem
{
Popup.PopupEntity(Loc.GetString("borg-mind-removed", ("name", Identity.Name(uid, EntityManager))), uid);
Toggle.TryDeactivate(uid);
_powerCell.SetDrawEnabled(uid, false);
_appearance.SetData(uid, BorgVisuals.HasPlayer, false);
}