MV Help | SRD HUDmaker / What Battle command is Hovered/Selected.

I need check when the attack comand is hovered/Selected, for that i use this eval:
SceneManager._scene._actorCommandWindow.currentData().symbol=='attack';
When i set this, work fine, but then gave me this error( See below ). How can i do this?

1618695976404.png
I need check when the attack comand is hovered/Selected, for that i use this eval:
SceneManager._scene._actorCommandWindow.currentData().symbol=='attack';
When i set this, work fine, but then gave me this error( See below ). How can i do this?

View attachment 186463
can you provide what the console says by pressing F12
This may be caused by SceneManager._scene._actorCommandWindow.currentData() returning undefined when the battle starts and then its looking for undefined.symbol causing a type error.
For a quick fix you could do is wrap you're code in the if statement bellow
Code:
if(SceneManager._scene._actorCommandWindow.currentData() != undefined){
}
Was perfect, this is the final eval:

BattleManager.actor() && SceneManager._scene._enemyWindow.active != true && SceneManager._scene._actorCommandWindow.currentData() != undefined && SceneManager._scene._actorCommandWindow.currentData().symbol==='attack';

That show the HUD piece when the command Attack is hovered/Active only when actors is in setting commands phase.

Original thread: https://forums.rpgmakerweb.com/threads/help-srd-hudmaker-what-battle-command-is-hovered-selected.135579/