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 !
Add epic cutting panel, Brilliant Glass, new Rare cuts
tekkub (author)
Fri Apr 04 13:51:38 -0700 2008
commit  88825f764210a8cedf108e33d68b0edf66755560
tree    39b93c1477c37b88e2043de69688b83a814c0ebd
parent  0eef7b1a8be8d48ec0ea3c27a0785208bec0e122
...
3
4
5
6
7
8
 
 
 
9
10
11
12
 
13
14
15
16
17
 
18
19
20
...
28
29
30
31
32
33
34
 
 
 
 
 
 
35
36
37
...
73
74
75
 
 
 
 
 
76
77
78
...
131
132
133
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
134
135
136
...
3
4
5
 
 
 
6
7
8
9
10
11
 
12
13
14
15
16
 
17
18
19
20
...
28
29
30
 
 
 
 
31
32
33
34
35
36
37
38
39
...
75
76
77
78
79
80
81
82
83
84
85
...
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
0
@@ -3,18 +3,18 @@
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 BC_GREEN_GEMS, BC_BLUE_GEMS, BC_EPIC_GEMS, CUTS = Panda.BC_GREEN_GEMS, Panda.BC_BLUE_GEMS, Panda.BC_EPIC_GEMS, Panda.CUTS
0
+local HideTooltip, ShowTooltip, GS, G = Panda.HideTooltip, Panda.ShowTooltip, Panda.GS, Panda.G
0
+local frame, epicframe
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 GameTooltip:SetHyperlink("item:"..i); for _,id in pairs(t) do GameTooltip:SetHyperlink("item:"..id) end end
0
 
0
 
0
 local rawframes, cutframes, knowncombines, frame = {}, {}, {}
0
 function Panda:CreateCutGreenBluePanel()
0
- local function SetupFrame(f, id, secure)
0
+ local function SetupFrame(f, id, secure, notext)
0
     local name, link, _, _, _, _, _, _, _, texture = GetItemInfo(id)
0
     f.link, f.id, f.name = link, id, name
0
 
0
@@ -28,10 +28,12 @@ function Panda:CreateCutGreenBluePanel()
0
     icon:SetAllPoints(f)
0
     icon:SetTexture(texture)
0
 
0
- local text = f:CreateFontString(nil, "ARTWORK", "GameFontNormalSmall")
0
- text:SetPoint("TOP", icon, "BOTTOM")
0
- local price = Panda:GetAHBuyout(id)
0
- text:SetText(GS(price))
0
+ if not notext then
0
+ local text = f:CreateFontString(nil, "ARTWORK", "GameFontNormalSmall")
0
+ text:SetPoint("TOP", icon, "BOTTOM")
0
+ local price = Panda:GetAHBuyout(id)
0
+ text:SetText(GS(price))
0
+ end
0
 
0
     local count = f:CreateFontString(nil, "ARTWORK", "NumberFontNormalSmall")
0
     count:SetPoint("BOTTOMRIGHT", icon, "BOTTOMRIGHT", -2, 2)
0
@@ -73,6 +75,11 @@ function Panda:CreateCutGreenBluePanel()
0
     local f = CreateFrame("Frame", nil, frame)
0
     if i == 1 then
0
       f:SetPoint("TOPLEFT", frame, "TOPLEFT", HGAP*8 + 32*8, -HGAP)
0
+
0
+ local f2 = CreateFrame("CheckButton", nil, frame, "SecureActionButtonTemplate")
0
+ f2:SetPoint("BOTTOMLEFT", f, "TOPLEFT", 0, -VGAP)
0
+ SetupFrame(f2, 35945, true, true)
0
+ cutframes[35945] = f2
0
     else
0
       f:SetPoint("TOPLEFT", rowanchor, "BOTTOMLEFT", 0, VGAP)
0
     end
0
@@ -131,6 +138,105 @@ function Panda:CreateCutGreenBluePanel()
0
 end
0
 
0
 
