Skip to content

Commit

Permalink
Update to fix talent scan error
Browse files Browse the repository at this point in the history
  • Loading branch information
Vae2009 committed Dec 12, 2022
1 parent 848758e commit 26a1372
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 16 deletions.
2 changes: 1 addition & 1 deletion ConRO.toc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Title:-|cffFFFFFFConRO|r- Conflict Rotation Optimizer
## Notes: Rotation helper framework.
## Version: 10.0.15
## Version: 10.0.16
## Author: Vae
## Interface: 100002
## SavedVariables: ConROPreferences
Expand Down
4 changes: 2 additions & 2 deletions buttons.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2898,7 +2898,7 @@ function ConRO:GlowSpell(spellID)
end
self.SpellsGlowing[spellID] = 1;
else
if UnitAffectingCombat('player') and not _IsSwapSpell then
if UnitAffectingCombat('player') and not _IsSwapSpell and not ConRO:Dragonriding() then
if spellName ~= nil then
self:Print(self.Colors.Error .. 'Spell not found on action bars: ' .. ' ' .. spellName .. ' ' .. '(' .. spellID .. ')');
else
Expand All @@ -2921,7 +2921,7 @@ function ConRO:GlowDef(spellID)
end
self.DefGlowing[spellID] = 1;
else
if UnitAffectingCombat('player') then
if UnitAffectingCombat('player') and not _IsSwapSpell and not ConRO:Dragonriding() then
if spellName ~= nil then
self:Print(self.Colors.Error .. 'Spell not found on action bars: ' .. ' ' .. spellName .. ' ' .. '(' .. spellID .. ')');
else
Expand Down
94 changes: 82 additions & 12 deletions core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2131,14 +2131,17 @@ end
function ConRO:OnEnable()
self:RegisterEvent('PLAYER_TARGET_CHANGED');
self:RegisterEvent('ACTIVE_PLAYER_SPECIALIZATION_CHANGED');
self:RegisterEvent('ACTIVE_COMBAT_CONFIG_CHANGED');
self:RegisterEvent('TRAIT_CONFIG_UPDATED');
self:RegisterEvent('ACTIONBAR_SLOT_CHANGED');
self:RegisterEvent('PLAYER_REGEN_DISABLED');
self:RegisterEvent('PLAYER_REGEN_ENABLED');
self:RegisterEvent('PLAYER_ENTERING_WORLD');
self:RegisterEvent('PLAYER_LEAVING_WORLD');
self:RegisterEvent('UPDATE_SHAPESHIFT_FORM');
self:RegisterEvent('UPDATE_STEALTH');

self:RegisterEvent('LOADING_SCREEN_ENABLED');
self:RegisterEvent('LOADING_SCREEN_DISABLED');
self:RegisterEvent('ACTIONBAR_HIDEGRID');
self:RegisterEvent('ACTIONBAR_PAGE_CHANGED');
self:RegisterEvent('LEARNED_SPELL_IN_TAB');
Expand Down Expand Up @@ -2166,7 +2169,7 @@ function ConRO:ACTIVE_PLAYER_SPECIALIZATION_CHANGED()
self:LoadModule();
self:EnableRotation();
self:EnableDefense();

if ConRO:HealSpec() then
ConROWindow:Hide();
ConRONextWindow:Hide();
Expand All @@ -2180,8 +2183,60 @@ function ConRO:ACTIVE_PLAYER_SPECIALIZATION_CHANGED()
ConRONextWindow:Hide();
ConRONext2Window:Hide();
end

ConRO:ButtonFetch()
end

function ConRO:ACTIVE_COMBAT_CONFIG_CHANGED()
--self:Print(self.Colors.Success .. 'Talent');
self:DisableRotation();
self:DisableDefense();
self:LoadModule();
self:EnableRotation();
self:EnableDefense();

if ConRO:HealSpec() then
ConROWindow:Hide();
ConRONextWindow:Hide();
ConRONext2Window:Hide();
elseif ConRO.db.profile.enableWindow and not ConRO.db.profile.combatWindow then
ConROWindow:Show();
ConRONextWindow:Show();
ConRONext2Window:Show();
else
ConROWindow:Hide();
ConRONextWindow:Hide();
ConRONext2Window:Hide();
end

ConRO:ButtonFetch()
end

function ConRO:PLAYER_SPECIALIZATION_CHANGED()
--self:Print(self.Colors.Success .. 'Talent');
self:DisableRotation();
self:DisableDefense();
self:LoadModule();
self:EnableRotation();
self:EnableDefense();

