lotrointerface.com
Search Downloads

LoTROInterface SVN KragenBars

[/] [branches/] [3.21/] [KragenBars/] [SetupButtonBars.lua] - Blame information for rev 72

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 72 Kragenwar-3044
import "Turbine.UI";
2 Kragenwar-3044
 
3 Kragenwar-3044
SetupButtonBars = 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 SetupButtonBars: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.barTitle = KragenPlugs.UI.PanelDivider();
45 Kragenwar-3044
    self.barTitle:SetPosition(0,0);
46 Kragenwar-3044
    self.barTitle:SetParent(line);
47 Kragenwar-3044
    self.barTitle:SetText("Button Bar Opacity");
48 Kragenwar-3044
    self.barTitle:SetSize(400, 30);
49 Kragenwar-3044
 
50 Kragenwar-3044
    line = holder(self, 30);
51 Kragenwar-3044
    self.combolanglabel = KragenPlugs.UI.Label();
52 Kragenwar-3044
    self.combolanglabel:SetParent(line);
53 Kragenwar-3044
    self.combolanglabel:SetSize(190, 20);
54 Kragenwar-3044
    self.combolanglabel:SetPosition(20, 0);
55 Kragenwar-3044
    self.combolanglabel:SetText("Language");
56 Kragenwar-3044
    self.combolanglabel:SetVisible(true);
57 Kragenwar-3044
 
58 Kragenwar-3044
    self.combolangbox = KragenPlugs.UI.ComboBox();
59 Kragenwar-3044
    self.combolangbox:SetParent(line);
60 Kragenwar-3044
    self.combolangbox:SetSize(190, 20);
61 Kragenwar-3044
    self.combolangbox:SetPosition(210, 0);
62 Kragenwar-3044
    self.combolangbox:SetVisible(true);
63 Kragenwar-3044
        self.combolangbox.listBox:ClearItems();
64 Kragenwar-3044
        local combolist = {"English", "French", "German"};
65 Kragenwar-3044
        for k,v in pairs(combolist) do
66 Kragenwar-3044
                self.combolangbox:AddItem(v, k);
67 Kragenwar-3044
        end
68 Kragenwar-3044
 
69 Kragenwar-3044
    line = holder(self, 50);
70 Kragenwar-3044
    self.opacityslider = KragenPlugs.UI.Slider();
71 Kragenwar-3044
    self.opacityslider:SetParent(line);
72 Kragenwar-3044
    self.opacityslider:SetText("Button Bar Opacity (%)");
73 Kragenwar-3044
    self.opacityslider:SetPosition(49, 0);
74 Kragenwar-3044
    self.opacityslider:SetSize(350, 40);
75 Kragenwar-3044
    self.opacityslider:SetStep(1);
76 Kragenwar-3044
    self.opacityslider:SetMin(0);
77 Kragenwar-3044
    self.opacityslider:SetMax(100);
78 Kragenwar-3044
 
79 Kragenwar-3044
    line = holder(self, 20);
80 Kragenwar-3044
        self.checkboxlock = KragenPlugs.UI.CheckBox();
81 Kragenwar-3044
        self.checkboxlock:SetParent(line);
82 Kragenwar-3044
        self.checkboxlock:SetSize(180, 20);
83 Kragenwar-3044
    self.checkboxlock:SetPosition(0,0);
84 Kragenwar-3044
        self.checkboxlock:SetText("Lock Slots");
85 Kragenwar-3044
    self.checkboxlock:SetVisible(true);
86 Kragenwar-3044
 
87 Kragenwar-3044
    self.checkboxgrid = KragenPlugs.UI.CheckBox();
88 Kragenwar-3044
    self.checkboxgrid:SetParent(line);
89 Kragenwar-3044
    self.checkboxgrid:SetSize(180,20);
90 Kragenwar-3044
    self.checkboxgrid:SetPosition(220,0);
91 Kragenwar-3044
    self.checkboxgrid:AlignLeft(true);
