-
Notifications
You must be signed in to change notification settings - Fork 1
/
GatherIcons.lua
291 lines (275 loc) · 11.7 KB
/
GatherIcons.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
--[[
Icon set definitions
]]
Gather_IconSet = {
["original"] = {
["Default"] = {["default"] = "Interface\\AddOns\\Gatherer\\Shaded\\Blue"},
["Ore"] = {["default"] = "Interface\\AddOns\\Gatherer\\Original\\Ore"},
["Herb"] = {["default"] = "Interface\\AddOns\\Gatherer\\Original\\Herb"},
["Treasure"] = {["default"] = "Interface\\AddOns\\Gatherer\\Original\\Chest"},
["Test"] = {["default"] = "Interface\\AddOns\\Gatherer\\Original\\Test"},
},
["iconshade"] = {
["Test"] = {["default"] = "Interface\\AddOns\\Gatherer\\Original\\Test"},
},
["shaded"] = {
["Default"] = {["default"] = "Interface\\AddOns\\Gatherer\\Shaded\\Blue"},
["Ore"] = {["default"] = "Interface\\AddOns\\Gatherer\\Shaded\\Red"},
["Herb"] = {["default"] = "Interface\\AddOns\\Gatherer\\Shaded\\Green"},
["Treasure"] = {["default"] = "Interface\\AddOns\\Gatherer\\Shaded\\Yellow"},
["Test"] = {["default"] = "Interface\\AddOns\\Gatherer\\Shaded\\Test"},
},
["iconic"] = {
["Default"] = {["default"] = "Interface\\AddOns\\Gatherer\\Shaded\\Blue"},
["Ore"] = {
["default"] = "Interface\\AddOns\\Gatherer\\Shaded\\Red",
[ORE_COPPER] = "Interface\\AddOns\\Gatherer\\Icons\\OreCopper",
[ORE_TIN] = "Interface\\AddOns\\Gatherer\\Icons\\OreTin",
[ORE_SILVER] = "Interface\\AddOns\\Gatherer\\Icons\\OreSilver",
[ORE_IRON] = "Interface\\AddOns\\Gatherer\\Icons\\OreIron",
[ORE_GOLD] = "Interface\\AddOns\\Gatherer\\Icons\\OreGold",
[ORE_MITHRIL] = "Interface\\AddOns\\Gatherer\\Icons\\OreMithril",
[ORE_TRUESILVER] = "Interface\\AddOns\\Gatherer\\Icons\\OreTruesilver",
[ORE_THORIUM] = "Interface\\AddOns\\Gatherer\\Icons\\OreThorium",
[ORE_RTHORIUM] = "Interface\\Addons\\Gatherer\\Icons\\OreRThorium",
[ORE_DARKIRON] = "Interface\\Addons\\Gatherer\\Icons\\OreDarkIron",
},
["Herb"] = {
["default"] = "Interface\\AddOns\\Gatherer\\Shaded\\Green",
[HERB_ARTHASTEAR] = "Interface\\AddOns\\Gatherer\\Icons\\HerbArthasTears",
[HERB_BLACKLOTUS] = "Interface\\AddOns\\Gatherer\\Icons\\HerbBlackLotus",
[HERB_BLINDWEED] = "Interface\\AddOns\\Gatherer\\Icons\\HerbBlindweed",
[HERB_BRIARTHORN] = "Interface\\AddOns\\Gatherer\\Icons\\HerbBriarthorn",
[HERB_BRUISEWEED] = "Interface\\AddOns\\Gatherer\\Icons\\HerbBruiseweed",
[HERB_DREAMFOIL] = "Interface\\AddOns\\Gatherer\\Icons\\HerbDreamfoil",
[HERB_EARTHROOT] = "Interface\\AddOns\\Gatherer\\Icons\\HerbEarthroot",
[HERB_FADELEAF] = "Interface\\AddOns\\Gatherer\\Icons\\HerbFadeleaf",
[HERB_FIREBLOOM] = "Interface\\AddOns\\Gatherer\\Icons\\HerbFirebloom",
[HERB_GHOSTMUSHROOM] = "Interface\\AddOns\\Gatherer\\Icons\\HerbGhostMushroom",
[HERB_GOLDENSANSAM] = "Interface\\AddOns\\Gatherer\\Icons\\HerbGoldenSansam",
[HERB_GOLDTHORN] = "Interface\\AddOns\\Gatherer\\Icons\\HerbGoldthorn",
[HERB_GRAVEMOSS] = "Interface\\AddOns\\Gatherer\\Icons\\HerbGraveMoss",
[HERB_GROMSBLOOD] = "Interface\\AddOns\\Gatherer\\Icons\\HerbGromsblood",
[HERB_ICECAP] = "Interface\\AddOns\\Gatherer\\Icons\\HerbIcecap",
[HERB_KHADGARSWHISKER] = "Interface\\AddOns\\Gatherer\\Icons\\HerbKhadgarsWhisker",
[HERB_KINGSBLOOD] = "Interface\\AddOns\\Gatherer\\Icons\\HerbKingsblood",
[HERB_LIFEROOT] = "Interface\\AddOns\\Gatherer\\Icons\\HerbLiferoot",
[HERB_MAGEROYAL] = "Interface\\AddOns\\Gatherer\\Icons\\HerbMageroyal",
[HERB_MOUNTAINSILVERSAGE] = "Interface\\AddOns\\Gatherer\\Icons\\HerbMountainSilversage",
[HERB_PEACEBLOOM] = "Interface\\AddOns\\Gatherer\\Icons\\HerbPeacebloom",
[HERB_PLAGUEBLOOM] = "Interface\\AddOns\\Gatherer\\Icons\\HerbPlaguebloom",
[HERB_PURPLELOTUS] = "Interface\\AddOns\\Gatherer\\Icons\\HerbPurpleLotus",
[HERB_SILVERLEAF] = "Interface\\AddOns\\Gatherer\\Icons\\HerbSilverleaf",
[HERB_STRANGLEKELP] = "Interface\\AddOns\\Gatherer\\Icons\\HerbStranglekelp",
[HERB_SUNGRASS] = "Interface\\AddOns\\Gatherer\\Icons\\HerbSungrass",
[HERB_SWIFTTHISTLE] = "Interface\\AddOns\\Gatherer\\Icons\\HerbSwiftthistle",
[HERB_WILDSTEELBLOOM] = "Interface\\AddOns\\Gatherer\\Icons\\HerbWildSteelbloom",
[HERB_WINTERSBITE] = "Interface\\AddOns\\Gatherer\\Icons\\HerbWintersbite",
[HERB_WILDVINE] = "Interface\\AddOns\\Gatherer\\Icons\\HerbKingsblood",
},
["Treasure"] = {
["default"] = "Interface\\AddOns\\Gatherer\\Shaded\\Yellow",
[TREASURE_BOX] = "Interface\\AddOns\\Gatherer\\Icons\\TreasureCrate",
[TREASURE_CHEST] = "Interface\\AddOns\\Gatherer\\Icons\\TreasureChest",
[TREASURE_CLAM] = "Interface\\AddOns\\Gatherer\\Icons\\TreasureClam",
[TREASURE_CRATE] = "Interface\\AddOns\\Gatherer\\Icons\\TreasureCrate",
[TREASURE_BARREL] = "Interface\\AddOns\\Gatherer\\Icons\\TreasureBarrel",
[TREASURE_CASK] = "Interface\\AddOns\\Gatherer\\Icons\\TreasureBarrel",
[TREASURE_FOOTLOCKER] = "Interface\\AddOns\\Gatherer\\Icons\\TreasureChest",
[TREASURE_UNGOROSOIL] = "Interface\\AddOns\\Gatherer\\Icons\\UngoroDirtPile",
[TREASURE_BLOODPETAL] = "Interface\\AddOns\\Gatherer\\Icons\\UngoroSprout",
[TREASURE_POWERCRYST] = "Interface\\AddOns\\Gatherer\\Icons\\UngoroCrystal",
[TREASURE_BLOODHERO] = "Interface\\AddOns\\Gatherer\\Icons\\TreasureBloodHero",
[TREASURE_SHELLFISHTRAP] = "Interface\\AddOns\\Gatherer\\Icons\\TreasureShellfishTrap",
[TREASURE_FISHNODE] = "Interface\\AddOns\\Gatherer\\Icons\\TreasureFishnode",
[TREASURE_FISHWRECK] = "Interface\\AddOns\\Gatherer\\Icons\\TreasureFishwreck",
[TREASURE_FISHELEM] = "Interface\\AddOns\\Gatherer\\Icons\\TreasureFishElem",
[TREASURE_NIGHTDRAGON] = "Interface\\Icons\\INV_Misc_Food_45",
[TREASURE_WHIPPERROOT] = "Interface\\Icons\\INV_Misc_Food_55",
[TREASURE_WINDBLOSSOM] = "Interface\\Icons\\INV_Misc_Food_58",
[TREASURE_SONGFLOWER] = "Interface\\Icons\\Spell_Holy_MindVision",
},
["Test"] = {["default"] = "Interface\\AddOns\\Gatherer\\Shaded\\Test"},
},
};
-- Ore rare spawn/Herbs find with matching table
Gather_RareMatch = {
[ORE_TIN] = ORE_SILVER,
[ORE_IRON] = ORE_GOLD,
[ORE_MITHRIL] = ORE_TRUESILVER,
[HERB_MAGEROYAL] = HERB_SWIFTTHISTLE,
[HERB_BRIARTHORN] = HERB_SWIFTTHISTLE,
[HERB_PURPLELOTUS] = HERB_WILDVINE,
};
-- Skill levels required
Gather_SkillLevel = {
-- Ores
[ORE_COPPER] = 1,
[ORE_TIN] = 65,
[ORE_SILVER] = 75,
[ORE_IRON] = 125,
[ORE_GOLD] = 155,
[ORE_MITHRIL] = 175,
[ORE_TRUESILVER] = 230,
[ORE_THORIUM] = 245,
[ORE_RTHORIUM] = 270,
[ORE_DARKIRON] = 230,
-- Herbs
[HERB_PEACEBLOOM] = 1,
[HERB_SILVERLEAF] = 1,
[HERB_EARTHROOT] = 15,
[HERB_MAGEROYAL] = 50,
[HERB_BRIARTHORN] = 75,
[HERB_SWIFTTHISTLE] = 50,
[HERB_STRANGLEKELP] = 85,
[HERB_BRUISEWEED] = 100,
[HERB_WILDSTEELBLOOM] = 115,
[HERB_GRAVEMOSS] = 120,
[HERB_KINGSBLOOD] = 125,
[HERB_LIFEROOT] = 150,
[HERB_FADELEAF] = 160,
[HERB_GOLDTHORN] = 175,
[HERB_KHADGARSWHISKER] = 185,
[HERB_WINTERSBITE] = 195,
[HERB_FIREBLOOM] = 205,
[HERB_PURPLELOTUS] = 210,
[HERB_WILDVINE] = 210,
[HERB_SUNGRASS] = 230,
[HERB_BLINDWEED] = 235,
[HERB_GHOSTMUSHROOM] = 245,
[HERB_GROMSBLOOD] = 250,
[HERB_GOLDENSANSAM] = 260,
[HERB_ARTHASTEAR] = 220,
[HERB_DREAMFOIL] = 270,
[HERB_MOUNTAINSILVERSAGE]= 280,
[HERB_PLAGUEBLOOM] = 285,
[HERB_ICECAP] = 290,
[HERB_BLACKLOTUS] = 300,
};
-- Match tables for shorter DB format
-- converting IconIndex to IconName and vice versa
function Gatherer_GetDB_IconIndex(iconIndex, gatherType)
-- type: (Icon, Optional[Gatherer_EGatherType]) -> Tuple[Icon, Optional[Gatherer_EGatherType]]
local iconName, gatherTypeIndex;
-- if gatherType wasn't set while icon was searched by name
if ( not gatherType and type(iconIndex) == "string" ) then
-- try to find icon index by looking through *every* possible gatherType
for myGather in Gatherer_EGatherType do
local icon = Gatherer_GetDB_IconIndex(iconIndex, myGather);
if (icon) then
-- this time return both index and hitted gatherType
return icon, myGather;
end;
end
end
gatherTypeIndex = Gatherer_EGatherType_ensureIndex(gatherType)
-- when gatherType isn't set and type(iconIndex) ~= 'string'
-- it'll loudly fail since gatherTypeIndex would be nil
for iconName in Gather_DB_IconIndex[gatherTypeIndex] do
if ( type(iconIndex) == "string" and iconName == iconIndex ) then
-- return index number
return Gather_DB_IconIndex[gatherTypeIndex][iconName];
elseif ( type(iconIndex) == "number" and Gather_DB_IconIndex[gatherTypeIndex][iconName] == iconIndex ) then
-- return icon string
return iconName;
end
end
return nil;
end
function Gatherer_GetDB_IconByGatherName(gatherName)
local iconName, numType;
local iconName = Gatherer_FindOreType(gatherName);
if (iconName) then -- Ore
numType = 2;
else
iconName = Gatherer_FindTreasureType(gatherName);
if (iconName) then -- Treasure
numType = 0;
else -- Herb
iconName = gatherName;
numType = 1;
end
end
if (not iconName) then
iconName = "default";
numType = 3;
end
return iconName, numType;
end
-- Icon indexes
-- 0 => Treasures
-- 1 => Herbs
-- 2 => Ores
-- Note: If you add new items, use icon index numbers starting from 100
Gather_DB_IconIndex = {}; -- type: Dict[Gatherer_EGatherType, Dict[IconName, IconIndex]]
Gather_DB_IconIndex[0] = {
["default"] = 0,
[TREASURE_BOX] = 1,
[TREASURE_CHEST] = 2,
[TREASURE_CLAM] = 3,
[TREASURE_CRATE] = 4,
[TREASURE_BARREL] = 5,
[TREASURE_CASK] = 6,
[TREASURE_FOOTLOCKER] = 7,
[TREASURE_UNGOROSOIL] = 8,
[TREASURE_BLOODPETAL] = 9,
[TREASURE_POWERCRYST] = 10,
[TREASURE_BLOODHERO] = 11,
[TREASURE_SHELLFISHTRAP]= 12,
[TREASURE_FISHNODE] = 13,
[TREASURE_FISHWRECK] = 14,
[TREASURE_FISHELEM] = 15,
[TREASURE_NIGHTDRAGON] = 16,
[TREASURE_WHIPPERROOT] = 17,
[TREASURE_WINDBLOSSOM] = 18,
[TREASURE_SONGFLOWER] = 19,
};
Gather_DB_IconIndex[1] = {
["default"] = 0,
[HERB_PEACEBLOOM] = 1,
[HERB_SILVERLEAF] = 2,
[HERB_EARTHROOT] = 3,
[HERB_MAGEROYAL] = 4,
[HERB_BRIARTHORN] = 5,
[HERB_SWIFTTHISTLE] = 6,
[HERB_STRANGLEKELP] = 7,
[HERB_BRUISEWEED] = 8,
[HERB_WILDSTEELBLOOM] = 9,
[HERB_GRAVEMOSS] = 10,
[HERB_KINGSBLOOD] = 11,
[HERB_LIFEROOT] = 12,
[HERB_FADELEAF] = 13,
[HERB_GOLDTHORN] = 14,
[HERB_KHADGARSWHISKER] = 15,
[HERB_WINTERSBITE] = 16,
[HERB_FIREBLOOM] = 17,
[HERB_PURPLELOTUS] = 18,
[HERB_WILDVINE] = 19,
[HERB_SUNGRASS] = 20,
[HERB_BLINDWEED] = 21,
[HERB_GHOSTMUSHROOM] = 22,
[HERB_GROMSBLOOD] = 23,
[HERB_GOLDENSANSAM] = 24,
[HERB_ARTHASTEAR] = 25,
[HERB_DREAMFOIL] = 26,
[HERB_MOUNTAINSILVERSAGE]= 27,
[HERB_PLAGUEBLOOM] = 28,
[HERB_ICECAP] = 29,
[HERB_BLACKLOTUS] = 30,
};
Gather_DB_IconIndex[2] = {
["default"] = 0,
[ORE_COPPER] = 1,
[ORE_TIN] = 2,
[ORE_SILVER] = 3,
[ORE_IRON] = 4,
[ORE_GOLD] = 5,
[ORE_MITHRIL] = 6,
[ORE_TRUESILVER] = 7,
[ORE_THORIUM] = 8,
[ORE_RTHORIUM] = 9,
[ORE_DARKIRON] = 10,
};
Gather_DB_IconIndex[3] = {
["default"] = 0,
}