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 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
-- 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
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
@@ -28,10 +28,12 @@ function Panda:CreateCutGreenBluePanel()
0
icon:SetTexture(texture)
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
+ 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
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
f:SetPoint("TOPLEFT", frame, "TOPLEFT", HGAP*8 + 32*8, -HGAP)
0
+ local f2 = CreateFrame("CheckButton", nil, frame, "SecureActionButtonTemplate")
0
+ f2:SetPoint("BOTTOMLEFT", f, "TOPLEFT", 0, -VGAP)
0
+ SetupFrame(f2, 35945, true, true)
0
f:SetPoint("TOPLEFT", rowanchor, "BOTTOMLEFT", 0, VGAP)
0
@@ -131,6 +138,105 @@ function Panda:CreateCutGreenBluePanel()
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
+ if not secure then f:EnableMouse() end
0
+ f:SetScript("OnEnter", ShowTooltip)
0
+ f:SetScript("OnLeave", HideTooltip)
0
+ local icon = f:CreateTexture(nil, "ARTWORK")
0
+ icon:SetTexture(texture)
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
+ local count = f:CreateFontString(nil, "ARTWORK", "NumberFontNormalSmall")
0
+ count:SetPoint("BOTTOMRIGHT", icon, "BOTTOMRIGHT", -2, 2)
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
+ epicframe = CreateFrame("Frame", nil, UIParent)
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
+ f:SetPoint("TOPLEFT", epicframe, "TOPLEFT", HGAP, -HGAP)
0
+ f:SetPoint("TOPLEFT", rowanchor, "BOTTOMLEFT", 0, VGAP)
0
+ lastframe = SetupFrame(f, rawid)
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
+ local b = CreateFrame("Button", nil, epicframe, "SecureActionButtonTemplate")
0
+ b:SetPoint("TOPRIGHT", epicframe, "BOTTOMRIGHT", 4, -3)
0
+ b:SetWidth(80) b:SetHeight(22)
0
+ b:SetDisabledFontObject(GameFontDisable)
0
+ b:SetHighlightFontObject(GameFontHighlight)
0
+ b:SetTextFontObject(GameFontNormal)
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
+ b:SetAttribute("type", "macro")
0
+ b:SetAttribute("macrotext", "/run CloseTradeSkill()\n/cast Jewelcrafting\n/run CloseTradeSkill()")
0
+ epicframe:SetScript("OnShow", function()
0
+ self:RegisterEvent("BAG_UPDATE", "GemCutBagUpdate")
0
+ self:GemCutBagUpdate()
0
+ epicframe:SetScript("OnHide", function() self:UnregisterEvent("BAG_UPDATE") end)
0
+--~ self:RegisterEvent("BAG_UPDATE", "GemCutBagUpdate")
0
+--~ self:GemCutBagUpdate()
0
+ self.CreateCutGreenBluePanel = nil -- Don't need this function anymore!
0
function Panda:TRADE_SKILL_SHOW()
0
for i=1,GetNumTradeSkills() do
0
local name, rowtype = GetTradeSkillInfo(i)
Comments
No one has commented yet.