View Single Post
10/05/17, 12:35 PM   #11
Letho
AddOn Author - Click to view addons
Join Date: Apr 2016
Posts: 238
Originally Posted by Dolgubon View Post
Yes the according function should check it, but it is never called after a reloading, until the player enters or edits combat.
I think that's not true, because:

Code:
function testplugin:Initialize()
self.inCombat = IsUnitInCombat("player")
EVENT_MANAGER:RegisterForEvent(self.name, EVENT_PLAYER_COMBAT_STATE, self.OnPlayerCombatState)
inCombat=false
end
After reloadui the addon will be initialized, retrieve the combat state via IsUnitInCombat("player") and set the addon's display accordingly.

Originally Posted by ArtOfShred View Post
(...)
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 (...)
IsUnitInCombat() doesn't need a combat state event to fire as it will always return the native code's combat state information. Just verified it.

Last edited by Letho : 10/05/17 at 12:40 PM.
  Reply With Quote