92 Kragenwar-3044
    self.checkboxgrid:SetText("Windows Snap to Grid");
93 Kragenwar-3044
    self.checkboxgrid:SetVisible(true);
94 Kragenwar-3044
 
95 Kragenwar-3044
    line = holder(self, 35);
96 Kragenwar-3044
    self.barTitle = KragenPlugs.UI.PanelDivider();
97 Kragenwar-3044
    self.barTitle:SetPosition(0,0);
98 Kragenwar-3044
    self.barTitle:SetParent(line);
99 Kragenwar-3044
    self.barTitle:SetText("Button Bars");
100 Kragenwar-3044
    self.barTitle:SetSize(400, 30);
101 Kragenwar-3044
 
102 Kragenwar-3044
    line = holder(self, 20);
103 Kragenwar-3044
        self.checkboxbb1 = KragenPlugs.UI.CheckBox();
104 Kragenwar-3044
        self.checkboxbb1:SetParent(line);
105 Kragenwar-3044
        self.checkboxbb1:SetSize(180, 20);
106 Kragenwar-3044
    self.checkboxbb1:SetPosition(0,0);
107 Kragenwar-3044
        self.checkboxbb1:SetText("Checkboxw1");
108 Kragenwar-3044
    self.checkboxbb1:SetVisible(false);
109 Kragenwar-3044
        -- tt(420, 19, self.checkboxw1, "When checked, the disease quickslot will be shown.");
110 Kragenwar-3044
 
111 Kragenwar-3044
    self.checkboxbb2 = KragenPlugs.UI.CheckBox();
112 Kragenwar-3044
    self.checkboxbb2:SetParent(line);
113 Kragenwar-3044
    self.checkboxbb2:SetSize(180,20);
114 Kragenwar-3044
    self.checkboxbb2:SetPosition(220,0);
115 Kragenwar-3044
    self.checkboxbb2:AlignLeft(true);
116 Kragenwar-3044
    self.checkboxbb2:SetText("Checkboxw2");
117 Kragenwar-3044
    self.checkboxbb2:SetVisible(false);
118 Kragenwar-3044
 
119 Kragenwar-3044
    line = holder(self, 20);
120 Kragenwar-3044
        self.checkboxbb3 = KragenPlugs.UI.CheckBox();
121 Kragenwar-3044
        self.checkboxbb3:SetParent(line);
122 Kragenwar-3044
        self.checkboxbb3:SetSize(180, 20);
123 Kragenwar-3044
    self.checkboxbb3:SetPosition(0,0);
124 Kragenwar-3044
        self.checkboxbb3:SetText("Checkboxw3");
125 Kragenwar-3044
    self.checkboxbb3:SetVisible(false);
126 Kragenwar-3044
 
127 Kragenwar-3044
    self.checkboxbb4 = KragenPlugs.UI.CheckBox();
128 Kragenwar-3044
    self.checkboxbb4:SetParent(line);
129 Kragenwar-3044
    self.checkboxbb4:SetSize(180,20);
130 Kragenwar-3044
    self.checkboxbb4:SetPosition(220,0);
131 Kragenwar-3044
    self.checkboxbb4:AlignLeft(true);
132 Kragenwar-3044
    self.checkboxbb4:SetText("Checkboxw4");
133 Kragenwar-3044
    self.checkboxbb4:SetVisible(false);
134 Kragenwar-3044
 
135 Kragenwar-3044
    line = holder(self, 20);
136 Kragenwar-3044
    self.checkboxbb5 = KragenPlugs.UI.CheckBox();
137 Kragenwar-3044
    self.checkboxbb5:SetParent(line);
138 Kragenwar-3044
    self.checkboxbb5:SetSize(180, 20);
139 Kragenwar-3044
    self.checkboxbb5:SetPosition(0,0);
140 Kragenwar-3044
        self.checkboxbb5:SetText("Checkboxw5");
141 Kragenwar-3044
    self.checkboxbb5:SetVisible(false);
142 Kragenwar-3044
 
