comparison ui/ExportTab.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 ExportTab class 4 -- initialize the ExportTab class
4 AskMrRobot.ExportTab = AskMrRobot.inheritsFrom(AskMrRobot.Frame) 5 AskMrRobot.ExportTab = AskMrRobot.inheritsFrom(AskMrRobot.Frame)
5 6
6 -- helper to create text for this tab 7 -- helper to create text for this tab
31 tab.manualElements = {} 32 tab.manualElements = {}
32 tab.autoElements = {} 33 tab.autoElements = {}
33 34
34 local text = tab:CreateFontString(nil, "ARTWORK", "GameFontNormalLarge") 35 local text = tab:CreateFontString(nil, "ARTWORK", "GameFontNormalLarge")
35 text:SetPoint("TOPLEFT", 0, -5) 36 text:SetPoint("TOPLEFT", 0, -5)
36 text:SetText("Export Gear for Best in Bags") 37 text:SetText(L.AMR_EXPORTTAB_EXPORT_BB)
37 38
38 local chooseText = CreateText(nil, tab, "GameFontWhite", text, 0, -15, "Choose a method:") 39 local chooseText = CreateText(nil, tab, "GameFontWhite", text, 0, -15, "Choose a method:")
39 chooseText:SetJustifyV("MIDDLE") 40 chooseText:SetJustifyV("MIDDLE")
40 chooseText:SetHeight(30) 41 chooseText:SetHeight(30)
41 42
42 local btn = CreateFrame("Button", "AmrExportManual", tab, "UIPanelButtonTemplate") 43 local btn = CreateFrame("Button", "AmrExportManual", tab, "UIPanelButtonTemplate")
43 btn:SetPoint("TOPLEFT", text, "BOTTOMLEFT", 125, -15) 44 btn:SetPoint("TOPLEFT", text, "BOTTOMLEFT", 125, -15)
44 btn:SetText("Copy/Paste") 45 btn:SetText(L.AMR_EXPORTTAB_COPY_PASTE)
45 btn:SetWidth(120) 46 btn:SetWidth(120)
46 btn:SetHeight(30) 47 btn:SetHeight(30)
47 tab.btnManual = btn 48 tab.btnManual = btn
48 49
49 btn:SetScript("OnClick", function() 50 btn:SetScript("OnClick", function()
51 tab:Update() 52 tab:Update()
52 end) 53 end)
53 54
54 btn = CreateFrame("Button", "AmrExportAuto", tab, "UIPanelButtonTemplate") 55 btn = CreateFrame("Button", "AmrExportAuto", tab, "UIPanelButtonTemplate")
55 btn:SetPoint("TOPLEFT", text, "BOTTOMLEFT", 275, -15) 56 btn:SetPoint("TOPLEFT", text, "BOTTOMLEFT", 275, -15)
56 btn:SetText("AMR Client") 57 btn:SetText(L.AMR_EXPORTTAB_AMR_CLIENT)
57 btn:SetWidth(120) 58 btn:SetWidth(120)
58 btn:SetHeight(30) 59 btn:SetHeight(30)
59 tab.btnAuto = btn 60 tab.btnAuto = btn
60 61
61 btn:SetScript("OnClick", function() 62 btn:SetScript("OnClick", function()
62 AmrOptions.exportToClient = true 63 AmrOptions.exportToClient = true
63 tab:Update() 64 tab:Update()
64 end) 65 end)
65 66
66 -- copy/paste 67 -- copy/paste
67 text = CreateText(tab.manualElements, tab, "GameFontNormalLarge", chooseText, 0, -20, "COPY/PASTE EXPORT") 68 text = CreateText(tab.manualElements, tab, "GameFontNormalLarge", chooseText, 0, -20, L.AMR_EXPORTTAB_COPY_PASTE_EXPORT)
68 local text2 = CreateText(tab.manualElements, tab, "GameFontWhite", text, 0, -15, "1. Open your bank") 69 local text2 = CreateText(tab.manualElements, tab, "GameFontWhite", text, 0, -15, L.AMR_EXPORTTAB_COPY_PASTE_EXPORT_1)
69 text = CreateText(tab.manualElements, tab, "GameFontWhite", text2, 0, -15, "2. Copy the text below by pressing Ctrl+C (or Cmd+C on a Mac)") 70 text = CreateText(tab.manualElements, tab, "GameFontWhite", text2, 0, -15, L.AMR_EXPORTTAB_COPY_PASTE_EXPORT_2)
70 71
71 local txtExportString = CreateFrame("ScrollFrame", "AmrScrollFrame", tab, "InputScrollFrameTemplate") 72 local txtExportString = CreateFrame("ScrollFrame", "AmrScrollFrame", tab, "InputScrollFrameTemplate")
72 txtExportString:SetPoint("TOPLEFT", text, "BOTTOMLEFT", 12, -10) 73 txtExportString:SetPoint("TOPLEFT", text, "BOTTOMLEFT", 12, -10)
73 txtExportString:SetPoint("RIGHT", -25, 0) 74 txtExportString:SetPoint("RIGHT", -25, 0)
74 txtExportString:SetWidth(txtExportString:GetWidth()) 75 txtExportString:SetWidth(txtExportString:GetWidth())
81 82
82 txtExportString.EditBox:SetScript("OnEscapePressed", function() 83 txtExportString.EditBox:SetScript("OnEscapePressed", function()
83 AskMrRobot_ReforgeFrame:Hide() 84 AskMrRobot_ReforgeFrame:Hide()
84 end) 85 end)
85 86
86 text = CreateText(tab.manualElements, tab, "GameFontWhite", txtExportString, -12, -20, "3. Go to AskMrRobot.com and paste into the IMPORT window") 87 text = CreateText(tab.manualElements, tab, "GameFontWhite", txtExportString, -12, -20, L.AMR_EXPORTTAB_COPY_PASTE_EXPORT_3)
87 text2 = CreateText(tab.manualElements, tab, "GameFontWhite", text, 10, -5, "(located to the right of your character name near the top of the web page, see screenshot)") 88 text2 = CreateText(tab.manualElements, tab, "GameFontWhite", text, 10, -5, L.AMR_EXPORTTAB_COPY_PASTE_EXPORT_4)
88 89
89 local image = tab:CreateTexture(nil, "BACKGROUND") 90 local image = tab:CreateTexture(nil, "BACKGROUND")
90 image:SetPoint("TOPLEFT", text2, "BOTTOMLEFT", 2, -10) 91 image:SetPoint("TOPLEFT", text2, "BOTTOMLEFT", 2, -10)
91 image:SetTexture("Interface\\AddOns\\AskMrRobot\\Media\\BiBScreen") 92 image:SetTexture("Interface\\AddOns\\AskMrRobot\\Media\\BiBScreen")
92 table.insert(tab.manualElements, image) 93 table.insert(tab.manualElements, image)
93 94
94 text = CreateText(tab.manualElements, tab, "GameFontWhite", text2, 0, -120, "NOTE: If you change something while this window is open, press the Update button below to generate a new export string.") 95 text = CreateText(tab.manualElements, tab, "GameFontWhite", text2, 0, -120, L.AMR_EXPORTTAB_COPY_PASTE_EXPORT_NOTE)
95 96
96 btn = CreateFrame("Button", "AmrUpdateExportString", tab, "UIPanelButtonTemplate") 97 btn = CreateFrame("Button", "AmrUpdateExportString", tab, "UIPanelButtonTemplate")
97 btn:SetPoint("TOPLEFT", text, "BOTTOMLEFT", 0, -5) 98 btn:SetPoint("TOPLEFT", text, "BOTTOMLEFT", 0, -5)
98 btn:SetText("Update") 99 btn:SetText("Update")
99 btn:SetWidth(120) 100 btn:SetWidth(120)
103 btn:SetScript("OnClick", function() 104 btn:SetScript("OnClick", function()
104 tab:Update() 105 tab:Update()
105 end) 106 end)
106 107
107 -- amr client 108 -- amr client
108 text = CreateText(tab.autoElements, tab, "GameFontNormalLarge", chooseText, 0, -20, "AMR CLIENT EXPORT") 109 text = CreateText(tab.autoElements, tab, "GameFontNormalLarge", chooseText, 0, -20, L.AMR_EXPORTTAB_AMR_CLIENT_EXPORT)
109 text2 = CreateText(tab.autoElements, tab, "GameFontWhite", text, 0, -15, "1. Open your bank") 110 text2 = CreateText(tab.autoElements, tab, "GameFontWhite", text, 0, -15, L.AMR_EXPORTTAB_AMR_CLIENT_EXPORT_1)
110 text = CreateText(tab.autoElements, tab, "GameFontWhite", text2, 0, -15, "2. Press the button below to update your AskMrRobot.lua file") 111 text = CreateText(tab.autoElements, tab, "GameFontWhite", text2, 0, -15, L.AMR_EXPORTTAB_AMR_CLIENT_EXPORT_2)
111 112
112 btn = CreateFrame("Button", "AmrExportFile", tab, "UIPanelButtonTemplate") 113 btn = CreateFrame("Button", "AmrExportFile", tab, "UIPanelButtonTemplate")
113 btn:SetPoint("TOPLEFT", text, "BOTTOMLEFT", 12, -10) 114 btn:SetPoint("TOPLEFT", text, "BOTTOMLEFT", 12, -10)
114 btn:SetText("Export to File") 115 btn:SetText("Export to File")
115 btn:SetWidth(180) 116 btn:SetWidth(180)
119 btn:SetScript("OnClick", function() 120 btn:SetScript("OnClick", function()
120 AskMrRobot.SaveAll() 121 AskMrRobot.SaveAll()
121 ReloadUI() 122 ReloadUI()
122 end) 123 end)
123 124
124 text = CreateText(tab.autoElements, tab, "GameFontWhite", btn, -12, -20, "3. Go to AskMrRobot.com and press REFRESH") 125 text = CreateText(tab.autoElements, tab, "GameFontWhite", btn, -12, -20, L.AMR_EXPORTTAB_AMR_CLIENT_EXPORT_3)
125 text2 = CreateText(tab.autoElements, tab, "GameFontWhite", text, 10, -5, "(located to the right of your character name near the top of the web page, see screenshot:)") 126 text2 = CreateText(tab.autoElements, tab, "GameFontWhite", text, 10, -5, L.AMR_EXPORTTAB_AMR_CLIENT_EXPORT_4)
126 127
127 image = tab:CreateTexture(nil, "BACKGROUND") 128 image = tab:CreateTexture(nil, "BACKGROUND")
128 image:SetPoint("TOPLEFT", text2, "BOTTOMLEFT", 2, -10) 129 image:SetPoint("TOPLEFT", text2, "BOTTOMLEFT", 2, -10)
129 image:SetTexture("Interface\\AddOns\\AskMrRobot\\Media\\BiBScreen") 130 image:SetTexture("Interface\\AddOns\\AskMrRobot\\Media\\BiBScreen")
130 table.insert(tab.autoElements, image) 131 table.insert(tab.autoElements, image)