public
Description: WoW Addon - Prospecting and Disenchanting Aide
Homepage: http://www.tekkub.net
Clone URL: git://github.com/tekkub/panda.git
Click here to lend your support to: panda and make a donation at www.pledgie.com !
Common constants across the addon (save a smidge of memory)
tekkub (author)
Tue Jan 15 20:12:19 -0800 2008
commit  4c352777b368ba3411174a47ce8a0df889f84296
tree    73c7085267706c9e9647d7e510aafe8d244d1ca5
parent  03f1e129a5ac212d197df4c5e826733f6d927ff3
...
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
...
65
66
67
68
 
69
70
71
...
75
76
77
78
 
79
80
81
...
83
84
85
86
 
87
88
89
...
93
94
95
96
 
97
98
99
...
3
4
5
6
7
8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
10
11
 
12
13
14
15
16
17
18
 
 
 
19
20
21
22
...
46
47
48
 
49
50
51
52
...
56
57
58
 
59
60
61
62
...
64
65
66
 
67
68
69
70
...
74
75
76
 
77
78
79
80
0
@@ -3,39 +3,20 @@
0
 -- Are you local? --
0
 ------------------------------
0
 
0
+local BC_GREEN_GEMS, BC_BLUE_GEMS, CUTS = Panda.BC_GREEN_GEMS, Panda.BC_BLUE_GEMS, Panda.CUTS
0
 local HideTooltip, ShowTooltip, GS = Panda.HideTooltip, Panda.ShowTooltip, Panda.GS
0
 local frame
0
-local basegems = {
0
- {23077, 21929, 23112, 23079, 23117, 23107}, -- BC Greens
0
- {23436, 23439, 23440, 23437, 23438, 23441}, -- BC Blues
0
-}
0
-local cuts = {
0
- [23077] = {23094, 23095, 23097, 23096, 28595},
0
- [21929] = {23098, 23099, 23100, 23101, 31866, 31869},
0
- [23112] = {23113, 23114, 23115, 23116, 28290, 31860},
0
- [23079] = {23103, 23104, 23105, 23106},
0
- [23117] = {23118, 23119, 23120, 23121},
0
- [23107] = {23108, 23109, 23110, 23111, 31862, 31864},
0
- [23436] = {24027, 24028, 24029, 24030, 24031, 24032, 24036},
0
- [23439] = {24058, 24059, 24060, 24061, 31867, 31868},
0
- [23440] = {24047, 24048, 24050, 24051, 24052, 24053, 31861},
0
- [23437] = {24062, 24065, 24066, 24067, 33782},
0
- [23438] = {24033, 24035, 24037, 24039},
0
- [23441] = {24054, 24055, 24056, 24057, 31863, 31865},
0
-}
0
 
0
 
0
 -- Query server, we need these items!
0
-for i,t in pairs(cuts) do for _,id in pairs(t) do GameTooltip:SetHyperlink("item:"..id) end end
0
+for i,t in pairs(CUTS) do for _,id in pairs(t) do GameTooltip:SetHyperlink("item:"..id) end end
0
 
0
 
0
 local cutframes, knowncombines, frame = {}, {}
0
 function Panda:CreateCutGreenBluePanel()
0
   local function SetupFrame(f, id, secure)
0
     local name, link, _, _, _, _, _, _, _, texture = GetItemInfo(id)
0
- f.link = link
0
- f.id = id
0
- f.name = name
0
+ f.link, f.id, f.name = link, id, name
0
 
0
     f:SetHeight(32)
0
     f:SetWidth(32)
0
@@ -65,7 +46,7 @@ function Panda:CreateCutGreenBluePanel()
0
 
0
   local HGAP, VGAP = 5, -18
0
   local rowanchor, lastframe
0
- for i,rawid in ipairs(basegems[1]) do
0
+ for i,rawid in ipairs(BC_GREEN_GEMS) do
0
     local f = CreateFrame("Frame", nil, frame)
0
     if i == 1 then
0
       f:SetPoint("TOPLEFT", frame, "TOPLEFT", HGAP, -HGAP)
0
@@ -75,7 +56,7 @@ function Panda:CreateCutGreenBluePanel()
0
     rowanchor = f
0
     lastframe = SetupFrame(f, rawid)
0
 
0
- for j,id in ipairs(cuts[rawid]) do
0
+ for j,id in ipairs(CUTS[rawid]) do
0
       local f = CreateFrame("CheckButton", nil, frame, "SecureActionButtonTemplate")
0
       f:SetPoint("LEFT", lastframe, "RIGHT", HGAP, 0)
0
       lastframe = SetupFrame(f, id, true)
0
@@ -83,7 +64,7 @@ function Panda:CreateCutGreenBluePanel()
0
     end
0
   end
0
 
0
- for i,rawid in ipairs(basegems[2]) do
0
+ for i,rawid in ipairs(BC_BLUE_GEMS) do
0
     local f = CreateFrame("Frame", nil, frame)
