# HG changeset patch # User contrebasse # Date 1305845622 -7200 # Node ID e3147b41ea9deaa7e46178c31eeda171e6e32c13 # Parent 910cf3da8edb0f7cf37bab30b8fd7a10cb9daf73 Correct display, tooltips and error message when there are actual tradeskill spells in the SecureMenu. Still not sure that it works with enough reagents... diff -r 910cf3da8edb -r e3147b41ea9d SecureMenu.lua --- a/SecureMenu.lua Thu May 19 20:26:21 2011 +0200 +++ b/SecureMenu.lua Fri May 20 00:53:42 2011 +0200 @@ -118,7 +118,7 @@ GameTooltip:SetOwner(btn,"ANCHOR_LEFT") GameTooltip:SetHyperlink(btn.reagentLink) GameTooltip:Show() - if btn.spellLink then + if btn.spellLink and btn.spellLink~=btn.reagentLink then A.tooltipRecipe:SetOwner(GameTooltip) A.tooltipRecipe:SetHyperlink(btn.spellLink) A.tooltipRecipe:Show() @@ -191,7 +191,11 @@ end local function WarnNotMakable(btn) - A.Error(A.L["You do not have enough [%s] to craft [%s]"]:format(btn.itemNameString,TitleText:GetText())) + if not btn.reagentID then + A.Error(A.L["You do not have enough reagents to craft [%s]"]:format(TitleText:GetText())) + else + A.Error(A.L["You do not have enough [%s] to craft [%s]"]:format(btn.itemNameString,TitleText:GetText())) + end end -- Update counts and button actions @@ -255,11 +259,23 @@ end -- Set text and icon - local name, link, _, _, _, _, _, _, _, texture = GetItemInfo(reagent[1]) - if not (name and link and texture) then - -- Will be retried on next OnUpdate - return + local name, link, texture, _ + if reagent[1] then + name, link, _, _, _, _, _, _, _, texture = GetItemInfo(reagent[1]) + if not (name and link and texture) then + -- Will be retried on next OnUpdate + return + end + elseif reagent.spellLink then + --name, rank, icon, powerCost, isFunnel, powerType, castingTime, minRange, maxRange = GetSpellInfo(id) + name, _, texture = GetSpellInfo(A.link2ID(reagent.spellLink)) + if not (name and texture) then + -- Will be retried on next OnUpdate + return + end + link = reagent.spellLink end + btn.itemName:SetText(name) btn.icon:SetTexture(texture)