View Single Post
10/05/17, 12:48 PM   #12
Dolgubon
 
Dolgubon's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2016
Posts: 409
Originally Posted by Letho View Post
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.
The thing is though, the addon's display is never set accordingly. IsUnitInCombat is a base game function. It's not going to change the visibility of any UI elements from an addon. Do you see a call of testpluginIndicator:SetHidden in that initialized code? Without that the visibility won't be changed properly.
  Reply With Quote