0
     if i == 1 then
0
       f:SetPoint("TOPLEFT", frame, "TOPLEFT", HGAP*8 + 32*8, -HGAP)
0
@@ -93,7 +74,7 @@ function Panda:CreateCutGreenBluePanel()
0
     rowanchor = f
0
     lastframe = SetupFrame(f, rawid)
0
 
0
- for j,id in ipairs(cuts[rawid]) do
0
+ for j,id in ipairs(CUTS[rawid]) do
0
       local f = CreateFrame("CheckButton", nil, frame, "SecureActionButtonTemplate")
0
       f:SetPoint("LEFT", lastframe, "RIGHT", HGAP, 0)
0
       lastframe = SetupFrame(f, id, true)
...
1
2
3
 
 
 
4
5
6
7
8
9
 
 
10
11
12
 
13
14
15
...
34
35
36
 
 
 
 
37
38
39
...
52
53
54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
 
 
2
3
4
5
6
7
8
9
10
11
12
13
14
 
15
16
17
18
...
37
38
39
40
41
42
43
44
45
46
...
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
0
@@ -1,15 +1,18 @@
0
 
0
-local OptionHouse = LibStub("OptionHouse-1.1")
0
-
0
+-------------------------------
0
+-- Addon Namespace --
0
+-------------------------------
0
 
0
 Panda = DongleStub("Dongle-1.0"):New("Panda")
0
 if tekDebug then Panda:EnableDebug(1, tekDebug:GetFrame("Panda")) end
0
 
0
 
0
 function Panda:Initialize()
0
+ self.BC_GREEN_GEMS, self.BC_BLUE_GEMS, self.CUTS = nil -- Don't hold on to the constants, we might want them to GC later
0
+
0
   local _, title = GetAddOnInfo("Panda")
0
   local author, version = GetAddOnMetadata("Panda", "Author"), GetAddOnMetadata("Panda", "Version")
0
- local oh = OptionHouse:RegisterAddOn("Panda", title, author, version)
0
+ local oh = LibStub("OptionHouse-1.1"):RegisterAddOn("Panda", title, author, version)
0
   oh:RegisterCategory("Disenchanting", self, "CreateDisenchantingPanel")
0
   oh:RegisterCategory("Prospecting", self, "CreateProspectingPanel")
0
   oh:RegisterCategory("Prices", self, "CreateDisenchantingPricePanel")
0
@@ -34,6 +37,10 @@ function Panda:Enable()
0
 end
0
 
0
 
0
+------------------------------
0
+-- Util functions --
0
+------------------------------
0
+
0
 function Panda:HideTooltip() GameTooltip:Hide() end
0
 function Panda:ShowTooltip()
0
   if not self.link then return end
0
@@ -52,3 +59,25 @@ function Panda.GS(cash)
0
   if g > 0 then return string.format("|cffffd700%d.|cffc7c7cf%02d", g, s)
0
   else return string.format("|cffc7c7cf%d", s) end
0
 end
0
+
0
+
0
+-------------------------
0
+-- Constants --
0
+-------------------------
0
+
0
+Panda.BC_GREEN_GEMS = {23077, 21929, 23112, 23079, 23117, 23107}
0
+Panda.BC_BLUE_GEMS = {23436, 23439, 23440, 23437, 23438, 23441}
0
+Panda.CUTS = {
0
+ [23077] = {23094, 23095, 23097, 23096, 28595},
0
+ [21929] = {23098, 23099, 23100, 23101, 31866, 31869},
0
+ [23112] = {23113, 23114, 23115, 23116, 28290, 31860},
0
+ [23079] = {23103, 23104, 23105, 23106},
0
+ [23117] = {23118, 23119, 23120, 23121},
0
+ [23107] = {23108, 23109, 23110, 23111, 31862, 31864},
0
+ [23436] = {24027, 24028, 24029, 24030, 24031, 24032, 24036},
0
+ [23439] = {24058, 24059, 24060, 24061, 31867, 31868},
0
+ [23440] = {24047, 24048, 24050, 24051, 24052, 24053, 31861},
0
+ [23437] = {24062, 24065, 24066, 24067, 33782},
0
+ [23438] = {24033, 24035, 24037, 24039},
0
+ [23441] = {24054, 24055, 24056, 24057, 31863, 31865},
0
+}
...
16
17
18
19
20
 
 
21
22
23
...
16
17
18
 
 
19
20
21
22
23
0
@@ -16,8 +16,8 @@ local deitems = {
0
 }
0
 local prositems = {
0
   {23424, 23425, 24243},
0
- {23077, 21929, 23112, 23079, 23117, 23107}, -- BC Greens
0
- {23436, 23439, 23440, 23437, 23438, 23441} -- BC Blues
0
+ Panda.BC_GREEN_GEMS,
0
+ Panda.BC_BLUE_GEMS,
0
 }
0
 
0
 

Comments

    No one has commented yet.