Mercurial > wow > recipeprofit
comparison core.lua @ 8:5a0fa30712da
RecipeProfit options added to GatherMate interface
| author | Aaron Bregger |
|---|---|
| date | Thu, 12 Aug 2010 15:39:27 -0500 |
| parents | 6d25e5522e0f |
| children | 20e2aefac1b0 |
comparison
equal
deleted
inserted
replaced
| 7:6d25e5522e0f | 8:5a0fa30712da |
|---|---|
| 58 else | 58 else |
| 59 print(indent .. k .. " = " .. v) | 59 print(indent .. k .. " = " .. v) |
| 60 end | 60 end |
| 61 end | 61 end |
| 62 end | 62 end |
| 63 | |
| 63 local defaultProfile = { | 64 local defaultProfile = { |
| 64 ["show"] = { | 65 ["show"] = { |
| 65 ["RecipeProfit"] = "always", | 66 ["RecipeProfit"] = "always", |
| 66 ["Herb Gathering"] = "never", | 67 ["Herb Gathering"] = "never", |
| 67 ["Extract Gas"] = "never", | 68 ["Extract Gas"] = "never", |
| 68 ["Fishing"] = "never", | 69 ["Fishing"] = "never", |
| 69 ["Mining"] = "never", | 70 ["Mining"] = "never", |
| 70 ["Treasure"] = "never", | 71 ["Treasure"] = "never", |
| 71 }, | 72 }, |
| 72 ["trackShow"] = "never", | 73 ["trackShow"] = "active", |
| 73 } | 74 } |
| 74 | 75 |
| 75 local options = { | 76 local options = { |
| 76 type = "group", | 77 type = "group", |
| 77 name = "RecipeProfit", -- addon name to import from, don't localize | 78 name = "RecipeProfit", -- addon name to import from, don't localize |
| 157 db.profile = profile | 158 db.profile = profile |
| 158 db.storage = {} | 159 db.storage = {} |
| 159 | 160 |
| 160 GatherMate:GetModule("Config"):RegisterModule("RecipeProfit", options) | 161 GatherMate:GetModule("Config"):RegisterModule("RecipeProfit", options) |
| 161 GatherMate:RegisterDBType("RecipeProfit", db.storage) | 162 GatherMate:RegisterDBType("RecipeProfit", db.storage) |
| 162 GatherMate.db.profile.show["RecipeProfit"] = "always" | 163 GatherMate.db.profile.show["RecipeProfit"] = GatherMate.db.profile.show["RecipeProfit"] or "always" |
| 163 GatherMate.nodeIDs["RecipeProfit"] = {} | 164 GatherMate.nodeIDs["RecipeProfit"] = {} |
| 164 GatherMate.nodeTextures["RecipeProfit"] = {} | 165 GatherMate.nodeTextures["RecipeProfit"] = {} |
| 165 GatherMate.nodeMinHarvest["RecipeProfit"] = {} | 166 GatherMate.nodeMinHarvest["RecipeProfit"] = {} |
| 166 nodes = GatherMate.nodeIDs["RecipeProfit"] | 167 nodes = GatherMate.nodeIDs["RecipeProfit"] |
| 167 | 168 |
| 176 nodes[note.item.." - ("..note.vendor.." H)"] = id * 10 + 1 | 177 nodes[note.item.." - ("..note.vendor.." H)"] = id * 10 + 1 |
| 177 GatherMate.nodeTextures["RecipeProfit"][id * 10 + 1] = "Interface\\Icons\\INV_Scroll_05" | 178 GatherMate.nodeTextures["RecipeProfit"][id * 10 + 1] = "Interface\\Icons\\INV_Scroll_05" |
| 178 end | 179 end |
| 179 | 180 |
| 180 GatherMate.reverseNodeIDs["RecipeProfit"] = GatherMate:CreateReversedTable(nodes) | 181 GatherMate.reverseNodeIDs["RecipeProfit"] = GatherMate:CreateReversedTable(nodes) |
| 182 | |
| 183 GatherMate:GetModule("Config").options.args.display.args.general.args.showGroup.args["showRecipeProfit"] = { | |
| 184 order = 6, | |
| 185 name = "Show RecipeProfit nodes.", | |
| 186 desc = "Toggle showing nodes added by RecipeProfit.", | |
| 187 type = "select", | |
| 188 values = { | |
| 189 ["always"] = "Always show", | |
| 190 ["never"] = "Never show", | |
| 191 }, | |
| 192 arg = "RecipeProfit", | |
| 193 } | |
| 194 | |
| 195 GatherMate:GetModule("Config").options.args.display.args.general.args.iconGroup.args.tracking.args["showRecipeProfit"] = { | |
| 196 order = 6.5, | |
| 197 name = "RecipeProfit", | |
| 198 desc = "Color of the tracking circle.", | |
| 199 type = "color", | |
| 200 hasAlpha = true, | |
| 201 arg = "RecipeProfit", | |
| 202 } | |
| 203 | |
| 181 GatherMate:GetModule("Config"):UpdateConfig() | 204 GatherMate:GetModule("Config"):UpdateConfig() |
| 182 | |
| 183 GatherMate:GetModule("Config"):SendMessage("GatherMateConfigChanged") | 205 GatherMate:GetModule("Config"):SendMessage("GatherMateConfigChanged") |
| 184 end | 206 end |
| 185 | 207 |
| 186 function RecipeProfit:OnEnable() | 208 function RecipeProfit:OnEnable() |
| 187 for i=1, MERCHANT_ITEMS_PER_PAGE, 1 do | 209 for i=1, MERCHANT_ITEMS_PER_PAGE, 1 do |