143 Kragenwar-3044
    self.checkboxbb6 = KragenPlugs.UI.CheckBox();
144 Kragenwar-3044
    self.checkboxbb6:SetParent(line);
145 Kragenwar-3044
    self.checkboxbb6:SetSize(180,20);
146 Kragenwar-3044
    self.checkboxbb6:SetPosition(220,0);
147 Kragenwar-3044
    self.checkboxbb6:AlignLeft(true);
148 Kragenwar-3044
    self.checkboxbb6:SetText("Checkboxw6");
149 Kragenwar-3044
    self.checkboxbb6:SetVisible(false);
150 Kragenwar-3044
 
151 Kragenwar-3044
    line = holder(self, 20);
152 Kragenwar-3044
    self.checkboxbb7 = KragenPlugs.UI.CheckBox();
153 Kragenwar-3044
    self.checkboxbb7:SetParent(line);
154 Kragenwar-3044
    self.checkboxbb7:SetSize(180, 20);
155 Kragenwar-3044
    self.checkboxbb7:SetPosition(0,0);
156 Kragenwar-3044
        self.checkboxbb7:SetText("Checkboxw7");
157 Kragenwar-3044
    self.checkboxbb7:SetVisible(false);
158 Kragenwar-3044
 
159 Kragenwar-3044
    self.checkboxbb8 = KragenPlugs.UI.CheckBox();
160 Kragenwar-3044
    self.checkboxbb8:SetParent(line);
161 Kragenwar-3044
    self.checkboxbb8:SetSize(180,20);
162 Kragenwar-3044
    self.checkboxbb8:SetPosition(220,0);
163 Kragenwar-3044
    self.checkboxbb8:AlignLeft(true);
164 Kragenwar-3044
    self.checkboxbb8:SetText("Checkboxw8");
165 Kragenwar-3044
    self.checkboxbb8:SetVisible(false);
166 Kragenwar-3044
 
167 Kragenwar-3044
    line = holder(self, 20);
168 Kragenwar-3044
    self.checkboxbb9 = KragenPlugs.UI.CheckBox();
169 Kragenwar-3044
    self.checkboxbb9:SetParent(line);
170 Kragenwar-3044
    self.checkboxbb9:SetSize(180, 20);
171 Kragenwar-3044
    self.checkboxbb9:SetPosition(0,0);
172 Kragenwar-3044
        self.checkboxbb9:SetText("Checkboxw9");
173 Kragenwar-3044
    self.checkboxbb9:SetVisible(false);
174 Kragenwar-3044
 
175 Kragenwar-3044
    self.checkboxbb10 = KragenPlugs.UI.CheckBox();
176 Kragenwar-3044
    self.checkboxbb10:SetParent(line);
177 Kragenwar-3044
    self.checkboxbb10:SetSize(180,20);
178 Kragenwar-3044
    self.checkboxbb10:SetPosition(220,0);
179 Kragenwar-3044
    self.checkboxbb10:AlignLeft(true);
180 Kragenwar-3044
    self.checkboxbb10:SetText("Checkboxw10");
181 Kragenwar-3044
    self.checkboxbb10:SetVisible(false);
182 Kragenwar-3044
 
183 Kragenwar-3044
    line = holder(self, 20);
184 Kragenwar-3044
    self.checkboxbb11 = KragenPlugs.UI.CheckBox();
185 Kragenwar-3044
    self.checkboxbb11:SetParent(line);
186 Kragenwar-3044
    self.checkboxbb11:SetSize(180, 20);
187 Kragenwar-3044
    self.checkboxbb11:SetPosition(0,0);
188 Kragenwar-3044
        self.checkboxbb11:SetText("Checkboxw11");
189 Kragenwar-3044
    self.checkboxbb11:SetVisible(false);
190 Kragenwar-3044
 
191 Kragenwar-3044
    self.checkboxbb12 = KragenPlugs.UI.CheckBox();
192 Kragenwar-3044
    self.checkboxbb12:SetParent(line);
