From b6556dc98d453f75b0f977f971b3bd1716b534ba Mon Sep 17 00:00:00 2001 From: parnic Date: Thu, 9 Dec 2010 07:31:40 +0000 Subject: [PATCH] =?UTF-8?q?-=20enabled=20new=20target-item/spell=20attribu?= =?UTF-8?q?tes=20for=20secure=20buttons=20as=20they're=20The=20Right=20Sol?= =?UTF-8?q?ution=E2=84=A2=20instead=20of=20hacking=20together=20a=20macro?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Breakables.lua | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Breakables.lua b/Breakables.lua index 820911f..d4e16bc 100644 --- a/Breakables.lua +++ b/Breakables.lua @@ -552,11 +552,7 @@ function Breakables:FindBreakables(bag) btn:EnableMouse(true) btn:RegisterForClicks("AnyUp") - btn:SetAttribute("type", "macro") --- btn:SetAttribute("target-bag", foundBreakables[i][IDX_BAG]) --- btn:SetAttribute("target-slot", foundBreakables[i][IDX_SLOT]) --- btn:SetAttribute("target-item", foundBreakables[i][IDX_NAME]) --- btn:SetAttribute("type", "spell") + btn:SetAttribute("type", "spell") if not btn.text then btn.text = btn:CreateFontString() @@ -575,8 +571,8 @@ function Breakables:FindBreakables(bag) end local BreakableAbilityName = GetSpellInfo((foundBreakables[i][IDX_BREAKABLETYPE] == BREAKABLE_HERB and MillingId) or (foundBreakables[i][IDX_BREAKABLETYPE] == BREAKABLE_ORE and ProspectingId) or DisenchantId) - btn:SetAttribute("macrotext", "/cast "..BreakableAbilityName.."\n/use "..foundBreakables[i][IDX_BAG].." "..foundBreakables[i][IDX_SLOT].."\n/script Breakables.justClicked=true") --- btn:SetAttribute("spell", BreakableAbilityName) + btn:SetAttribute("spell", BreakableAbilityName) + btn:SetAttribute("target-item", foundBreakables[i][IDX_NAME]) btn.icon:SetTexture(foundBreakables[i][IDX_TEXTURE]) btn:SetScript("OnEnter", function(this) self:OnEnterBreakableButton(this, foundBreakables[i]) end)