-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInterfaceOptions.lua
More file actions
159 lines (155 loc) · 6.03 KB
/
InterfaceOptions.lua
File metadata and controls
159 lines (155 loc) · 6.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
PAYDAY_DEFAULT_MESSAGES = {
on2ndHighTie = {
text = "We got another high tie!",
desc = "Printed on 2nd time a high tie occurs."
},
on2ndLowTie = {
text = "We got another low tie!",
desc = "Printed on 2nd time a low tie occurs."
},
onAlsoLowTie = {
text = "There is also a low tie!",
desc = "Printed when a low tie occurs after a high tie."
},
onHighTie = {
text = "There is a high tie!",
desc = "Printed on a high tie occurs."
},
onLastCall = {
text = "Last call to join honkies.",
desc = "Printed when you press the last call button."
},
onLowTie = {
text = "There is a low tie!",
desc = "Printed when a low tie occurs."
},
onMatchComplete = {
text = "Match complete.",
desc = "Printed on match complete."
},
onMatchCompleteOwe = {
text = "HOoO MAN! %s owes %d gold to %s!",
desc = "This is the message that shows who owes who.\r\nMust contain 2 %s and 1 %d."
},
onMatchEnd = {
text = "Ending this match.",
desc = "This is printed when you end a match early."
},
onStandoff = {
text = "We got ourselves a standoff, ffs. Everybody roll again.",
desc = "Printed when gamblers all have the same roll."
},
onStartRoll = {
text = "We rollin (%d to %d)!",
desc = "Printed at the start of rolling. This means the join phase is complete."
},
askToRoll = {
text = "The following gamblers need to roll:",
desc = "Printed when you request the list of gamblers you are waiting on."
},
header = {
text = "[PD] ",
desc = "Printed in front of every Pay Day message."
},
join = {
text = "Type 1 to join or -1 to leave.",
desc = "This is printed when you start a match. It indicates you are in the join phase."
},
rollingToFrom = {
text = "Rolling from %d to %d.",
desc = "When you start the match this indicated the min and max of the match. Must contain 2 %d."
}
}
function PayDayCreateMessagesFrame(messages)
-- This is the equivalent XML.
--
-- <EditBox name="$parent2ndHighTie" inherits="InputBoxTemplate" hidden="false" autoFocus="false" letters="100" enableKeyboard="true" enableMouse="true">
-- <Size x="300" y="26"/>
-- <Anchors>
-- <Anchor point="TOPLEFT" relativeTo="PayDayInterfaceOptionsMessagesSubText" relativePoint="BOTTOMLEFT">
-- <Offset>
-- <AbsDimension x="0" y="-20"/>
-- </Offset>
-- </Anchor>
-- </Anchors>
-- <Layers>
-- <Layer level="OVERLAY">
-- <FontString name="$parentText" inherits="GameFontWhite" justifyH="LEFT" text="Printed on 2nd time a high tie occurs.">
-- <Anchors>
-- <Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT" x="-5" y="0"/>
-- </Anchors>
-- </FontString>
-- </Layer>
-- </Layers>
-- <FontString inherits="ChatFontNormal"/>
-- </EditBox>
-- local scrollChild = CreateFrame("ScrollChild", nil, PayDayInterfaceOptionsMessagesScrollFrame)
local containerFrame = CreateFrame("Frame", "PayDayInterfaceOptionsMessages", PayDayInterfaceOptionsMessagesScrollFrame)
containerFrame:SetWidth(100)
containerFrame:SetHeight(150)
containerFrame:ClearAllPoints()
containerFrame:SetPoint("TOPLEFT", 50, 0)
containerFrame.title = containerFrame:CreateFontString("PayDayInterfaceOptionsMessagesTitle", "OVERLAY", "GameFontNormalLarge")
containerFrame.title:SetPoint("TOPLEFT", 0, 0)
containerFrame.title:SetText("Messages")
containerFrame.subText = containerFrame:CreateFontString("PayDayInterfaceOptionsMessagesSubText", "OVERLAY", "GameFontHighlightSmall")
containerFrame.subText:SetPoint("TOPLEFT", "PayDayInterfaceOptionsMessagesTitle", "BOTTOMLEFT", 0, 0)
containerFrame.subText:SetText("Change the messages Pay Day prints in the following form.")
-- containerFrame.subText:SetHeight(30)
local lastEditBox = containerFrame.subText;
for k, v in pairs(messages) do
local editBox = CreateFrame("EditBox", k.."EditBox", containerFrame, "InputBoxTemplate")
-- LayoutFrame
editBox.title = editBox:CreateFontString(k.."Title", "OVERLAY", "GameFontWhite") -- agrcwow 166
editBox.title:SetPoint("TOPLEFT", 0, 0)
editBox.title:SetText(v.desc)
-- Frame
editBox:EnableKeyboard(true)
editBox:EnableMouse(true)
editBox:SetPoint("TOPLEFT", lastEditBox, "BOTTOMLEFT", 0, -20) -- https://wow.gamepedia.com/API_Region_SetPoint
editBox:SetWidth(300)
editBox:SetHeight(40)
-- EditBox
editBox:SetMaxLetters(100)
editBox:SetAutoFocus(false)
editBox:SetText(v.text)
editBox:SetCursorPosition(0)
lastEditBox = editBox
end
PayDayInterfaceOptionsMessagesScrollFrame:SetScrollChild(containerFrame)
end
function PayDayCreateMessagesFrame(messages)
local containerFrame = CreateFrame("Frame", "ScrollFrameTestMessages")
containerFrame:SetWidth(100)
containerFrame:SetHeight(150)
containerFrame:ClearAllPoints()
containerFrame:SetPoint("TOPLEFT", 50, 0)
containerFrame.title = containerFrame:CreateFontString("ScrollFrameTestMessagesTitle", "OVERLAY", "GameFontNormalLarge")
containerFrame.title:SetPoint("TOPLEFT", 0, 0)
containerFrame.title:SetText("Messages")
containerFrame.subText = containerFrame:CreateFontString("ScrollFrameTestMessagesSubText", "OVERLAY", "GameFontHighlightSmall")
containerFrame.subText:SetPoint("TOPLEFT", "ScrollFrameTestMessagesTitle", "BOTTOMLEFT", 0, 0)
containerFrame.subText:SetText("Change the messages Pay Day prints in the following form.")
-- containerFrame.subText:SetHeight(30)
local lastEditBox = containerFrame.subText;
for k, v in pairs(messages) do
local editBox = CreateFrame("EditBox", k.."EditBox", containerFrame, "InputBoxTemplate")
-- LayoutFrame
editBox.title = editBox:CreateFontString(k.."Title", "OVERLAY", "GameFontWhite") -- agrcwow 166
editBox.title:SetPoint("TOPLEFT", 0, 0)
editBox.title:SetText(v.desc)
-- Frame
editBox:EnableKeyboard(true)
editBox:EnableMouse(true)
editBox:SetPoint("TOPLEFT", lastEditBox, "BOTTOMLEFT", 0, -20) -- https://wow.gamepedia.com/API_Region_SetPoint
editBox:SetWidth(300)
editBox:SetHeight(40)
-- EditBox
editBox:SetMaxLetters(100)
editBox:SetAutoFocus(false)
editBox:SetText(v.text)
editBox:SetCursorPosition(0)
lastEditBox = editBox
end
ScrollFrameTest:SetScrollChild(containerFrame)
end