fix: refine weapon enchant tooltip detection to use the first word of the spell name

This commit is contained in:
Bluewhale1337
2026-08-05 22:25:02 +02:00
parent 2f01ca3f1b
commit 327cd7a08c
+4 -1
View File
@@ -35,6 +35,9 @@ function HealBot_CheckShamanWeaponBuff(spellName)
local hasMainHandEnchant, _, _, hasOffHandEnchant = GetWeaponEnchantInfo() local hasMainHandEnchant, _, _, hasOffHandEnchant = GetWeaponEnchantInfo()
if not (hasMainHandEnchant or hasOffHandEnchant) then return false end if not (hasMainHandEnchant or hasOffHandEnchant) then return false end
local firstWord = string.match(spellName, "^(%w+)")
if not firstWord then return false end
HealBot_ScanTooltip:SetOwner(UIParent, "ANCHOR_NONE") HealBot_ScanTooltip:SetOwner(UIParent, "ANCHOR_NONE")
local slots = {} local slots = {}
if hasMainHandEnchant then table.insert(slots, 16) end if hasMainHandEnchant then table.insert(slots, 16) end
@@ -47,7 +50,7 @@ function HealBot_CheckShamanWeaponBuff(spellName)
local textObj = getglobal("HealBot_ScanTooltipTextLeft" .. i) local textObj = getglobal("HealBot_ScanTooltipTextLeft" .. i)
if textObj then if textObj then
local text = textObj:GetText() local text = textObj:GetText()
if text and string.find(text, spellName) then if text and string.find(text, firstWord) then
HealBot_ScanTooltip:Hide() HealBot_ScanTooltip:Hide()
return true return true
end end