Fix stale trade skill indices in ATSW tooltips
This commit is contained in:
@@ -1401,11 +1401,33 @@ end
|
|||||||
ATSW_TEST = 9000
|
ATSW_TEST = 9000
|
||||||
|
|
||||||
function ATSW_TooltipSetSkill(Tooltip, Index)
|
function ATSW_TooltipSetSkill(Tooltip, Index)
|
||||||
if ATSW_TradeSkill() then
|
if not Tooltip or not Index then
|
||||||
Tooltip:SetTradeSkillItem(Index)
|
return
|
||||||
else
|
end
|
||||||
Tooltip:SetCraftSpell(Index)
|
|
||||||
end
|
Index = tonumber(Index)
|
||||||
|
|
||||||
|
if not Index or Index < 1 then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
if ATSW_TradeSkill() then
|
||||||
|
local NumSkills = GetNumTradeSkills()
|
||||||
|
|
||||||
|
if Index > NumSkills then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local Name, SkillType = GetTradeSkillInfo(Index)
|
||||||
|
|
||||||
|
if not Name or SkillType == 'header' then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
Tooltip:SetTradeSkillItem(Index)
|
||||||
|
else
|
||||||
|
Tooltip:SetCraftSpell(Index)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Main code section
|
-- Main code section
|
||||||
@@ -5797,7 +5819,11 @@ function ATSW_ShowRecipeTooltip()
|
|||||||
|
|
||||||
ATSWRecipeItemTooltip:SetOwner(this, 'ANCHOR_BOTTOMRIGHT')
|
ATSWRecipeItemTooltip:SetOwner(this, 'ANCHOR_BOTTOMRIGHT')
|
||||||
|
|
||||||
ATSW_TooltipSetSkill(ATSWRecipeItemTooltip, this.Position)
|
local LivePosition = GetPositionFromGame(R.Name)
|
||||||
|
|
||||||
|
if LivePosition then
|
||||||
|
ATSW_TooltipSetSkill(ATSWRecipeItemTooltip, LivePosition)
|
||||||
|
end
|
||||||
|
|
||||||
ATSWRecipeItemTooltipTextLeft1:SetText(' ')
|
ATSWRecipeItemTooltipTextLeft1:SetText(' ')
|
||||||
ATSWRecipeItemTooltip:Show()
|
ATSWRecipeItemTooltip:Show()
|
||||||
|
|||||||
Reference in New Issue
Block a user