Mercurial > wow > reagentmaker
comparison ReagentMaker.lua @ 110:d60d6b4cab0c
Tradeskill in external window should now be functional
| author | contrebasse |
|---|---|
| date | Thu, 02 Jun 2011 18:23:42 +0200 |
| parents | 618163a6d970 |
| children | af23986010ef |
comparison
equal
deleted
inserted
replaced
| 109:b5fd4a61ee64 | 110:d60d6b4cab0c |
|---|---|
| 90 btn.SplitStack = A.SplitStack | 90 btn.SplitStack = A.SplitStack |
| 91 | 91 |
| 92 local textureHighlight = btn:CreateTexture() | 92 local textureHighlight = btn:CreateTexture() |
| 93 textureHighlight:Hide() | 93 textureHighlight:Hide() |
| 94 textureHighlight:SetTexture("Interface\\BUTTONS\\CheckButtonHilight") | 94 textureHighlight:SetTexture("Interface\\BUTTONS\\CheckButtonHilight") |
| 95 --textureHighlight:SetTexture("Interface\\BUTTONS\\ButtonHilight-Square") | |
| 95 textureHighlight:SetBlendMode("ADD") | 96 textureHighlight:SetBlendMode("ADD") |
| 96 textureHighlight:SetAllPoints("TradeSkillReagent"..i.."IconTexture") | 97 textureHighlight:SetAllPoints("TradeSkillReagent"..i.."IconTexture") |
| 97 btn.textureHighlight = textureHighlight | 98 btn.textureHighlight = textureHighlight |
| 98 | 99 |
| 99 local label = btn:CreateFontString(nil,"ARTWORK","GameFontHighlight") | 100 local label = btn:CreateFontString(nil,"ARTWORK","GameFontHighlight") |
| 138 -- Continue only if the reagent is known | 139 -- Continue only if the reagent is known |
| 139 if not reagentID or not A.data[reagentID] then return end | 140 if not reagentID or not A.data[reagentID] then return end |
| 140 | 141 |
| 141 -- If only one recipe is known for the reagent, use it | 142 -- If only one recipe is known for the reagent, use it |
| 142 if #(A.data[reagentID]) == 1 and not A.data[reagentID][1].macro then | 143 if #(A.data[reagentID]) == 1 and not A.data[reagentID][1].macro then |
| 143 if A.data[reagentID][1].spellName and A.data[reagentID][1].spellName ~= GetTradeSkillLine() then | 144 if A.data[reagentID][1].tradeskillName and A.data[reagentID][1].tradeskillName ~= GetTradeSkillLine() then |
| 144 A.Error(A.L["The recipe to make this reagent is in another tradeskill. Currently ReagentMaker can not manage such a case, sorry."]) | 145 A.Error(A.L["The recipe to make this reagent is in another tradeskill. Currently ReagentMaker can not manage such a case, sorry."]) |
| 145 return | 146 return |
| 146 end | 147 end |
| 147 | 148 |
| 148 local reagentIndex = A.findSkillIndex(reagentID) -- finds only the first recipe that creates the reagent, should check recipe name too | 149 local reagentIndex = A.findSkillIndex(reagentID) -- finds only the first recipe that creates the reagent, should check recipe name too |
| 225 -- Fill in the number to make | 226 -- Fill in the number to make |
| 226 numToMake = tostring(numToMake) | 227 numToMake = tostring(numToMake) |
| 227 for i = 1,numToMake:len() do | 228 for i = 1,numToMake:len() do |
| 228 StackSplitFrame_OnChar(StackSplitFrame,numToMake:gsub(i,i)) | 229 StackSplitFrame_OnChar(StackSplitFrame,numToMake:gsub(i,i)) |
| 229 end | 230 end |
| 230 StackSplitFrame.typing = 0 -- reinit the frame so tha the entered value will be erased on text entry | 231 StackSplitFrame.typing = 0 -- reinit the frame so that the entered value will be erased on text entry |
| 231 else | 232 else |
| 232 DoTradeSkill(reagentIndex,numToMake) | 233 DoTradeSkill(reagentIndex,numToMake) |
| 233 end -- if | 234 end -- if |
| 234 end -- function | 235 end -- function |
| 235 | 236 |
