View Single Post
10/05/17, 05:05 AM   #10
ArtOfShred
 
ArtOfShred's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2016
Posts: 103
I'd set up your UI element for the indicator (testpluginIndicator) to be hidden by default on EVENT_ADD_ON_LOADED and then only ever change the display of it with your event handler for EVENT_PLAYER_COMBAT_STATE.

Only toggle the display of the element in your handler in EVENT_PLAYER_COMBAT_STATE.

There's one additional issue you might run into - if you reload UI during combat, the combat state event does not fire upon reloading UI, so you need to check for combat state anytime the player is activated. You can cover this by registering an additional event handler to EVENT_PLAYER_ACTIVATED and calling your function there. That should check combat state upon activation of the player after the loading screen.

Last edited by ArtOfShred : 10/05/17 at 05:10 AM.
  Reply With Quote