adam@0
|
1 local _, AskMrRobot = ...
|
yellowfive@11
|
2 local L = AskMrRobot.L;
|
adam@0
|
3
|
adam@0
|
4 -- initialize the HelpTab class
|
adam@0
|
5 AskMrRobot.HelpTab = AskMrRobot.inheritsFrom(AskMrRobot.Frame)
|
adam@0
|
6
|
adam@0
|
7 function AskMrRobot.HelpTab:new(parent)
|
adam@0
|
8
|
adam@0
|
9 local tab = AskMrRobot.Frame:new(nil, parent)
|
adam@0
|
10 setmetatable(tab, { __index = AskMrRobot.HelpTab })
|
adam@0
|
11 tab:SetPoint("TOPLEFT")
|
adam@0
|
12 tab:SetPoint("BOTTOMRIGHT")
|
adam@0
|
13 tab:Hide()
|
adam@0
|
14
|
adam@0
|
15 local text = tab:CreateFontString("AmrHelpText1", "ARTWORK", "GameFontNormalLarge")
|
adam@0
|
16 text:SetPoint("TOPLEFT", 0, -5)
|
yellowfive@11
|
17 text:SetText(L.AMR_HELPTAB_TITLE)
|
adam@0
|
18
|
adam@0
|
19 local text2 = tab:CreateFontString(nil, "ARTWORK", "GameFontWhite")
|
adam@17
|
20 text2:SetPoint("TOPLEFT", text, "BOTTOMLEFT", 0, -10)
|
adam@17
|
21 text2:SetPoint("RIGHT", tab, "RIGHT", -25, -8)
|
adam@0
|
22 text2:SetWidth(text2:GetWidth())
|
adam@0
|
23 text2:SetJustifyH("LEFT")
|
adam@17
|
24 text2:SetText(L.AMR_HELPTAB_LINK)
|
adam@17
|
25
|
adam@17
|
26 local answer = text2
|
adam@17
|
27 for i = 1, 6 do
|
adam@17
|
28 text = AskMrRobot.FontString:new(tab, nil, "ARTWORK", "GameFontWhite")
|
adam@17
|
29 text:SetPoint("TOPLEFT", answer, "BOTTOMLEFT", 0, -11)
|
adam@17
|
30 text:SetPoint("RIGHT", -18, 0)
|
adam@17
|
31 text:SetWidth(text2:GetWidth())
|
adam@17
|
32 text:SetJustifyH("LEFT")
|
adam@17
|
33 text:SetText(L['AMR_HELPTAB_Q' .. i])
|
adam@17
|
34 text:IncreaseFontSize(1)
|
adam@17
|
35 text:SetTextColor(1,1,1)
|
adam@17
|
36
|
adam@17
|
37 answer = tab:CreateFontString(nil, "ARTWORK", "GameFontWhite")
|
adam@17
|
38 answer:SetPoint("TOPLEFT", text, "BOTTOMLEFT", 0, -4)
|
adam@17
|
39 answer:SetPoint("RIGHT", tab, "RIGHT", -18, 0)
|
adam@17
|
40 answer:SetWidth(text2:GetWidth())
|
adam@17
|
41 answer:SetJustifyH("LEFT")
|
adam@17
|
42 answer:SetText(L['AMR_HELPTAB_A' .. i])
|
adam@17
|
43 answer:SetTextColor(0.7,0.7,0.7)
|
adam@17
|
44 end
|
adam@0
|
45
|
adam@0
|
46 return tab
|
adam@0
|
47 end |