193 Kragenwar-3044
    self.checkboxbb12:SetSize(180,20);
194 Kragenwar-3044
    self.checkboxbb12:SetPosition(220,0);
195 Kragenwar-3044
    self.checkboxbb12:AlignLeft(true);
196 Kragenwar-3044
    self.checkboxbb12:SetText("Checkboxw12");
197 Kragenwar-3044
    self.checkboxbb12:SetVisible(false);
198 Kragenwar-3044
 
199 Kragenwar-3044
    line = holder(self, 20);
200 Kragenwar-3044
        self.checkboxbb13 = KragenPlugs.UI.CheckBox();
201 Kragenwar-3044
        self.checkboxbb13:SetParent(line);
202 Kragenwar-3044
        self.checkboxbb13:SetSize(180, 20);
203 Kragenwar-3044
    self.checkboxbb13:SetPosition(0,0);
204 Kragenwar-3044
        self.checkboxbb13:SetText("Checkboxw13");
205 Kragenwar-3044
        self.checkboxbb13:SetVisible(false);
206 Kragenwar-3044
 
207 Kragenwar-3044
    self.checkboxbb14 = KragenPlugs.UI.CheckBox();
208 Kragenwar-3044
    self.checkboxbb14:SetParent(line);
209 Kragenwar-3044
    self.checkboxbb14:SetSize(180,20);
210 Kragenwar-3044
    self.checkboxbb14:SetPosition(220,0);
211 Kragenwar-3044
    self.checkboxbb14:AlignLeft(true);
212 Kragenwar-3044
    self.checkboxbb14:SetText("Checkboxw14");
213 Kragenwar-3044
    self.checkboxbb14:SetVisible(false);
214 Kragenwar-3044
 
215 Kragenwar-3044
    line = holder(self, 20);
216 Kragenwar-3044
        self.checkboxbb15 = KragenPlugs.UI.CheckBox();
217 Kragenwar-3044
        self.checkboxbb15:SetParent(line);
218 Kragenwar-3044
        self.checkboxbb15:SetSize(180, 20);
219 Kragenwar-3044
    self.checkboxbb15:SetPosition(0,0);
220 Kragenwar-3044
        self.checkboxbb15:SetText("Checkboxw15");
221 Kragenwar-3044
    self.checkboxbb15:SetVisible(false);
222 Kragenwar-3044
 
223 Kragenwar-3044
    self.checkboxbb16 = KragenPlugs.UI.CheckBox();
224 Kragenwar-3044
    self.checkboxbb16:SetParent(line);
225 Kragenwar-3044
    self.checkboxbb16:SetSize(180,20);
226 Kragenwar-3044
    self.checkboxbb16:SetPosition(220,0);
227 Kragenwar-3044
    self.checkboxbb16:AlignLeft(true);
228 Kragenwar-3044
    self.checkboxbb16:SetText("Checkboxw16");
229 Kragenwar-3044
    self.checkboxbb16:SetVisible(false);
230 Kragenwar-3044
 
231 Kragenwar-3044
    line = holder(self, 20);
232 Kragenwar-3044
        self.checkboxbb17 = KragenPlugs.UI.CheckBox();
233 Kragenwar-3044
        self.checkboxbb17:SetParent(line);
234 Kragenwar-3044
        self.checkboxbb17:SetSize(180, 20);
235 Kragenwar-3044
    self.checkboxbb17:SetPosition(0,0);
236 Kragenwar-3044
        self.checkboxbb17:SetText("Checkboxw17");
237 Kragenwar-3044
    self.checkboxbb17:SetVisible(false);
238 Kragenwar-3044
 
239 Kragenwar-3044
    self.checkboxbb18 = KragenPlugs.UI.CheckBox();
240 Kragenwar-3044
    self.checkboxbb18:SetParent(line);
241 Kragenwar-3044
    self.checkboxbb18:SetSize(180,20);
242 Kragenwar-3044
    self.checkboxbb18:SetPosition(220,0);
