forked from Spring-Chobby/Chobby
-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathhelpSubmenuConfig.lua
More file actions
389 lines (364 loc) · 8 KB
/
Copy pathhelpSubmenuConfig.lua
File metadata and controls
389 lines (364 loc) · 8 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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- Utilities
local function CreateLine(lineText, linkText, onClick)
local Configuration = WG.Chobby.Configuration
local lineHolder = Control:New {
x = 0,
y = 0,
width = "100%",
resizable = false,
draggable = false,
padding = {0, 0, 0, 0},
}
if onClick then
local linkButton = Button:New {
x = 3,
y = 3,
height = WG.BUTTON_HEIGHT,
width = 110,
caption = linkText,
classname = "small_action_button",
objectOverrideFont = WG.Chobby.Configuration:GetButtonFont(2),
OnClick = {
onClick
},
parent = lineHolder,
}
end
local text = TextBox:New {
name = "text",
x = 125,
y = 16,
right = 0,
height = 20,
valign = 'center',
objectOverrideFont = Configuration:GetFont(2),
text = lineText,
parent = lineHolder,
}
return lineHolder
end
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- Community Links
local communityLines = {
{
"Site home page.",
"Home",
function ()
WG.BrowserHandler.OpenUrl("https://zero-k.info/")
end
},
{
"Community forums.",
"Forums",
function ()
WG.BrowserHandler.OpenUrl("https://zero-k.info/Forum")
end
},
{
"Wiki manual.",
"Manual",
function ()
WG.BrowserHandler.OpenUrl("https://zero-k.info/mediawiki/index.php?title=Manual")
end
},
{
"Wiki FAQ.",
"FAQ",
function ()
WG.BrowserHandler.OpenUrl("https://zero-k.info/mediawiki/index.php?title=FAQ")
end
},
{
"Discord chat server.",
"Discord",
function ()
WG.BrowserHandler.OpenUrl("https://discord.gg/aab63Vt")
end
},
{
"Contributors and developers.",
"Credits",
function ()
WG.BrowserHandler.OpenUrl("https://zero-k.info/mediawiki/index.php?title=Credits")
end
},
{
"Zero-K streams on Twitch.",
"Twitch",
function ()
WG.BrowserHandler.OpenUrl("https://www.twitch.tv/directory/game/Zero-K")
end
},
{
"Shadowfury333's Youtube channel.",
"Youtube",
function ()
WG.BrowserHandler.OpenUrl("https://www.youtube.com/user/Shadowfury333")
end
},
{
"Shadowfury333's Hitbox stream.",
"Hitbox",
function ()
WG.BrowserHandler.OpenUrl("http://www.hitbox.tv/shadowfury333")
end
},
{
"Zero-K facebook page.",
"Facebook",
function ()
WG.BrowserHandler.OpenUrl("https://www.facebook.com/ZeroK.RTS/")
end
},
{
"Top 50 players.",
"Ladder",
function ()
WG.BrowserHandler.OpenUrl("https://zero-k.info/Ladders")
end
},
{
"Browse and download maps.",
"Maps",
function ()
WG.BrowserHandler.OpenUrl("https://zero-k.info/Maps")
end
},
{
"Browse and download replays.",
"Replays",
function ()
WG.BrowserHandler.OpenUrl("https://zero-k.info/Battles")
end
},
{
"View source code on GitHub.",
"Source",
function ()
WG.BrowserHandler.OpenUrl("https://github.com/ZeroK-RTS")
end
},
{
"Open game data folder to find config files and logs.",
"Game Data",
function ()
WG.WrapperLoopback.OpenFolder()
end
},
}
--if VFS.HasArchive("Zero-K $VERSION") then
-- communityLines[#communityLines + 1] = {
-- "Run a benchmark game.",
-- "Benchmark",
-- function ()
-- local localLobby = WG.LibLobby and WG.LibLobby.localLobby
-- if localLobby then
-- localLobby:StartGameFromString(VFS.Include(LUA_DIRNAME .. "configs/gameConfig/zk/benchmarkFile.lua"))
-- end
-- end
-- }
--end
--
--if VFS.HasArchive("CAI Fight 2017 06 fix") then
-- communityLines[#communityLines + 1] = {
-- "Run a benchmark game.",
-- "CAI Fight",
-- function ()
-- local localLobby = WG.LibLobby and WG.LibLobby.localLobby
-- if localLobby then
-- localLobby:StartGameFromString(VFS.Include(LUA_DIRNAME .. "configs/gameConfig/zk/benchmarkFileCAIfight.lua"))
-- end
-- end
-- }
--end
local communityControl = Control:New {
x = 0,
y = 0,
right = 0,
bottom = 0,
padding = {0, 0, 0, 0},
OnParent = {
function (obj)
if not obj:IsEmpty() then
return
end
Label:New {
x = 15,
y = 11,
width = 180,
height = 30,
parent = obj,
objectOverrideFont = WG.Chobby.Configuration:GetFont(3),
caption = "Community and development links",
}
Button:New {
right = 11,
y = WG.TOP_BUTTON_Y,
width = WG.BUTTON_HEIGHT,
height = WG.BUTTON_HEIGHT,
caption = "",
classname = "close_button",
OnClick = {
function()
obj:Hide()
end
},
parent = obj,
}
local listHolder = Control:New {
x = 12,
right = 15,
y = 52,
bottom = 15,
parent = obj,
resizable = false,
draggable = false,
padding = {0, 0, 0, 0},
}
local list = SortableList(listHolder, false, WG.BUTTON_HEIGHT + 3)
local items = {}
for i = 1, #communityLines do
local data = communityLines[i]
items[#items + 1] = {i, CreateLine(data[1], data[2], data[3]), {i}}
end
list:AddItems(items)
end
},
}
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- Bug Reporting
local firstBugParent = true
local bugControl = Control:New {
x = 0,
y = 0,
right = 0,
bottom = 0,
padding = {0, 0, 0, 0},
OnParent = {
function (obj)
if not obj:IsEmpty() then
return
end
local Configuration = WG.Chobby.Configuration
Label:New {
x = 15,
y = 11,
width = 180,
height = 30,
parent = obj,
objectOverrideFont = Configuration:GetFont(3),
caption = "Send a bug report",
}
Button:New {
right = 11,
y = WG.TOP_BUTTON_Y,
width = WG.BUTTON_HEIGHT,
height = WG.BUTTON_HEIGHT,
caption = "",
classname = "close_button",
OnClick = {
function()
obj:Hide()
end
},
parent = obj,
}
local offset = 70
TextBox:New {
x = 21,
width = 170,
y = offset,
height = 35,
text ="Title:",
objectOverrideFont = Configuration:GetFont(3),
parent = obj,
}
offset = offset + 36
local titleBox = EditBox:New {
x = 24,
right = 20,
y = offset - 9,
height = 35,
text = "",
objectOverrideFont = Configuration:GetFont(3),
objectOverrideHintFont = Configuration:GetHintFont(3),
parent = obj,
}
offset = offset + 36
offset = offset + 8
TextBox:New {
x = 21,
width = 170,
y = offset,
height = 35,
text ="Description:",
objectOverrideFont = Configuration:GetFont(3),
parent = obj,
}
offset = offset + 36
local descBox = EditBox:New {
x = 24,
right = 20,
y = offset - 9,
height = 35,
text = "",
objectOverrideFont = Configuration:GetFont(3),
objectOverrideHintFont = Configuration:GetHintFont(3),
parent = obj,
}
offset = offset + 36
offset = offset + 8
TextBox:New {
x = 24,
right = 24,
y = offset,
height = 35,
text = "Using Spring engine version " .. Spring.Utilities.GetEngineVersion() .. " " .. ((WG.Chobby.Configuration:GetIsRunning64Bit() and "64-bit.") or "32-bit."),
objectOverrideFont = Configuration:GetFont(2),
parent = obj,
}
offset = offset + 36
Button:New {
x = "35%",
right = "35%",
bottom = 15,
height = 80,
caption = "Submit",
tooltip = "Closes the game and submits the report. Click OK to the resulting pop-up.",
objectOverrideFont = Configuration:GetButtonFont(4),
classname = "action_button",
OnClick = {
function()
WG.WrapperLoopback.SendBugReport(titleBox.text, descBox.text)
end
},
parent = obj,
}
end
},
}
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- Structure
return {
{
name = "links",
control = communityControl,
},
--{
-- name = "tutorials",
-- control = WG.MissionHandler.GetControl(),
--},
{
name = "benchmark",
control = WG.BenchmarkHandler.GetControl(),
},
{
name = "report_a_bug",
control = bugControl,
},
}