Mercurial > wow > reagentmaker
comparison ReagentMaker.lua @ 24:5f3a5b88fb19
First attempt to unfilter, failed badly... I'm not even sure it'll be possible at all.
| author | contrebasse |
|---|---|
| date | Wed, 27 Apr 2011 23:46:20 +0200 |
| parents | 8acb6dc1ff9e |
| children | 578b9c9479c9 |
comparison
equal
deleted
inserted
replaced
| 23:8acb6dc1ff9e | 24:5f3a5b88fb19 |
|---|---|
| 99 --]] | 99 --]] |
| 100 end -- function | 100 end -- function |
| 101 | 101 |
| 102 -- Function run after selecting a item in the tradeskill window | 102 -- Function run after selecting a item in the tradeskill window |
| 103 function A.ProcessReagent(btn, ...) | 103 function A.ProcessReagent(btn, ...) |
| 104 | |
| 104 -- Do not manage guild tradeskill | 105 -- Do not manage guild tradeskill |
| 105 if IsTradeSkillGuild() or IsTradeSkillLinked() then return end | 106 if IsTradeSkillGuild() or IsTradeSkillLinked() then return end |
| 106 | 107 |
| 107 -- We want no modifiers, or shift to choose the number of reagent to craft | 108 -- We want no modifiers, or shift to choose the number of reagent to craft |
| 108 if IsModifierKeyDown() and not IsShiftKeyDown() then return end | 109 if IsModifierKeyDown() and not IsShiftKeyDown() then return end |
| 109 local chooseNumberToCraft = IsShiftKeyDown() | 110 local chooseNumberToCraft = IsShiftKeyDown() |
| 111 | |
| 112 --A.SaveActiveFilters() | |
| 110 | 113 |
| 111 -- Index of the reagent in the recipe, taken from the button name | 114 -- Index of the reagent in the recipe, taken from the button name |
| 112 local reagentRecipeIndex = A.buttonNumber(btn) | 115 local reagentRecipeIndex = A.buttonNumber(btn) |
| 113 | 116 |
| 114 -- ID of the reagent we want to craft | 117 -- ID of the reagent we want to craft |
| 132 print("Sorry, can not make reagent...") | 135 print("Sorry, can not make reagent...") |
| 133 end | 136 end |
| 134 else | 137 else |
| 135 A.externalCraftWindow(reagentID) | 138 A.externalCraftWindow(reagentID) |
| 136 end -- if | 139 end -- if |
| 140 --A.RestoreActiveFilters() | |
| 137 end -- function | 141 end -- function |
| 138 | 142 |
| 139 | 143 |
| 140 --------------------------------------------------- | 144 --------------------------------------------------- |
| 141 -- Craft items | 145 -- Craft items |
| 187 if IsTradeSkillGuild() or IsTradeSkillLinked() then return end | 191 if IsTradeSkillGuild() or IsTradeSkillLinked() then return end |
| 188 | 192 |
| 189 -- Index of the reagent in the recipe, taken from the button name | 193 -- Index of the reagent in the recipe, taken from the button name |
| 190 local reagentRecipeIndex = A.buttonNumber(btn) | 194 local reagentRecipeIndex = A.buttonNumber(btn) |
| 191 | 195 |
| 196 --A.SaveActiveFilters() | |
| 197 | |
| 192 -- ID of the reagent we want to craft | 198 -- ID of the reagent we want to craft |
| 193 local reagentLink = GetTradeSkillReagentItemLink(GetTradeSkillSelectionIndex(), reagentRecipeIndex) | 199 local reagentLink = GetTradeSkillReagentItemLink(GetTradeSkillSelectionIndex(), reagentRecipeIndex) |
| 194 local reagentID = A.link2ID(reagentLink) | 200 local reagentID = A.link2ID(reagentLink) |
| 195 | 201 |
| 196 -- Continue only if the reagent is known | 202 -- Continue only if the reagent is known |
| 206 local index = A.findSkillIndex(reagentID) | 212 local index = A.findSkillIndex(reagentID) |
| 207 if index then | 213 if index then |
| 208 link = GetTradeSkillRecipeLink(A.findSkillIndex(reagentID)) | 214 link = GetTradeSkillRecipeLink(A.findSkillIndex(reagentID)) |
| 209 end | 215 end |
| 210 end | 216 end |
| 217 | |
| 218 --A.RestoreActiveFilters() | |
| 219 | |
| 211 if link then | 220 if link then |
| 212 A.tooltipRecipe:SetOwner(btn) | 221 A.tooltipRecipe:SetOwner(btn) |
| 213 A.tooltipRecipe:SetHyperlink(link) | 222 A.tooltipRecipe:SetHyperlink(link) |
| 214 A.tooltipRecipe:Show() | 223 A.tooltipRecipe:Show() |
| 215 A.tooltipRecipe:ClearAllPoints() | 224 A.tooltipRecipe:ClearAllPoints() |