0
+function Panda:CreateCutPurplePanel()
0
+ local function SetupFrame(f, id, secure)
0
+ local name, link, _, _, _, _, _, _, _, texture = GetItemInfo(id)
0
+ f.link, f.id, f.name = link, id, name
0
+
0
+ f:SetHeight(32)
0
+ f:SetWidth(32)
0
+ if not secure then f:EnableMouse() end
0
+ f:SetScript("OnEnter", ShowTooltip)
0
+ f:SetScript("OnLeave", HideTooltip)
0
+
0
+ local icon = f:CreateTexture(nil, "ARTWORK")
0
+ icon:SetAllPoints(f)
0
+ icon:SetTexture(texture)
0
+
0
+ local text = f:CreateFontString(nil, "ARTWORK", "GameFontNormalSmall")
0
+ text:SetPoint("TOP", icon, "BOTTOM")
0
+ local price = Panda:GetAHBuyout(id)
0
+ text:SetText(G(price))
0
+
0
+ local count = f:CreateFontString(nil, "ARTWORK", "NumberFontNormalSmall")
0
+ count:SetPoint("BOTTOMRIGHT", icon, "BOTTOMRIGHT", -2, 2)
0
+ f.count = count
0
+
0
+ if secure and self.canJC then
0
+ f:SetAlpha(knowncombines[f.name] and 1 or 0.25)
0
+ f:SetAttribute("type", "macro")
0
+ f:SetAttribute("macrotext", "/run CloseTradeSkill()\n/cast Jewelcrafting\n/run for i=1,GetNumTradeSkills() do if GetTradeSkillInfo(i) == '"..name.."' then DoTradeSkill(i) end end\n/run CloseTradeSkill()")
0
+ end
0
+
0
+ return f
0
+ end
0
+
0
+ epicframe = CreateFrame("Frame", nil, UIParent)
0
+
0
+ local HGAP, VGAP = 5, -18
0
+ local rowanchor, lastframe
0
+ for i,rawid in ipairs(BC_EPIC_GEMS) do
0
+ local f = CreateFrame("Frame", nil, epicframe)
0
+ if i == 1 then
0
+ f:SetPoint("TOPLEFT", epicframe, "TOPLEFT", HGAP, -HGAP)
0
+ else
0
+ f:SetPoint("TOPLEFT", rowanchor, "BOTTOMLEFT", 0, VGAP)
0
+ end
0
+ rowanchor = f
0
+ lastframe = SetupFrame(f, rawid)
0
+ rawframes[rawid] = f
0
+
0
+ for j,id in ipairs(CUTS[rawid]) do
0
+ local f = CreateFrame("CheckButton", nil, epicframe, "SecureActionButtonTemplate")
0
+ f:SetPoint("LEFT", lastframe, "RIGHT", HGAP, 0)
0
+ lastframe = SetupFrame(f, id, true)
0
+ cutframes[id] = f
0
+ end
0
+ end
0
+
0
+ if self.canJC then
0
+ local b = CreateFrame("Button", nil, epicframe, "SecureActionButtonTemplate")
0
+ b:SetPoint("TOPRIGHT", epicframe, "BOTTOMRIGHT", 4, -3)
0
+ b:SetWidth(80) b:SetHeight(22)
0
+
0
+ -- Fonts --
0
+ b:SetDisabledFontObject(GameFontDisable)
0
+ b:SetHighlightFontObject(GameFontHighlight)
0
+ b:SetTextFontObject(GameFontNormal)
0
+
0
+ -- Textures --
0
+ b:SetNormalTexture("Interface\\Buttons\\UI-Panel-Button-Up")
0
+ b:SetPushedTexture("Interface\\Buttons\\UI-Panel-Button-Down")
0
+ b:SetHighlightTexture("Interface\\Buttons\\UI-Panel-Button-Highlight")
0
+ b:SetDisabledTexture("Interface\\Buttons\\UI-Panel-Button-Disabled")
0
+ b:GetNormalTexture():SetTexCoord(0, 0.625, 0, 0.6875)
0
+ b:GetPushedTexture():SetTexCoord(0, 0.625, 0, 0.6875)
0
+ b:GetHighlightTexture():SetTexCoord(0, 0.625, 0, 0.6875)
0
+ b:GetDisabledTexture():SetTexCoord(0, 0.625, 0, 0.6875)
0
+ b:GetHighlightTexture():SetBlendMode("ADD")
0
+
0
+ b:SetText("Refresh")
0
+ b:SetAttribute("type", "macro")
0
+ b:SetAttribute("macrotext", "/run CloseTradeSkill()\n/cast Jewelcrafting\n/run CloseTradeSkill()")
0
+ end
0
+
0
+ epicframe:Hide()
0
+ epicframe:SetScript("OnShow", function()
0
+ OpenBackpack()
0
+ self:RegisterEvent("BAG_UPDATE", "GemCutBagUpdate")
0
+ self:GemCutBagUpdate()
0
+ end)
0
+ epicframe:SetScript("OnHide", function() self:UnregisterEvent("BAG_UPDATE") end)
0
+
0
+--~ OpenBackpack()
0
+--~ self:RegisterEvent("BAG_UPDATE", "GemCutBagUpdate")
0
+--~ self:GemCutBagUpdate()
0
+
0
+ self.CreateCutGreenBluePanel = nil -- Don't need this function anymore!
0
+ return epicframe
0
+end
0
+
0
+
0
 function Panda:TRADE_SKILL_SHOW()
