Mercurial > wow > askmrrobot
comparison ui/GemTab.lua @ 11:ece9167c0d1c v1.2.14.0
Localization support, combat log features (wipe command, aura/pet tracking, and realm detection).
| author | yellowfive |
|---|---|
| date | Thu, 10 Jul 2014 12:24:59 -0700 |
| parents | ec731d2fe6ba |
| children | e77e01abce98 |
comparison
equal
deleted
inserted
replaced
| 10:ef8b45e96b08 | 11:ece9167c0d1c |
|---|---|
| 1 local _, AskMrRobot = ... | 1 local _, AskMrRobot = ... |
| 2 local L = AskMrRobot.L; | |
| 2 | 3 |
| 3 StaticPopupDialogs["AUTOGEM_FINISHED"] = { | 4 StaticPopupDialogs["AUTOGEM_FINISHED"] = { |
| 4 text = "Mr. Robot finished auto-gemming. \rIf some items aren't gemmed, you may need to acquire more gems. \rIf your belt isn't gemmed, you may still need to buy a belt buckle.", | 5 text = L.AMR_GEMTAB_FINISHED, |
| 5 button1 = "Ok", | 6 button1 = L.AMR_GEMTAB_BUTTON_OK, |
| 6 timeout = 0, | 7 timeout = 0, |
| 7 whileDead = true, | 8 whileDead = true, |
| 8 hideOnEscape = true, | 9 hideOnEscape = true, |
| 9 preferredIndex = 3, -- avoid some UI taint, see http://www.wowace.com/announcements/how-to-avoid-some-ui-taint/ | 10 preferredIndex = 3, -- avoid some UI taint, see http://www.wowace.com/announcements/how-to-avoid-some-ui-taint/ |
| 10 } | 11 } |
| 11 | 12 |
| 12 StaticPopupDialogs["AUTOGEM_ONCE"] = { | 13 StaticPopupDialogs["AUTOGEM_ONCE"] = { |
| 13 text = "Autogemming already in progress.", | 14 text = L.AMR_GEMTAB_AUTOGEMMING_IN_PROGRESS, |
| 14 button1 = "Ok", | 15 button1 = L.AMR_GEMTAB_BUTTON_OK, |
| 15 timeout = 0, | 16 timeout = 0, |
| 16 whileDead = true, | 17 whileDead = true, |
| 17 hideOnEscape = true, | 18 hideOnEscape = true, |
| 18 preferredIndex = 3, -- avoid some UI taint, see http://www.wowace.com/announcements/how-to-avoid-some-ui-taint/ | 19 preferredIndex = 3, -- avoid some UI taint, see http://www.wowace.com/announcements/how-to-avoid-some-ui-taint/ |
| 19 } | 20 } |
| 33 setmetatable(tab, { __index = AskMrRobot.GemTab }) | 34 setmetatable(tab, { __index = AskMrRobot.GemTab }) |
| 34 tab:Hide() | 35 tab:Hide() |
| 35 | 36 |
| 36 local text = tab:CreateFontString("AmrGemsText1", "ARTWORK", "GameFontNormalLarge") | 37 local text = tab:CreateFontString("AmrGemsText1", "ARTWORK", "GameFontNormalLarge") |
| 37 text:SetPoint("TOPLEFT", 0, -5) | 38 text:SetPoint("TOPLEFT", 0, -5) |
| 38 text:SetText("Gems") | 39 text:SetText(L.AMR_GEMTAB_GEMS) |
| 39 | 40 |
| 40 tab.stamp = AskMrRobot.RobotStamp:new(nil, tab) | 41 tab.stamp = AskMrRobot.RobotStamp:new(nil, tab) |
| 41 tab.stamp:Hide() | 42 tab.stamp:Hide() |
| 42 tab.stamp.smallText:SetText("Your gems are 100% optimal! You are truly, truly outrageous.") | 43 tab.stamp.smallText:SetText(L.AMR_GEMTAB_OPTIMAL) |
| 43 tab.stamp:SetPoint("TOPLEFT", text, "BOTTOMLEFT", 2, -15) | 44 tab.stamp:SetPoint("TOPLEFT", text, "BOTTOMLEFT", 2, -15) |
| 44 tab.stamp:SetPoint("RIGHT", tab, "RIGHT", -20, 0) | 45 tab.stamp:SetPoint("RIGHT", tab, "RIGHT", -20, 0) |
| 45 | 46 |
| 46 text = tab:CreateFontString("AmrGemsText2", "ARTWORK", "GameFontWhite") | 47 text = tab:CreateFontString("AmrGemsText2", "ARTWORK", "GameFontWhite") |
| 47 text:SetText("You have X gems to optimize") | 48 text:SetText(L.AMR_GEMTAB_X_OPTIMIZE) |
| 48 text:SetPoint("TOPLEFT", "AmrGemsText1", "BOTTOMLEFT", 0, -20) | 49 text:SetPoint("TOPLEFT", "AmrGemsText1", "BOTTOMLEFT", 0, -20) |
| 49 text:SetWidth(200) | 50 text:SetWidth(200) |
| 50 text:SetJustifyH("LEFT") | 51 text:SetJustifyH("LEFT") |
| 51 tab.gemsTextToOptimize = text | 52 tab.gemsTextToOptimize = text |
| 52 | 53 |
| 53 -- autogem button | 54 -- autogem button |
| 54 tab.button = CreateFrame("Button", "AmrAutoGemButton", tab, "UIPanelButtonTemplate") | 55 tab.button = CreateFrame("Button", "AmrAutoGemButton", tab, "UIPanelButtonTemplate") |
| 55 tab.button:SetPoint("TOP", "AmrGemsText1", "BOTTOM", 0, -16) | 56 tab.button:SetPoint("TOP", "AmrGemsText1", "BOTTOM", 0, -16) |
| 56 tab.button:SetPoint("RIGHT", -40, 0) | 57 tab.button:SetPoint("RIGHT", -40, 0) |
| 57 tab.button:SetText("Auto Gem! (BETA)") | 58 tab.button:SetText(L.AMR_GEMTAB_AUTOGEM_BUTTON) |
| 58 tab.button:SetWidth(150) | 59 tab.button:SetWidth(150) |
| 59 tab.button:SetHeight(20) | 60 tab.button:SetHeight(20) |
| 60 tab.button:SetScript("OnClick", function() tab:startAutoGem() end) | 61 tab.button:SetScript("OnClick", function() tab:startAutoGem() end) |
| 61 tab.button:Hide() | 62 tab.button:Hide() |
| 62 | 63 |
| 65 tab.preferPerfects = true | 66 tab.preferPerfects = true |
| 66 tab.usePerfectButton:SetChecked(tab.preferPerfects) | 67 tab.usePerfectButton:SetChecked(tab.preferPerfects) |
| 67 tab.usePerfectButton:SetPoint("TOPLEFT", "AmrAutoGemButton", "BOTTOMLEFT", 0, -4) | 68 tab.usePerfectButton:SetPoint("TOPLEFT", "AmrAutoGemButton", "BOTTOMLEFT", 0, -4) |
| 68 tab.usePerfectButton:SetScript("OnClick", function () tab.preferPerfects = tab.usePerfectButton:GetChecked() end) | 69 tab.usePerfectButton:SetScript("OnClick", function () tab.preferPerfects = tab.usePerfectButton:GetChecked() end) |
| 69 local text3 = getglobal(tab.usePerfectButton:GetName() .. 'Text') | 70 local text3 = getglobal(tab.usePerfectButton:GetName() .. 'Text') |
| 70 text3:SetText("Prefer Perfect") | 71 text3:SetText(L.AMR_GEMTAB_PREFER_PERFECT) |
| 71 text3:SetWidth(150) | 72 text3:SetWidth(150) |
| 72 text3:SetPoint("TOPLEFT", tab.usePerfectButton, "TOPRIGHT", 2, -4) | 73 text3:SetPoint("TOPLEFT", tab.usePerfectButton, "TOPRIGHT", 2, -4) |
| 73 tab.usePerfectButton:Hide() | 74 tab.usePerfectButton:Hide() |
| 74 | 75 |
| 75 tab.gemSlotHeader = tab:CreateFontString("AmrBadGemSlot0", "ARTWORK", "GameFontNormal") | 76 tab.gemSlotHeader = tab:CreateFontString("AmrBadGemSlot0", "ARTWORK", "GameFontNormal") |
| 76 tab.gemSlotHeader:SetPoint("TOPLEFT", "AmrGemsText2", "BOTTOMLEFT", 0, -20) | 77 tab.gemSlotHeader:SetPoint("TOPLEFT", "AmrGemsText2", "BOTTOMLEFT", 0, -20) |
| 77 tab.gemSlotHeader:SetText("Slot") | 78 tab.gemSlotHeader:SetText(L.AMR_GEMTAB_SLOT) |
| 78 tab.gemSlotHeader:SetWidth(90) | 79 tab.gemSlotHeader:SetWidth(90) |
| 79 tab.gemSlotHeader:SetJustifyH("LEFT") | 80 tab.gemSlotHeader:SetJustifyH("LEFT") |
| 80 tab.gemSlotHeader:Hide() | 81 tab.gemSlotHeader:Hide() |
| 81 tab.gemCurrentHeader = tab:CreateFontString("AmrBadGemCurrent0_1", "ARTWORK", "GameFontNormal") | 82 tab.gemCurrentHeader = tab:CreateFontString("AmrBadGemCurrent0_1", "ARTWORK", "GameFontNormal") |
| 82 tab.gemCurrentHeader:SetPoint("TOPLEFT", "AmrBadGemSlot0", "TOPLEFT", 88, 0) | 83 tab.gemCurrentHeader:SetPoint("TOPLEFT", "AmrBadGemSlot0", "TOPLEFT", 88, 0) |
| 83 tab.gemCurrentHeader:SetWidth(110) | 84 tab.gemCurrentHeader:SetWidth(110) |
| 84 tab.gemCurrentHeader:SetText("Current") | 85 tab.gemCurrentHeader:SetText(L.AMR_GEMTAB_CURRENT) |
| 85 tab.gemCurrentHeader:SetJustifyH("LEFT") | 86 tab.gemCurrentHeader:SetJustifyH("LEFT") |
| 86 tab.gemCurrentHeader:Hide() | 87 tab.gemCurrentHeader:Hide() |
| 87 tab.gemOptimizedHeader = tab:CreateFontString("AmrBadGemOptimized0_1", "ARTWORK", "GameFontNormal") | 88 tab.gemOptimizedHeader = tab:CreateFontString("AmrBadGemOptimized0_1", "ARTWORK", "GameFontNormal") |
| 88 tab.gemOptimizedHeader:SetPoint("TOPLEFT", "AmrBadGemCurrent0_1", "TOPLEFT", 70, 0) | 89 tab.gemOptimizedHeader:SetPoint("TOPLEFT", "AmrBadGemCurrent0_1", "TOPLEFT", 70, 0) |
| 89 tab.gemOptimizedHeader:SetPoint("RIGHT", -30, 0) | 90 tab.gemOptimizedHeader:SetPoint("RIGHT", -30, 0) |
| 90 tab.gemOptimizedHeader:SetText("Optimized") | 91 tab.gemOptimizedHeader:SetText(L.AMR_GEMTAB_OPTIMIZED) |
| 91 tab.gemOptimizedHeader:SetJustifyH("LEFT") | 92 tab.gemOptimizedHeader:SetJustifyH("LEFT") |
| 92 tab.gemOptimizedHeader:Hide() | 93 tab.gemOptimizedHeader:Hide() |
| 93 | 94 |
| 94 tab.fauxScroll = CreateFrame("ScrollFrame", "testme", tab, "FauxScrollFrameTemplate") | 95 tab.fauxScroll = CreateFrame("ScrollFrame", "testme", tab, "FauxScrollFrameTemplate") |
| 95 tab.fauxScroll:SetPoint("BOTTOMRIGHT", -40, 15) | 96 tab.fauxScroll:SetPoint("BOTTOMRIGHT", -40, 15) |
| 136 end | 137 end |
| 137 i = i + 1 | 138 i = i + 1 |
| 138 end | 139 end |
| 139 end | 140 end |
| 140 | 141 |
| 141 self.gemsTextToOptimize:SetFormattedText("You have %d \1244gem:gems; to optimize", badGemTotal) | 142 self.gemsTextToOptimize:SetFormattedText(L.AMR_GEMTAB_TO_OPTIMIZE, badGemTotal) |
| 142 | 143 |
| 143 --hide/show the headers, depending on if we have any bad gems | 144 --hide/show the headers, depending on if we have any bad gems |
| 144 if self.count == 0 then | 145 if self.count == 0 then |
| 145 self.gemSlotHeader:Hide() | 146 self.gemSlotHeader:Hide() |
| 146 self.gemCurrentHeader:Hide() | 147 self.gemCurrentHeader:Hide() |
