Mercurial > wow > askmrrobot
comparison ui/ImportTab.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 -- initialize the ImportTab class | 4 -- initialize the ImportTab class |
| 4 AskMrRobot.ImportTab = AskMrRobot.inheritsFrom(AskMrRobot.Frame) | 5 AskMrRobot.ImportTab = AskMrRobot.inheritsFrom(AskMrRobot.Frame) |
| 5 | 6 |
| 6 function AskMrRobot.ImportTab:new(parent) | 7 function AskMrRobot.ImportTab:new(parent) |
| 12 tab:Hide() | 13 tab:Hide() |
| 13 | 14 |
| 14 -- import button | 15 -- import button |
| 15 tab.button = CreateFrame("Button", "AmrImportButton", tab, "UIPanelButtonTemplate") | 16 tab.button = CreateFrame("Button", "AmrImportButton", tab, "UIPanelButtonTemplate") |
| 16 tab.button:SetPoint("BOTTOM") | 17 tab.button:SetPoint("BOTTOM") |
| 17 tab.button:SetText("Import!") | 18 tab.button:SetText(L.AMR_IMPORTTAB_BUTTON) |
| 18 tab.button:SetWidth(100) | 19 tab.button:SetWidth(100) |
| 19 tab.button:SetHeight(20) | 20 tab.button:SetHeight(20) |
| 20 tab.button:SetPoint("BOTTOM", 0, 15) | 21 tab.button:SetPoint("BOTTOM", 0, 15) |
| 21 | 22 |
| 22 local text = tab:CreateFontString("AmrImportText1", "ARTWORK", "GameFontNormalLarge") | 23 local text = tab:CreateFontString("AmrImportText1", "ARTWORK", "GameFontNormalLarge") |
| 23 text:SetPoint("TOPLEFT", 0, -5) | 24 text:SetPoint("TOPLEFT", 0, -5) |
| 24 text:SetFormattedText("Import Mr. Robot's optimizations") | 25 text:SetFormattedText(L.AMR_IMPORTTAB_TITLE) |
| 25 | 26 |
| 26 text = tab:CreateFontString("AmrImportText2", "ARTWORK", "GameFontWhite") | 27 text = tab:CreateFontString("AmrImportText2", "ARTWORK", "GameFontWhite") |
| 27 text:SetPoint("TOPLEFT", "AmrImportText1", "BOTTOMLEFT", 0, -20) | 28 text:SetPoint("TOPLEFT", "AmrImportText1", "BOTTOMLEFT", 0, -20) |
| 28 text:SetPoint("RIGHT", 0, -20) | 29 text:SetPoint("RIGHT", 0, -20) |
| 29 text:SetWidth(text:GetWidth()) | 30 text:SetWidth(text:GetWidth()) |
| 30 text:SetJustifyH("LEFT") | 31 text:SetJustifyH("LEFT") |
| 31 text:SetText("1. Go to our website, optimize, then click the 'export to addon' button found just above the stats section.") | 32 text:SetText(L.AMR_IMPORTTAB_INSTRUCTIONS_1) |
| 32 | 33 |
| 33 local image = tab:CreateTexture(nil, "BACKGROUND") | 34 local image = tab:CreateTexture(nil, "BACKGROUND") |
| 34 image:SetPoint("TOPLEFT", text, "BOTTOMLEFT", 16, -10) | 35 image:SetPoint("TOPLEFT", text, "BOTTOMLEFT", 16, -10) |
| 35 image:SetTexture("Interface\\AddOns\\AskMrRobot\\Media\\AddonExport") | 36 image:SetTexture("Interface\\AddOns\\AskMrRobot\\Media\\AddonExport") |
| 36 image:SetSize(256, 256) | 37 image:SetSize(256, 256) |
| 38 text = tab:CreateFontString("AmrImportText3", "ARTWORK", "GameFontWhite") | 39 text = tab:CreateFontString("AmrImportText3", "ARTWORK", "GameFontWhite") |
| 39 text:SetPoint("TOPLEFT", image, "BOTTOMLEFT", -16, 24) | 40 text:SetPoint("TOPLEFT", image, "BOTTOMLEFT", -16, 24) |
| 40 text:SetPoint("RIGHT", -15, 40) | 41 text:SetPoint("RIGHT", -15, 40) |
| 41 text:SetWidth(text:GetWidth()) | 42 text:SetWidth(text:GetWidth()) |
| 42 text:SetJustifyH("LEFT") | 43 text:SetJustifyH("LEFT") |
| 43 text:SetText("2. A window will popup, copy the text from that window.\r\r3. Return here and paste the text into the window below. To paste it, hold ctrl + v, or on a mac apple + v.\r\r4. Click the 'Import' button below") | 44 text:SetText(L.AMR_IMPORTTAB_INSTRUCTIONS_2) |
| 44 | 45 |
| 45 local scrollFrame = CreateFrame("ScrollFrame", "AmrImportScrollFrame", tab, "InputScrollFrameTemplate") | 46 local scrollFrame = CreateFrame("ScrollFrame", "AmrImportScrollFrame", tab, "InputScrollFrameTemplate") |
| 46 scrollFrame:SetPoint("TOPLEFT", text, "BOTTOMLEFT", 5, -10) | 47 scrollFrame:SetPoint("TOPLEFT", text, "BOTTOMLEFT", 5, -10) |
| 47 scrollFrame:SetPoint("BOTTOM", "AmrImportButton", "TOP", 0, 10) | 48 scrollFrame:SetPoint("BOTTOM", "AmrImportButton", "TOP", 0, 10) |
| 48 scrollFrame:SetPoint("RIGHT", -30, 0) | 49 scrollFrame:SetPoint("RIGHT", -30, 0) |
| 49 scrollFrame:SetWidth(430) | 50 scrollFrame:SetWidth(430) |
| 50 scrollFrame.EditBox:SetWidth(scrollFrame:GetWidth()) | 51 scrollFrame.EditBox:SetWidth(scrollFrame:GetWidth()) |
| 51 scrollFrame.EditBox:SetMaxLetters(1100) | 52 scrollFrame.EditBox:SetMaxLetters(1100) |
| 52 scrollFrame.CharCount:Hide() | 53 scrollFrame.CharCount:Hide() |
| 53 scrollFrame.EditBox.PromptText:SetText("Paste text from AskMrRobot.com here.") | 54 scrollFrame.EditBox.PromptText:SetText(L.AMR_IMPORTTAB_INSTRUCTIONS_3) |
| 54 scrollFrame.EditBox:SetFocus() | 55 scrollFrame.EditBox:SetFocus() |
| 55 scrollFrame.EditBox:HighlightText() | 56 scrollFrame.EditBox:HighlightText() |
| 56 tab.scrollFrame = scrollFrame | 57 tab.scrollFrame = scrollFrame |
| 57 | 58 |
| 58 tab:SetScript("OnShow", function() | 59 tab:SetScript("OnShow", function() |