243 Kragenwar-3044
    self.checkboxbb18:AlignLeft(true);
244 Kragenwar-3044
    self.checkboxbb18:SetText("Checkboxw18");
245 Kragenwar-3044
    self.checkboxbb18:SetVisible(false);
246 Kragenwar-3044
 
247 Kragenwar-3044
    line = holder(self, 20);
248 Kragenwar-3044
        self.checkboxbb19 = KragenPlugs.UI.CheckBox();
249 Kragenwar-3044
        self.checkboxbb19:SetParent(line);
250 Kragenwar-3044
        self.checkboxbb19:SetSize(180, 20);
251 Kragenwar-3044
    self.checkboxbb19:SetPosition(0,0);
252 Kragenwar-3044
        self.checkboxbb19:SetText("Checkboxw19");
253 Kragenwar-3044
    self.checkboxbb19:SetVisible(false);
254 Kragenwar-3044
 
255 Kragenwar-3044
    self.checkboxbb20 = KragenPlugs.UI.CheckBox();
256 Kragenwar-3044
    self.checkboxbb20:SetParent(line);
257 Kragenwar-3044
    self.checkboxbb20:SetSize(180,20);
258 Kragenwar-3044
    self.checkboxbb20:SetPosition(220,0);
259 Kragenwar-3044
    self.checkboxbb20:AlignLeft(true);
260 Kragenwar-3044
    self.checkboxbb20:SetText("Checkboxw20");
261 Kragenwar-3044
    self.checkboxbb20:SetVisible(false);
262 Kragenwar-3044
 
263 Kragenwar-3044
end
264 Kragenwar-3044
 
265 Kragenwar-3044
 
266 Kragenwar-3044
function SetupButtonBars:EnableControls(enable)
267 Kragenwar-3044
    self.checkboxbb1:SetEnabled(enable);
268 Kragenwar-3044
    self.checkboxbb2:SetEnabled(enable);
269 Kragenwar-3044
    self.checkboxbb3:SetEnabled(enable);
270 Kragenwar-3044
    self.checkboxbb4:SetEnabled(enable);
271 Kragenwar-3044
    self.checkboxbb5:SetEnabled(enable);
272 Kragenwar-3044
    self.checkboxbb6:SetEnabled(enable);
273 Kragenwar-3044
    self.checkboxbb7:SetEnabled(enable);
274 Kragenwar-3044
    self.checkboxbb8:SetEnabled(enable);
275 Kragenwar-3044
    self.checkboxbb9:SetEnabled(enable);
276 Kragenwar-3044
    self.checkboxbb10:SetEnabled(enable);
277 Kragenwar-3044
    self.checkboxbb11:SetEnabled(enable);
278 Kragenwar-3044
    self.checkboxbb12:SetEnabled(enable);
279 Kragenwar-3044
    self.checkboxbb13:SetEnabled(enable);
280 Kragenwar-3044
    self.checkboxbb14:SetEnabled(enable);
281 Kragenwar-3044
    self.checkboxbb15:SetEnabled(enable);
282 Kragenwar-3044
    self.checkboxbb16:SetEnabled(enable);
283 Kragenwar-3044
    self.checkboxbb17:SetEnabled(enable);
284 Kragenwar-3044
    self.checkboxbb18:SetEnabled(enable);
285 Kragenwar-3044
    self.checkboxbb19:SetEnabled(enable);
286 Kragenwar-3044
    self.checkboxbb20:SetEnabled(enable);
287 Kragenwar-3044
end
288 Kragenwar-3044
 
289 Kragenwar-3044
 
290 Kragenwar-3044
 
291 Kragenwar-3044
function SetupButtonBars:Destroy()
292 Kragenwar-3044
    -- cleanup the quickslots so the client doesn't crash
293 Kragenwar-3044
 
294 Kragenwar-3044
end

All times are GMT -5. The time now is 06:30 PM.


Our Network
EQInterface | EQ2Interface | Minion | WoWInterface | ESOUI | LoTROInterface | MMOUI | Swtorui