-
Notifications
You must be signed in to change notification settings - Fork 2
/
modinfo.lua
428 lines (371 loc) · 11.6 KB
/
modinfo.lua
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
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
name = "Dev Tools"
version = "0.8.0-alpha"
description = [[Version: ]]
.. version
.. "\n\n"
.. [[An extendable mod, that simplifies the most common tasks for both developers and testers ]]
.. [[as an alternative to debugkeys.]]
author = "Depressed DST Modders"
api_version = 10
forumthread = ""
-- We need to load our mod with a higher priority than other, so we use a non-default value (0). The
-- "2220506640" part is the workshop ID of this mod, so other mods had enough "space for manoeuvre".
priority = 1.02220506640
icon = "modicon.tex"
icon_atlas = "modicon.xml"
all_clients_require_mod = false
client_only_mod = true
dont_starve_compatible = false
dst_compatible = true
reign_of_giants_compatible = false
shipwrecked_compatible = false
folder_name = folder_name or "mod-dev-tools"
if not folder_name:find("workshop-") then
name = name .. " (dev)"
end
--
-- Configuration
--
local function AddConfig(name, label, hover, options, default)
return { label = label, name = name, options = options, default = default, hover = hover or "" }
end
local function AddBooleanConfig(name, label, hover, default)
default = default == nil and true or default
return AddConfig(name, label, hover, {
{ description = "Disabled", data = false },
{ description = "Enabled", data = true },
}, default)
end
local function AddKeyListConfig(name, label, hover, default)
if default == nil then
default = false
end
-- helpers
local function AddDisabled(t)
t[#t + 1] = { description = "Disabled", data = false }
end
local function AddKey(t, key)
t[#t + 1] = { description = key, data = "KEY_" .. key:gsub(" ", ""):upper() }
end
local function AddKeysByName(t, names)
for i = 1, #names do
AddKey(t, names[i])
end
end
local function AddAlphabetKeys(t)
local string = ""
for i = 1, 26 do
AddKey(t, string.char(64 + i))
end
end
local function AddTypewriterNumberKeys(t)
for i = 1, 10 do
AddKey(t, "" .. (i % 10))
end
end
local function AddTypewriterModifierKeys(t)
AddKeysByName(t, { "Alt", "Ctrl", "Shift" })
end
local function AddTypewriterKeys(t)
AddAlphabetKeys(t)
AddKeysByName(t, {
"Slash",
"Backslash",
"Period",
"Semicolon",
"Left Bracket",
"Right Bracket",
})
AddKeysByName(t, { "Space", "Tab", "Backspace", "Enter" })
AddTypewriterModifierKeys(t)
AddKeysByName(t, { "Tilde" })
AddTypewriterNumberKeys(t)
AddKeysByName(t, { "Minus", "Equals" })
end
local function AddFunctionKeys(t)
for i = 1, 12 do
AddKey(t, "F" .. i)
end
end
local function AddArrowKeys(t)
AddKeysByName(t, { "Up", "Down", "Left", "Right" })
end
local function AddNavigationKeys(t)
AddKeysByName(t, { "Insert", "Delete", "Home", "End", "Page Up", "Page Down" })
end
-- key list
local list = {}
AddDisabled(list)
AddArrowKeys(list)
AddFunctionKeys(list)
AddTypewriterKeys(list)
AddNavigationKeys(list)
AddKeysByName(list, { "Escape", "Pause", "Print" })
return AddConfig(name, label, hover, list, default)
end
local function AddNumbersConfig(name, label, hover, first, last, default)
local list = {}
for i = first, last do
list[i - first + 1] = { description = i, data = i }
end
return AddConfig(name, label, hover, list, default)
end
local function AddSection(title)
return AddConfig("", title, nil, { { description = "", data = 0 } }, 0)
end
configuration_options = {
--
-- Keybinds
--
AddSection("Keybinds"),
AddKeyListConfig(
"key_toggle_tools",
"Toggle Tools Key",
"Key used for toggling the tools",
"KEY_RIGHTBRACKET"
),
AddKeyListConfig(
"key_switch_data",
"Switch Data Key",
"Key used for switching data sidebar",
"KEY_X"
),
AddKeyListConfig(
"key_select",
"Select Key",
"Key used for selecting between menu and data sidebar",
"KEY_TAB"
),
AddKeyListConfig(
"key_movement_prediction",
"Movement Prediction Key",
"Key used for toggling the movement prediction"
),
AddKeyListConfig("key_pause", "Pause Key", "Key used for pausing the game", "KEY_P"),
AddKeyListConfig("key_god_mode", "God Mode Key", "Key used for toggling god mode", "KEY_G"),
AddKeyListConfig(
"key_teleport",
"Teleport Key",
"Key used for (fake) teleporting on mouse position",
"KEY_T"
),
AddKeyListConfig(
"key_select_entity",
"Select Entity Key",
"Key used for selecting an entity under mouse",
"KEY_Z"
),
AddKeyListConfig(
"key_time_scale_increase",
"Increase Time Scale Key",
[[Key used to speed up the time scale.]]
.. "\n"
.. [[Hold down the Shift key to scale up to the maximum]],
"KEY_PAGEUP"
),
AddKeyListConfig(
"key_time_scale_decrease",
"Decrease Time Scale Key",
[[Key used to slow down the time scale.]]
.. "\n"
.. [[Hold down the Shift key to scale down to the minimum]],
"KEY_PAGEDOWN"
),
AddKeyListConfig(
"key_time_scale_default",
"Default Time Scale Key",
"Key used to restore the default time scale",
"KEY_HOME"
),
AddConfig(
"reset_combination",
"Reset Combination",
[[Key combination used for reloading all mods.]]
.. "\n"
.. [[Will restart the game/server to the latest savepoint]],
{
{ description = "Disabled", hover = "Reset will be completely disabled", data = false },
{ description = "Ctrl + R", data = "ctrl_r" },
{ description = "Alt + R", data = "alt_r" },
{ description = "Shift + R", data = "shift_r" },
},
"ctrl_r"
),
--
-- General
--
AddSection("General"),
AddBooleanConfig(
"default_god_mode",
"Default God Mode",
"When enabled, enables god mode by default.\nCan be changed inside in-game menu"
),
AddBooleanConfig(
"default_free_crafting",
"Default Free Crafting Mode",
"When enabled, enables crafting mode by default.\nCan be changed inside in-game menu"
),
AddSection("Labels"),
AddConfig(
"default_labels_font",
"Default Labels Font",
"Which labels font should be used by default?\nCan be changed inside in-game menu",
{
{
description = "Belisa... (50)",
hover = "Belisa Plumilla Manual (50)",
data = "UIFONT",
},
{
description = "Belisa... (100)",
hover = "Belisa Plumilla Manual (100)",
data = "TITLEFONT",
},
{
description = "Belisa... (Button)",
hover = "Belisa Plumilla Manual (Button)",
data = "BUTTONFONT",
},
{
description = "Belisa... (Talking)",
hover = "Belisa Plumilla Manual (Talking)",
data = "TALKINGFONT",
},
{
description = "Bellefair",
hover = "Bellefair",
data = "CHATFONT",
},
{
description = "Bellefair Outline",
hover = "Bellefair Outline",
data = "CHATFONT_OUTLINE",
},
{
description = "Hammerhead",
hover = "Hammerhead",
data = "HEADERFONT",
},
{
description = "Henny Penny",
hover = "Henny Penny (Wormwood)",
data = "TALKINGFONT_WORMWOOD",
},
{
description = "Mountains of...",
hover = "Mountains of Christmas (Hermit)",
data = "TALKINGFONT_HERMIT",
},
{
description = "Open Sans",
hover = "Open Sans",
data = "DIALOGFONT",
},
{
description = "PT Mono",
hover = "PT Mono",
data = "CODEFONT",
},
{
description = "Spirequal Light",
hover = "Spirequal Light",
data = "NEWFONT",
},
{
description = "Spirequal... S",
hover = "Spirequal Light (Small)",
data = "NEWFONT_SMALL",
},
{
description = "Spirequal... O",
hover = "Spirequal Light Outline",
data = "NEWFONT_OUTLINE",
},
{
description = "Spirequal... O/S",
hover = "Spirequal Light Outline (Small)",
data = "NEWFONT_OUTLINE_SMALL",
},
{
description = "Stint Ultra...",
hover = "Stint Ultra Condensed",
data = "BODYTEXTFONT",
},
{
description = "Stint Ultra... S",
hover = "Stint Ultra Condensed (Small)",
data = "SMALLNUMBERFONT",
},
},
"BODYTEXTFONT"
),
AddNumbersConfig(
"default_labels_font_size",
"Default Labels Font Size",
"Which labels font size should be used by default?\nCan be changed inside in-game menu",
6,
32,
18
),
AddBooleanConfig(
"default_selected_labels",
"Default Selected Labels",
"When enabled, show selected labels by default.\nCan be changed inside in-game menu"
),
AddBooleanConfig(
"default_username_labels",
"Default Username Labels",
"When enabled, shows username labels by default.\nCan be changed inside in-game menu"
),
AddConfig(
"default_username_labels_mode",
"Default Username Labels Mode",
"Which username labels mode should be used by default?\nCan be changed inside in-game menu",
{
{
description = "Default",
hover = "Default: white username labels",
data = "default",
},
{
description = "Coloured",
hover = "Coloured: coloured username labels",
data = "coloured",
},
},
"default"
),
--
-- Player Vision
--
AddSection("Player vision"),
AddBooleanConfig(
"default_forced_hud_visibility",
"Default Forced HUD Visibility",
[[When enabled, forces HUD visibility when "playerhuddirty" event occurs.]]
.. "\n"
.. [[Can be changed inside in-game menu]]
),
AddBooleanConfig(
"default_forced_unfading",
"Default Forced Unfading",
[[When enabled, forces unfading when "playerfadedirty" event occurs.]]
.. "\n"
.. [[Can be changed inside in-game menu]]
),
--
-- Other
--
AddSection("Other"),
AddBooleanConfig(
"default_mod_warning",
"Disable Mod Warning",
"When enabled, disables the mod warning when starting the game"
),
AddBooleanConfig(
"debug",
"Debug",
"When enabled, displays debug data in the console.\nUsed mainly for development",
false
),
}