if ConRO:HealSpec() then
ConROWindow:Hide();
ConRONextWindow:Hide();
ConRONext2Window:Hide();
elseif ConRO.db.profile.enableWindow and not ConRO.db.profile.combatWindow then
ConROWindow:Show();
ConRONextWindow:Show();
ConRONext2Window:Show();
else
ConROWindow:Hide();
ConRONextWindow:Hide();
ConRONext2Window:Hide();
end

ConRO:ButtonFetch()
end

function ConRO:TRAIT_CONFIG_UPDATED()
--self:Print(self.Colors.Success .. 'Talent');
self:DisableRotation();
Expand All @@ -2204,6 +2259,8 @@ function ConRO:TRAIT_CONFIG_UPDATED()
ConRONextWindow:Hide();
ConRONext2Window:Hide();
end

ConRO:ButtonFetch()
end

function ConRO:ACTIONBAR_HIDEGRID()
Expand Down Expand Up @@ -2301,6 +2358,12 @@ function ConRO:PLAYER_CONTROL_GAINED()
end
end

function ConRO:PLAYER_LEAVING_WORLD()
-- self:Print(self.Colors.Success .. 'Lost Control!');
self:DisableRotation();
self:DisableDefense();
end

function ConRO:PLAYER_ENTERING_WORLD()
self:UpdateButtonGlow();
if not self.rotationEnabled and not UnitHasVehicleUI("player") and not ConRO:Dragonriding() then
Expand All @@ -2312,6 +2375,23 @@ function ConRO:PLAYER_ENTERING_WORLD()
end
end

function ConRO:LOADING_SCREEN_ENABLED()
-- self:Print(self.Colors.Success .. 'Lost Control!');
self:DisableRotation();
self:DisableDefense();
end

function ConRO:LOADING_SCREEN_DISABLED()
self:UpdateButtonGlow();
if not self.rotationEnabled and not UnitHasVehicleUI("player") and not ConRO:Dragonriding() then
self:Print(self.Colors.Success .. 'Auto enable on login!');
self:Print(self.Colors.Info .. 'Loading class module');
self:LoadModule();
self:EnableRotation();
self:EnableDefense();
end
end

function ConRO:PLAYER_TARGET_CHANGED()
-- self:Print(self.Colors.Success .. 'Target Changed!');

Expand Down Expand Up @@ -2360,15 +2440,6 @@ end

function ConRO:ACTIONBAR_SLOT_CHANGED()
self:UpdateButtonGlow();
if ConRO:Dragonriding() and self.ModuleLoaded and self.rotationEnabled then
self:DisableRotation();
self:DisableDefense();
elseif not ConRO:Dragonriding() and not self.rotationEnabled then
self:LoadModule();
self:EnableRotation();
self:EnableDefense();
end

ConRO:ButtonFetch()
end

Expand All @@ -2389,7 +2460,6 @@ ConRO.UPDATE_SHAPESHIFT_FORM = ConRO.ButtonFetch;
ConRO.UPDATE_STEALTH = ConRO.ButtonFetch;
ConRO.LEARNED_SPELL_IN_TAB = ConRO.ButtonFetch;
ConRO.CHARACTER_POINTS_CHANGED = ConRO.ButtonFetch;
ConRO.PLAYER_SPECIALIZATION_CHANGED = ConRO.ButtonFetch;
ConRO.ACTIVE_TALENT_GROUP_CHANGED = ConRO.ButtonFetch;
ConRO.UPDATE_MACROS = ConRO.ButtonFetch;
ConRO.VEHICLE_UPDATE = ConRO.ButtonFetch;
Expand Down
5 changes: 4 additions & 1 deletion helper.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ function ConRO:CheckTalents()
wipe(self.PlayerTalents)
if select(1, GetSpecialization()) ~= 5 then
local specID = PlayerUtil.GetCurrentSpecID();
local configID = C_ClassTalents.GetLastSelectedSavedConfigID(specID) or C_ClassTalents.GetActiveConfigID();
local configID = C_ClassTalents.GetLastSelectedSavedConfigID(specID);
if configID == nil then
configID = C_ClassTalents.GetActiveConfigID();
end
local configInfo = C_Traits.GetConfigInfo(configID);
if configInfo == nil then
configID = C_ClassTalents.GetActiveConfigID();
Expand Down

0 comments on commit 26a1372

Please sign in to comment.