lotrointerface.com
Search Downloads

LoTROInterface SVN KragenBars

[/] [branches/] [3.02/] [KragenBars/] [SetupButtonBars.lua] - Blame information for rev 16

Details | Compare with Previous | View Log

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

All times are GMT -5. The time now is 10:46 AM.


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