diff --git a/ConRO.toc b/ConRO.toc index c4308bb..d765bbf 100644 --- a/ConRO.toc +++ b/ConRO.toc @@ -1,6 +1,6 @@ ## Title:-|cffFFFFFFConRO|r- Conflict Rotation Optimizer ## Notes: Rotation helper framework. -## Version: 10.0.20 +## Version: 10.0.21 ## Author: Vae ## Interface: 100002 ## SavedVariables: ConROPreferences diff --git a/core.lua b/core.lua index 7124019..38e1b12 100644 --- a/core.lua +++ b/core.lua @@ -2124,6 +2124,7 @@ function ConRO:OnEnable() self:RegisterEvent('LOADING_SCREEN_ENABLED'); self:RegisterEvent('LOADING_SCREEN_DISABLED'); self:RegisterEvent('ACTIONBAR_HIDEGRID'); + self:RegisterEvent('PLAYER_MOUNT_DISPLAY_CHANGED'); self:RegisterEvent('ACTIONBAR_PAGE_CHANGED'); self:RegisterEvent('LEARNED_SPELL_IN_TAB'); self:RegisterEvent('CHARACTER_POINTS_CHANGED'); @@ -2145,28 +2146,31 @@ end function ConRO:ACTIVE_PLAYER_SPECIALIZATION_CHANGED() --self:Print(self.Colors.Success .. 'Talent'); - self:DisableRotation(); - self:DisableDefense(); - self:LoadModule(); - self:EnableRotation(); - self:EnableDefense(); + C_Timer.After(1, function() + self:DisableRotation(); + self:DisableDefense(); + self:LoadModule(); + self:EnableRotation(); + self:EnableDefense(); - if ConRO:HealSpec() then - ConROWindow:Hide(); - ConRONextWindow:Hide(); - elseif ConRO.db.profile.enableWindow and not ConRO.db.profile.combatWindow then - ConROWindow:Show(); - ConRONextWindow:Show(); - else - ConROWindow:Hide(); - ConRONextWindow:Hide(); - end + if ConRO:HealSpec() then + ConROWindow:Hide(); + ConRONextWindow:Hide(); + elseif ConRO.db.profile.enableWindow and not ConRO.db.profile.combatWindow then + ConROWindow:Show(); + ConRONextWindow:Show(); + else + ConROWindow:Hide(); + ConRONextWindow:Hide(); + end - ConRO:ButtonFetch() + ConRO:ButtonFetch() + end); end function ConRO:ACTIVE_COMBAT_CONFIG_CHANGED() --self:Print(self.Colors.Success .. 'Talent'); + C_Timer.After(1, function() self:DisableRotation(); self:DisableDefense(); self:LoadModule(); @@ -2185,10 +2189,12 @@ function ConRO:ACTIVE_COMBAT_CONFIG_CHANGED() end ConRO:ButtonFetch() - end + end); +end function ConRO:PLAYER_SPECIALIZATION_CHANGED() --self:Print(self.Colors.Success .. 'Talent'); + C_Timer.After(1, function() self:DisableRotation(); self:DisableDefense(); self:LoadModule(); @@ -2207,29 +2213,32 @@ function ConRO:PLAYER_SPECIALIZATION_CHANGED() end ConRO:ButtonFetch() - end + end); +end function ConRO:TRAIT_CONFIG_UPDATED() --self:Print(self.Colors.Success .. 'Talent'); - self:DisableRotation(); - self:DisableDefense(); - self:LoadModule(); - self:EnableRotation(); - self:EnableDefense(); - self:UpdateButtonGlow(); + C_Timer.After(1, function() + self:DisableRotation(); + self:DisableDefense(); + self:LoadModule(); + self:EnableRotation(); + self:EnableDefense(); + self:UpdateButtonGlow(); - if ConRO:HealSpec() then - ConROWindow:Hide(); - ConRONextWindow:Hide(); - elseif ConRO.db.profile.enableWindow and not ConRO.db.profile.combatWindow then - ConROWindow:Show(); - ConRONextWindow:Show(); - else - ConROWindow:Hide(); - ConRONextWindow:Hide(); - end + if ConRO:HealSpec() then + ConROWindow:Hide(); + ConRONextWindow:Hide(); + elseif ConRO.db.profile.enableWindow and not ConRO.db.profile.combatWindow then + ConROWindow:Show(); + ConRONextWindow:Show(); + else + ConROWindow:Hide(); + ConRONextWindow:Hide(); + end - ConRO:ButtonFetch() + ConRO:ButtonFetch() + end); end function ConRO:ACTIONBAR_HIDEGRID() @@ -2250,6 +2259,22 @@ function ConRO:ACTIONBAR_HIDEGRID() self:DestroyTauntOverlays(); end +function ConRO:PLAYER_MOUNT_DISPLAY_CHANGED() + C_Timer.After(1, function() + if ConRO:Dragonriding() and self.ModuleLoaded then + self:DisableRotation(); + self:DisableDefense(); + end + + if not ConRO:Dragonriding() then + self:DisableRotation(); + self:DisableDefense(); + self:EnableRotation(); + self:EnableDefense(); + end + end); +end + function ConRO:UNIT_ENTERED_VEHICLE(event, unit) -- self:Print(self.Colors.Success .. 'Vehicle!'); if unit == 'player' and self.ModuleLoaded then @@ -2335,7 +2360,7 @@ function ConRO:PLAYER_ENTERING_WORLD() self:Print(self.Colors.Success .. 'Auto enable on login!'); self:Print(self.Colors.Info .. 'Loading class module'); self:LoadModule(); - self:EnableRotation(); + self:EnableRotation() self:EnableDefense(); end end diff --git a/helper.lua b/helper.lua index d259ac2..8604c09 100644 --- a/helper.lua +++ b/helper.lua @@ -13,6 +13,7 @@ function ConRO:SpecName() end function ConRO:CheckTalents() + --print("Bing") self.PlayerTalents = {}; wipe(self.PlayerTalents)