Mercurial > wow > reagentmaker
comparison SecureMenu.lua @ 76:9d487333bf10
Block cross-tradeskill in external window
| author | contrebasse | 
|---|---|
| date | Sat, 14 May 2011 21:30:56 +0200 | 
| parents | 3d344a2d8fdf | 
| children | 996aaa818d04 | 
   comparison
  equal
  deleted
  inserted
  replaced
| 75:3d344a2d8fdf | 76:9d487333bf10 | 
|---|---|
| 328 MenuFrame.spellLink = A.isRecipeUnique(A.data[itemID]) and A.data[itemID][1].spellLink | 328 MenuFrame.spellLink = A.isRecipeUnique(A.data[itemID]) and A.data[itemID][1].spellLink | 
| 329 MenuFrame.itemID = itemID | 329 MenuFrame.itemID = itemID | 
| 330 MenuFrame.superItemID = superItemID -- optional, will be nil if not set | 330 MenuFrame.superItemID = superItemID -- optional, will be nil if not set | 
| 331 | 331 | 
| 332 -- Loop over the available recipes | 332 -- Loop over the available recipes | 
| 333 MenuFrame.state = true | 333 local noSkipped = true -- check if we have to reload the external frame to get all the data | 
| 334 local existsValidEntries -- check if the menu contains at least one item (cross-tradeskill problem) | |
| 334 for _,reagent in ipairs(A.data[itemID]) do | 335 for _,reagent in ipairs(A.data[itemID]) do | 
| 335 if reagent.macro then | 336 if reagent.macro then | 
| 336 -- Special spell | 337 -- Special spell | 
| 337 MenuFrame.state = menuAddItem(reagent.macro,itemID,reagent) and MenuFrame.state | 338 existsValidEntries = true | 
| 339 noSkipped = menuAddItem(reagent.macro,itemID,reagent) and noSkipped | |
| 338 else | 340 else | 
| 339 -- Standard tradeskill spell UNTESTED | 341 -- Standard tradeskill spell | 
| 340 MenuFrame.state = menuAddItem(A.craft,itemID,reagent) and MenuFrame.state | 342 if reagent.spellID == A.currentTradeSkill then | 
| 343 existsValidEntries = true | |
| 344 noSkipped = menuAddItem(A.craft,itemID,reagent) and noSkipped | |
| 345 end | |
| 341 end -- if | 346 end -- if | 
| 342 end -- for | 347 end -- for | 
| 343 | 348 | 
| 349 -- do not show an empty menu | |
| 350 if not existsValidEntries then | |
| 351 return false | |
| 352 end | |
| 353 | |
| 344 MenuFrame:SetHeight(89 + numActiveEntries*(MENU_ENTRY_HEIGHT+2)) | 354 MenuFrame:SetHeight(89 + numActiveEntries*(MENU_ENTRY_HEIGHT+2)) | 
| 345 | 355 | 
| 346 MenuFrame:ClearAllPoints() | 356 MenuFrame:ClearAllPoints() | 
| 347 MenuFrame:SetPoint("TOPLEFT",TradeSkillFrame,"TOPRIGHT",-2,14) | 357 MenuFrame:SetPoint("TOPLEFT",TradeSkillFrame,"TOPRIGHT",-2,14) | 
| 348 | 358 | 
| 349 -- Update counts and set actions | 359 -- Update counts and set actions | 
| 350 MenuFrame.updateCounts() | 360 MenuFrame.updateCounts() | 
| 351 | 361 | 
| 352 MenuFrame:Show() | 362 MenuFrame:Show() | 
| 353 | 363 | 
| 354 if not MenuFrame.state then | 364 if not noSkipped then | 
| 355 MenuFrame:SetScript("OnUpdate",reopen) | 365 MenuFrame:SetScript("OnUpdate",reopen) | 
| 356 end | 366 end | 
| 357 end | 367 end | 
