mirror of
https://github.com/Bluewhale1337/HealBotBlue.git
synced 2026-09-11 09:50:21 +00:00
refactor: remove deprecated shapeshift form update logic and refine form detection criteria
This commit is contained in:
@@ -298,9 +298,6 @@ local HealBot_EventHandlers = {
|
|||||||
["PLAYER_ENTERING_WORLD"] = function(this)
|
["PLAYER_ENTERING_WORLD"] = function(this)
|
||||||
HealBot_Model:RefreshUnit("player")
|
HealBot_Model:RefreshUnit("player")
|
||||||
HealBot_Model:RefreshUnit("pet")
|
HealBot_Model:RefreshUnit("pet")
|
||||||
if HealBot_UnitClass("player") == "DRUID" then
|
|
||||||
HealBot_UpdateShapeshiftForm()
|
|
||||||
end
|
|
||||||
HealBot_OnEvent_PlayerEnteringWorld(this)
|
HealBot_OnEvent_PlayerEnteringWorld(this)
|
||||||
end,
|
end,
|
||||||
["VARIABLES_LOADED"] = function(this)
|
["VARIABLES_LOADED"] = function(this)
|
||||||
@@ -329,9 +326,7 @@ local HealBot_EventHandlers = {
|
|||||||
HealBot_OnEvent_PlayerEquipmentChanged2(this, arg1)
|
HealBot_OnEvent_PlayerEquipmentChanged2(this, arg1)
|
||||||
end,
|
end,
|
||||||
["UNIT_PET"] = function(this, arg1) HealBot_OnEvent_PartyMembersChanged(this) end,
|
["UNIT_PET"] = function(this, arg1) HealBot_OnEvent_PartyMembersChanged(this) end,
|
||||||
["SPELLS_CHANGED"] = function(this, arg1) HealBot_OnEvent_SpellsChanged(this, arg1) end,
|
["SPELLS_CHANGED"] = function(this, arg1) HealBot_OnEvent_SpellsChanged(this, arg1) end
|
||||||
["UPDATE_SHAPESHIFT_FORM"] = function(this) HealBot_UpdateShapeshiftForm() end,
|
|
||||||
["UPDATE_SHAPESHIFT_FORMS"] = function(this) HealBot_UpdateShapeshiftForm() end
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-- HealBot_OnEvent: Event dispatcher for WoW UI events.
|
-- HealBot_OnEvent: Event dispatcher for WoW UI events.
|
||||||
@@ -420,11 +415,6 @@ function HealBot_OnEvent_VariablesLoaded(this)
|
|||||||
this:RegisterEvent("CHAT_MSG_ADDON");
|
this:RegisterEvent("CHAT_MSG_ADDON");
|
||||||
this:RegisterEvent("CHAT_MSG_SYSTEM");
|
this:RegisterEvent("CHAT_MSG_SYSTEM");
|
||||||
this:RegisterEvent("PLAYER_ENTERING_WORLD");
|
this:RegisterEvent("PLAYER_ENTERING_WORLD");
|
||||||
if class == "DRUID" then
|
|
||||||
this:RegisterEvent("UPDATE_SHAPESHIFT_FORM");
|
|
||||||
this:RegisterEvent("UPDATE_SHAPESHIFT_FORMS");
|
|
||||||
HealBot_UpdateShapeshiftForm();
|
|
||||||
end
|
|
||||||
HealBot_SpellsInitFlag = 2;
|
HealBot_SpellsInitFlag = 2;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -857,10 +857,7 @@ function HealBot_Generic_Patten(matchStr, matchPattern)
|
|||||||
return tmpTest, _HealsMin, _HealsMax;
|
return tmpTest, _HealsMin, _HealsMax;
|
||||||
end
|
end
|
||||||
|
|
||||||
-- HealBot_UpdateShapeshiftForm: Called on UPDATE_SHAPESHIFT_FORM
|
|
||||||
function HealBot_UpdateShapeshiftForm()
|
|
||||||
-- Deprecated
|
|
||||||
end
|
|
||||||
|
|
||||||
-- HealBot_GetShapeshiftForm: Detects active druid form to prevent invalid casts.
|
-- HealBot_GetShapeshiftForm: Detects active druid form to prevent invalid casts.
|
||||||
function HealBot_GetShapeshiftForm()
|
function HealBot_GetShapeshiftForm()
|
||||||
@@ -870,11 +867,14 @@ function HealBot_GetShapeshiftForm()
|
|||||||
for i=1,forms do
|
for i=1,forms do
|
||||||
local icon,name,active = GetShapeshiftFormInfo(i);
|
local icon,name,active = GetShapeshiftFormInfo(i);
|
||||||
if active then
|
if active then
|
||||||
-- Do not unshift from Tree of Life form
|
if icon then
|
||||||
if icon and (string.find(string.lower(icon), "treeoflife") or string.find(string.lower(icon), "healingway")) then
|
local icon_lower = string.lower(icon)
|
||||||
return nil;
|
if not string.find(icon_lower, "humanoidform") and not string.find(icon_lower, "treeoflife") and not string.find(icon_lower, "healingway") and not string.find(icon_lower, "stoneclawtotem") then
|
||||||
|
return i;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
return i;
|
||||||
end
|
end
|
||||||
return i;
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user