0
   for i=1,GetNumTradeSkills() do
0
     local name, rowtype = GetTradeSkillInfo(i)
...
17
18
19
 
20
21
22
...
61
62
63
 
 
 
 
 
 
64
65
66
67
68
69
 
70
71
72
...
75
76
77
78
79
80
 
 
 
81
82
 
 
 
 
 
 
 
83
...
17
18
19
20
21
22
23
...
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
...
83
84
85
 
 
 
86
87
88
89
 
90
91
92
93
94
95
96
97
0
@@ -17,6 +17,7 @@ function Panda:Initialize()
0
   oh:RegisterCategory("Prospecting", self, "CreateProspectingPanel")
0
   oh:RegisterCategory("Prices", self, "CreateDisenchantingPricePanel")
0
   oh:RegisterCategory("Gem Cutting", self, "CreateCutGreenBluePanel")
0
+ oh:RegisterCategory("Gem Cutting (Epic)", self, "CreateCutPurplePanel")
0
 
0
   self:RegisterEvent("LOOT_OPENED")
0
 end
0
@@ -61,12 +62,19 @@ function Panda.GS(cash)
0
 end
0
 
0
 
0
+function Panda.G(cash)
0
+ if not cash then return end
0
+ return "|cffffd700".. floor(cash/10000)
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.BC_EPIC_GEMS = {32227, 32231, 32229, 32249, 32228, 32230}
0
 Panda.CUTS = {
0
   [23077] = {23094, 23095, 23097, 23096, 28595},
0
   [21929] = {23098, 23099, 23100, 23101, 31866, 31869},
0
@@ -75,9 +83,15 @@ Panda.CUTS = {
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
+ [23439] = {24058, 24059, 24060, 24061, 31867, 31868, 35316},
0
+ [23440] = {24047, 24048, 24050, 24051, 24052, 24053, 31861, 35315},
0
+ [23437] = {24062, 24065, 24066, 24067, 33782, 35318},
0
   [23438] = {24033, 24035, 24037, 24039},
0
- [23441] = {24054, 24055, 24056, 24057, 31863, 31865},
0
+ [23441] = {24054, 24055, 24056, 24057, 31863, 31865, 35707},
0
+ [32227] = {32193, 32194, 32195, 32196, 32197, 32198, 32199},
0
+ [32231] = {32217, 32218, 32219, 32220, 32221, 32222, 35760},
0
+ [32229] = {32204, 32205, 32206, 32207, 32208, 32209, 32210, 35761},
0
+ [32249] = {32223, 32224, 32225, 32226, 35758, 35759},
0
+ [32228] = {32200, 32201, 32202, 32203},
0
+ [32230] = {32211, 32212, 32213, 32214, 32215, 32216},
0
 }

Comments

    No one has commented yet.