1 |
72 |
Kragenwar-3044 |
import "Turbine.UI"; |
2 |
|
Kragenwar-3044 |
|
3 |
|
Kragenwar-3044 |
SetupFeatures = class(Turbine.UI.ListBox); |
4 |
|
Kragenwar-3044 |
|
5 |
|
Kragenwar-3044 |
-- helper functions |
6 |
|
Kragenwar-3044 |
local tt = function(width, height, control, text) |
7 |
|
Kragenwar-3044 |
local tooltip = KragenPlugs.UI.Tooltip(); |
8 |
|
Kragenwar-3044 |
tooltip:SetText(text); |
9 |
|
Kragenwar-3044 |
tooltip:SetControl(control); |
10 |
|
Kragenwar-3044 |
tooltip:SetSize(width, height); |
11 |
|
Kragenwar-3044 |
end |
12 |
|
Kragenwar-3044 |
|
13 |
|
Kragenwar-3044 |
local holder = function(parent, height) |
14 |
|
Kragenwar-3044 |
local container = Turbine.UI.Control(); |
15 |
|
Kragenwar-3044 |
container:SetSize(400, height); |
16 |
|
Kragenwar-3044 |
parent:AddItem(container); |
17 |
|
Kragenwar-3044 |
return container; |
18 |
|
Kragenwar-3044 |
end |
19 |
|
Kragenwar-3044 |
|
20 |
|
Kragenwar-3044 |
local setShortcut = function(quickslot, shortcutType, shortcutData) |
21 |
|
Kragenwar-3044 |
local setter = function() |
22 |
|
Kragenwar-3044 |
if (shortcutData ~= "") then |
23 |
|
Kragenwar-3044 |
local shortcut = Turbine.UI.Lotro.Shortcut(shortcutType, shortcutData); |
24 |
|
Kragenwar-3044 |
quickslot:SetShortcut(shortcut); |
25 |
|
Kragenwar-3044 |
else |
26 |
|
Kragenwar-3044 |
quickslot:SetShortcut(nil); |
27 |
|
Kragenwar-3044 |
end |
28 |
|
Kragenwar-3044 |
end |
29 |
|
Kragenwar-3044 |
|
30 |
|
Kragenwar-3044 |
if (not pcall(setter)) then |
31 |
|
Kragenwar-3044 |
quickslot:SetShortcut(nil); |
32 |
|
Kragenwar-3044 |
end |
33 |
|
Kragenwar-3044 |
end |
34 |
|
Kragenwar-3044 |
|
35 |
|
Kragenwar-3044 |
function SetupFeatures:Constructor() |
36 |
|
Kragenwar-3044 |
Turbine.UI.ListBox.Constructor(self); |
37 |
|
Kragenwar-3044 |
|
38 |
|
Kragenwar-3044 |
self.current = nil; |
39 |
|
Kragenwar-3044 |
|
40 |
|
Kragenwar-3044 |
self:SetOrientation(Turbine.UI.Orientation.Horizontal); |
41 |
|
Kragenwar-3044 |
self:SetMaxItemsPerLine(1); |
42 |
|
Kragenwar-3044 |
|
43 |
|
Kragenwar-3044 |
local line = holder(self, 35); |
44 |
|
Kragenwar-3044 |
self.titleTraits = KragenPlugs.UI.PanelDivider(); |
45 |
|
Kragenwar-3044 |
self.titleTraits:SetPosition(0,0); |
46 |
|
Kragenwar-3044 |
self.titleTraits:SetParent(line); |
47 |
|
Kragenwar-3044 |
self.titleTraits:SetText("Traits"); |
48 |
|
Kragenwar-3044 |
self.titleTraits:SetSize(400, 30); |
49 |
|
Kragenwar-3044 |
|
50 |
|
Kragenwar-3044 |
line = holder(self, 20); |
51 |
|
Kragenwar-3044 |
self.checkboxf1 = KragenPlugs.UI.CheckBox(); |
52 |
|
Kragenwar-3044 |
self.checkboxf1:SetParent(line); |
53 |
|
Kragenwar-3044 |
self.checkboxf1:SetSize(180, 20); |
54 |
|
Kragenwar-3044 |
self.checkboxf1:SetPosition(0,0); |
55 |
|
Kragenwar-3044 |
self.checkboxf1:SetText("Checkboxf1"); |
56 |
|
Kragenwar-3044 |
self.checkboxf1:SetVisible(false); |
57 |
|
Kragenwar-3044 |
-- tt(420, 19, self.Checkboxf1, "When checked, the disease quickslot will be shown."); |
58 |
|
Kragenwar-3044 |
|
59 |
|
Kragenwar-3044 |
self.checkboxf2 = KragenPlugs.UI.CheckBox(); |
60 |
|
Kragenwar-3044 |
self.checkboxf2:SetParent(line); |
61 |
|
Kragenwar-3044 |
self.checkboxf2:SetSize(180,20); |
62 |
|
Kragenwar-3044 |
self.checkboxf2:SetPosition(220,0); |
63 |
|
Kragenwar-3044 |
self.checkboxf2:AlignLeft(true); |
64 |
|
Kragenwar-3044 |
self.checkboxf2:SetText("Checkboxf2"); |
65 |
|
Kragenwar-3044 |
self.checkboxf2:SetVisible(false); |
66 |
|
Kragenwar-3044 |
|
67 |
|
Kragenwar-3044 |
line = holder(self, 20); |
68 |
|
Kragenwar-3044 |
self.checkboxf3 = KragenPlugs.UI.CheckBox(); |
69 |
|
Kragenwar-3044 |
self.checkboxf3:SetParent(line); |
70 |
|
Kragenwar-3044 |
self.checkboxf3:SetSize(180, 20); |
71 |
|
Kragenwar-3044 |
self.checkboxf3:SetPosition(0,0); |
72 |
|
Kragenwar-3044 |
self.checkboxf3:SetText("Checkboxf3"); |
73 |
|
Kragenwar-3044 |
self.checkboxf3:SetVisible(false); |
74 |
|
Kragenwar-3044 |
|
75 |
|
Kragenwar-3044 |
self.checkboxf4 = KragenPlugs.UI.CheckBox(); |
76 |
|
Kragenwar-3044 |
self.checkboxf4:SetParent(line); |
77 |
|
Kragenwar-3044 |
self.checkboxf4:SetSize(180,20); |
78 |
|
Kragenwar-3044 |
self.checkboxf4:SetPosition(220,0); |
79 |
|
Kragenwar-3044 |
self.checkboxf4:AlignLeft(true); |
80 |
|
Kragenwar-3044 |
self.checkboxf4:SetText("Checkboxf4"); |
81 |
|
Kragenwar-3044 |
self.checkboxf4:SetVisible(false); |
82 |
|
Kragenwar-3044 |
|
83 |
|
Kragenwar-3044 |
line = holder(self, 20); |
84 |
|
Kragenwar-3044 |
self.checkboxf5 = KragenPlugs.UI.CheckBox(); |
85 |
|
Kragenwar-3044 |
self.checkboxf5:SetParent(line); |
86 |
|
Kragenwar-3044 |
self.checkboxf5:SetSize(180, 20); |
87 |
|
Kragenwar-3044 |
self.checkboxf5:SetPosition(0,0); |
88 |
|
Kragenwar-3044 |
self.checkboxf5:SetText("Checkboxf5"); |
89 |
|
Kragenwar-3044 |
self.checkboxf5:SetVisible(false); |
90 |
|
Kragenwar-3044 |
|
91 |
|
Kragenwar-3044 |
self.checkboxf6 = KragenPlugs.UI.CheckBox(); |
92 |
|
Kragenwar-3044 |
self.checkboxf6:SetParent(line); |
93 |
|
Kragenwar-3044 |
self.checkboxf6:SetSize(180,20); |
94 |
|
Kragenwar-3044 |
self.checkboxf6:SetPosition(220,0); |
95 |
|
Kragenwar-3044 |
self.checkboxf6:AlignLeft(true); |
96 |
|
Kragenwar-3044 |
self.checkboxf6:SetText("Checkboxf6"); |
97 |
|
Kragenwar-3044 |
self.checkboxf6:SetVisible(false); |
98 |
|
Kragenwar-3044 |
|
99 |
|
Kragenwar-3044 |
line = holder(self, 20); |
100 |
|
Kragenwar-3044 |
self.checkboxf7 = KragenPlugs.UI.CheckBox(); |
101 |
|
Kragenwar-3044 |
self.checkboxf7:SetParent(line); |
102 |
|
Kragenwar-3044 |
self.checkboxf7:SetSize(180, 20); |
103 |
|
Kragenwar-3044 |
self.checkboxf7:SetPosition(0,0); |
104 |
|
Kragenwar-3044 |
self.checkboxf7:SetText("Checkboxf7"); |
105 |
|
Kragenwar-3044 |
self.checkboxf7:SetVisible(false); |
106 |
|
Kragenwar-3044 |
|
107 |
|
Kragenwar-3044 |
self.checkboxf8 = KragenPlugs.UI.CheckBox(); |
108 |
|
Kragenwar-3044 |
self.checkboxf8:SetParent(line); |
109 |
|
Kragenwar-3044 |
self.checkboxf8:SetSize(180,20); |
110 |
|
Kragenwar-3044 |
self.checkboxf8:SetPosition(220,0); |
111 |
|
Kragenwar-3044 |
self.checkboxf8:AlignLeft(true); |
112 |
|
Kragenwar-3044 |
self.checkboxf8:SetText("Checkboxf8"); |
113 |
|
Kragenwar-3044 |
self.checkboxf8:SetVisible(false); |
114 |
|
Kragenwar-3044 |
|
115 |
|
Kragenwar-3044 |
line = holder(self, 35); |
116 |
|
Kragenwar-3044 |
self.titleFeatures = KragenPlugs.UI.PanelDivider(); |
117 |
|
Kragenwar-3044 |
self.titleFeatures:SetPosition(0,0); |
118 |
|
Kragenwar-3044 |
self.titleFeatures:SetParent(line); |
119 |
|
Kragenwar-3044 |
self.titleFeatures:SetText("Features"); |
120 |
|
Kragenwar-3044 |
self.titleFeatures:SetSize(400, 30); |
121 |
|
Kragenwar-3044 |
|
122 |
|
Kragenwar-3044 |
line = holder(self, 20); |
123 |
|
Kragenwar-3044 |
self.checkboxf10 = KragenPlugs.UI.CheckBox(); |
124 |
|
Kragenwar-3044 |
self.checkboxf10:SetParent(line); |
125 |
|
Kragenwar-3044 |
self.checkboxf10:SetSize(180, 20); |
126 |
|
Kragenwar-3044 |
self.checkboxf10:SetPosition(0,0); |
127 |
|
Kragenwar-3044 |
self.checkboxf10:SetText("Checkboxf1"); |
128 |
|
Kragenwar-3044 |
self.checkboxf10:SetVisible(false); |
129 |
|
Kragenwar-3044 |
|
130 |
|
Kragenwar-3044 |
self.checkboxf11 = KragenPlugs.UI.CheckBox(); |
131 |
|
Kragenwar-3044 |
self.checkboxf11:SetParent(line); |
132 |
|
Kragenwar-3044 |
self.checkboxf11:SetSize(180,20); |
133 |
|
Kragenwar-3044 |
self.checkboxf11:SetPosition(220,0); |
134 |
|
Kragenwar-3044 |
self.checkboxf11:AlignLeft(true); |
135 |
|
Kragenwar-3044 |
self.checkboxf11:SetText("Checkboxf2"); |
136 |
|
Kragenwar-3044 |
self.checkboxf11:SetVisible(false); |
137 |
|
Kragenwar-3044 |
|
138 |
|
Kragenwar-3044 |
line = holder(self, 20); |
139 |
|
Kragenwar-3044 |
self.checkboxf12 = KragenPlugs.UI.CheckBox(); |
140 |
|
Kragenwar-3044 |
self.checkboxf12:SetParent(line); |
141 |
|
Kragenwar-3044 |
self.checkboxf12:SetSize(180, 20); |
142 |
|
Kragenwar-3044 |
self.checkboxf12:SetPosition(0,0); |
143 |
|
Kragenwar-3044 |
self.checkboxf12:SetText("Checkboxf1"); |
144 |
|
Kragenwar-3044 |
self.checkboxf12:SetVisible(false); |
145 |
|
Kragenwar-3044 |
|
146 |
|
Kragenwar-3044 |
self.checkboxf13 = KragenPlugs.UI.CheckBox(); |
147 |
|
Kragenwar-3044 |
self.checkboxf13:SetParent(line); |
148 |
|
Kragenwar-3044 |
self.checkboxf13:SetSize(180,20); |
149 |
|
Kragenwar-3044 |
self.checkboxf13:SetPosition(220,0); |
150 |
|
Kragenwar-3044 |
self.checkboxf13:AlignLeft(true); |
151 |
|
Kragenwar-3044 |
self.checkboxf13:SetText("Checkboxf2"); |
152 |
|
Kragenwar-3044 |
self.checkboxf13:SetVisible(false); |
153 |
|
Kragenwar-3044 |
|
154 |
|
Kragenwar-3044 |
line = holder(self, 20); |
155 |
|
Kragenwar-3044 |
self.checkboxf14 = KragenPlugs.UI.CheckBox(); |
156 |
|
Kragenwar-3044 |
self.checkboxf14:SetParent(line); |
157 |
|
Kragenwar-3044 |
self.checkboxf14:SetSize(180, 20); |
158 |
|
Kragenwar-3044 |
self.checkboxf14:SetPosition(0,0); |
159 |
|
Kragenwar-3044 |
self.checkboxf14:SetText("Checkboxf1"); |
160 |
|
Kragenwar-3044 |
self.checkboxf14:SetVisible(false); |
161 |
|
Kragenwar-3044 |
|
162 |
|
Kragenwar-3044 |
self.checkboxf15 = KragenPlugs.UI.CheckBox(); |
163 |
|
Kragenwar-3044 |
self.checkboxf15:SetParent(line); |
164 |
|
Kragenwar-3044 |
self.checkboxf15:SetSize(180,20); |
165 |
|
Kragenwar-3044 |
self.checkboxf15:SetPosition(220,0); |
166 |
|
Kragenwar-3044 |
self.checkboxf15:AlignLeft(true); |
167 |
|
Kragenwar-3044 |
self.checkboxf15:SetText("Checkboxf2"); |
168 |
|
Kragenwar-3044 |
self.checkboxf15:SetVisible(false); |
169 |
|
Kragenwar-3044 |
|
170 |
|
Kragenwar-3044 |
line = holder(self, 20); |
171 |
|
Kragenwar-3044 |
self.checkboxf16 = KragenPlugs.UI.CheckBox(); |
172 |
|
Kragenwar-3044 |
self.checkboxf16:SetParent(line); |
173 |
|
Kragenwar-3044 |
self.checkboxf16:SetSize(180, 20); |
174 |
|
Kragenwar-3044 |
self.checkboxf16:SetPosition(0,0); |
175 |
|
Kragenwar-3044 |
self.checkboxf16:SetText("Checkboxf1"); |
176 |
|
Kragenwar-3044 |
self.checkboxf16:SetVisible(false); |
177 |
|
Kragenwar-3044 |
|
178 |
|
Kragenwar-3044 |
self.checkboxf17 = KragenPlugs.UI.CheckBox(); |
179 |
|
Kragenwar-3044 |
self.checkboxf17:SetParent(line); |
180 |
|
Kragenwar-3044 |
self.checkboxf17:SetSize(180,20); |
181 |
|
Kragenwar-3044 |
self.checkboxf17:SetPosition(220,0); |
182 |
|
Kragenwar-3044 |
self.checkboxf17:AlignLeft(true); |
183 |
|
Kragenwar-3044 |
self.checkboxf17:SetText("Checkboxf2"); |
184 |
|
Kragenwar-3044 |
self.checkboxf17:SetVisible(false); |
185 |
|
Kragenwar-3044 |
|
186 |
|
Kragenwar-3044 |
line = holder(self, 20); |
187 |
|
Kragenwar-3044 |
self.checkboxf18 = KragenPlugs.UI.CheckBox(); |
188 |
|
Kragenwar-3044 |
self.checkboxf18:SetParent(line); |
189 |
|
Kragenwar-3044 |
self.checkboxf18:SetSize(180, 20); |
190 |
|
Kragenwar-3044 |
self.checkboxf18:SetPosition(0,0); |
191 |
|
Kragenwar-3044 |
self.checkboxf18:SetText("Checkboxf1"); |
192 |
|
Kragenwar-3044 |
self.checkboxf18:SetVisible(false); |
193 |
|
Kragenwar-3044 |
|
194 |
|
Kragenwar-3044 |
self.checkboxf19 = KragenPlugs.UI.CheckBox(); |
195 |
|
Kragenwar-3044 |
self.checkboxf19:SetParent(line); |
196 |
|
Kragenwar-3044 |
self.checkboxf19:SetSize(180,20); |
197 |
|
Kragenwar-3044 |
self.checkboxf19:SetPosition(220,0); |
198 |
|
Kragenwar-3044 |
self.checkboxf19:AlignLeft(true); |
199 |
|
Kragenwar-3044 |
self.checkboxf19:SetText("Checkboxf2"); |
200 |
|
Kragenwar-3044 |
self.checkboxf19:SetVisible(false); |
201 |
|
Kragenwar-3044 |
|
202 |
|
Kragenwar-3044 |
line = holder(self, 35); |
203 |
|
Kragenwar-3044 |
self.titleDefaults = KragenPlugs.UI.PanelDivider(); |
204 |
|
Kragenwar-3044 |
self.titleDefaults:SetPosition(0,0); |
205 |
|
Kragenwar-3044 |
self.titleDefaults:SetParent(line); |
206 |
|
Kragenwar-3044 |
self.titleDefaults:SetText("Defaults"); |
207 |
|
Kragenwar-3044 |
self.titleDefaults:SetSize(400, 30); |
208 |
|
Kragenwar-3044 |
|
209 |
|
Kragenwar-3044 |
line = holder(self, 30); |
210 |
|
Kragenwar-3044 |
self.combo1Label = KragenPlugs.UI.Label(); |
211 |
|
Kragenwar-3044 |
self.combo1Label:SetParent(line); |
212 |
|
Kragenwar-3044 |
self.combo1Label:SetSize(190, 20); |
213 |
|
Kragenwar-3044 |
self.combo1Label:SetPosition(20, 0); |
214 |
|
Kragenwar-3044 |
self.combo1Label:SetText("Combo1"); |
215 |
|
Kragenwar-3044 |
self.combo1Label:SetVisible(false); |
216 |
|
Kragenwar-3044 |
-- tt(240, 19, self.visibleTypeLabel, L["Select when the bar is visible."]); |
217 |
|
Kragenwar-3044 |
|
218 |
|
Kragenwar-3044 |
self.combo1box = KragenPlugs.UI.ComboBox(); |
219 |
|
Kragenwar-3044 |
self.combo1box:SetParent(line); |
220 |
|
Kragenwar-3044 |
self.combo1box:SetSize(190, 20); |
221 |
|
Kragenwar-3044 |
self.combo1box:SetPosition(210, 0); |
222 |
|
Kragenwar-3044 |
self.combo1box:SetVisible(false); |
223 |
|
Kragenwar-3044 |
|
224 |
|
Kragenwar-3044 |
line = holder(self, 30); |
225 |
|
Kragenwar-3044 |
self.combo2Label = KragenPlugs.UI.Label(); |
226 |
|
Kragenwar-3044 |
self.combo2Label:SetParent(line); |
227 |
|
Kragenwar-3044 |
self.combo2Label:SetSize(190, 20); |
228 |
|
Kragenwar-3044 |
self.combo2Label:SetPosition(20, 0); |
229 |
|
Kragenwar-3044 |
self.combo2Label:SetText("Combo1"); |
230 |
|
Kragenwar-3044 |
self.combo2Label:SetVisible(false); |
231 |
|
Kragenwar-3044 |
-- tt(240, 19, self.visibleTypeLabel, L["Select when the bar is visible."]); |
232 |
|
Kragenwar-3044 |
|
233 |
|
Kragenwar-3044 |
self.combo2box = KragenPlugs.UI.ComboBox(); |
234 |
|
Kragenwar-3044 |
self.combo2box:SetParent(line); |
235 |
|
Kragenwar-3044 |
self.combo2box:SetSize(190, 20); |
236 |
|
Kragenwar-3044 |
self.combo2box:SetPosition(210, 0); |
237 |
|
Kragenwar-3044 |
self.combo2box:SetVisible(false); |
238 |
|
Kragenwar-3044 |
|
239 |
|
Kragenwar-3044 |
line = holder(self, 30); |
240 |
|
Kragenwar-3044 |
self.combo3Label = KragenPlugs.UI.Label(); |
241 |
|
Kragenwar-3044 |
self.combo3Label:SetParent(line); |
242 |
|
Kragenwar-3044 |
self.combo3Label:SetSize(190, 20); |
243 |
|
Kragenwar-3044 |
self.combo3Label:SetPosition(20, 0); |
244 |
|
Kragenwar-3044 |
self.combo3Label:SetText("Combo1"); |
245 |
|
Kragenwar-3044 |
self.combo3Label:SetVisible(false); |
246 |
|
Kragenwar-3044 |
-- tt(240, 19, self.visibleTypeLabel, L["Select when the bar is visible."]); |
247 |
|
Kragenwar-3044 |
|
248 |
|
Kragenwar-3044 |
self.combo3box = KragenPlugs.UI.ComboBox(); |
249 |
|
Kragenwar-3044 |
self.combo3box:SetParent(line); |
250 |
|
Kragenwar-3044 |
self.combo3box:SetSize(190, 20); |
251 |
|
Kragenwar-3044 |
self.combo3box:SetPosition(210, 0); |
252 |
|
Kragenwar-3044 |
self.combo3box:SetVisible(false); |
253 |
|
Kragenwar-3044 |
|
254 |
|
Kragenwar-3044 |
line = holder(self, 30); |
255 |
|
Kragenwar-3044 |
self.combo4Label = KragenPlugs.UI.Label(); |
256 |
|
Kragenwar-3044 |
self.combo4Label:SetParent(line); |
257 |
|
Kragenwar-3044 |
self.combo4Label:SetSize(190, 20); |
258 |
|
Kragenwar-3044 |
self.combo4Label:SetPosition(20, 0); |
259 |
|
Kragenwar-3044 |
self.combo4Label:SetText("Combo1"); |
260 |
|
Kragenwar-3044 |
self.combo4Label:SetVisible(false); |
261 |
|
Kragenwar-3044 |
-- tt(240, 19, self.visibleTypeLabel, L["Select when the bar is visible."]); |
262 |
|
Kragenwar-3044 |
|
263 |
|
Kragenwar-3044 |
self.combo4box = KragenPlugs.UI.ComboBox(); |
264 |
|
Kragenwar-3044 |
self.combo4box:SetParent(line); |
265 |
|
Kragenwar-3044 |
self.combo4box:SetSize(190, 20); |
266 |
|
Kragenwar-3044 |
self.combo4box:SetPosition(210, 0); |
267 |
|
Kragenwar-3044 |
self.combo4box:SetVisible(false); |
268 |
|
Kragenwar-3044 |
|
269 |
|
Kragenwar-3044 |
|
270 |
|
Kragenwar-3044 |
end |
271 |
|
Kragenwar-3044 |
|
272 |
|
Kragenwar-3044 |
|
273 |
|
Kragenwar-3044 |
function SetupFeatures:EnableControls(enable) |
274 |
|
Kragenwar-3044 |
self.checkboxf1:SetEnabled(enable); |
275 |
|
Kragenwar-3044 |
self.checkboxf2:SetEnabled(enable); |
276 |
|
Kragenwar-3044 |
self.checkboxf3:SetEnabled(enable); |
277 |
|
Kragenwar-3044 |
self.checkboxf4:SetEnabled(enable); |
278 |
|
Kragenwar-3044 |
self.checkboxf5:SetEnabled(enable); |
279 |
|
Kragenwar-3044 |
self.checkboxf6:SetEnabled(enable); |
280 |
|
Kragenwar-3044 |
|
281 |
|
Kragenwar-3044 |
end |
282 |
|
Kragenwar-3044 |
|
283 |
|
Kragenwar-3044 |
|
284 |
|
Kragenwar-3044 |
|
285 |
|
Kragenwar-3044 |
function SetupFeatures:Destroy() |
286 |
|
Kragenwar-3044 |
-- cleanup the quickslots so the client doesn't crash |
287 |
|
Kragenwar-3044 |
|
288 |
|
Kragenwar-3044 |
end |