-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathzz_changelog.lua
421 lines (379 loc) · 13.9 KB
/
zz_changelog.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
-- TODO: kind of rushed, should come back and improve this. Does the job for now
changelogs = {
["v2.4"] = {
title = "\\#316BE8\\Tag v2.4: Major Update",
gamemodes = {
"Added " .. get_gamemode(ODDBALL),
"Added " .. get_gamemode(ROYALE),
"Revamped " .. get_gamemode(JUGGERNAUT),
},
modifiers = {
"Added " .. get_modifier_text(MODIFIER_HARD_SURFACE),
"Added " .. get_modifier_text(MODIFIER_SAND),
"Readded " .. get_modifier_text(MODIFIER_SWAP),
"Added " .. get_modifier_text(MODIFIER_Z_BUTTON_CHALLENGE),
"Added " .. get_modifier_text(MODIFIER_ONLY_FIRSTIES),
},
romhacks = {
"Added Lug's Delightful Dioramas (jzzle and TheMan)",
"Added SM64: The Green Stars (Bear)",
"Improved Star Road",
},
levels = {
"Added Bowser's Sub",
"Added Dorrie's Domain",
"Added Boulder's Rush",
"Added Bowser Sky Domain",
"Added Vanish Cap Under the Moat",
"Added Big Boo's Haunt",
"Added Pipes to Tiny Huge Island",
"Added Pipes to Whomp's Fortress"
},
newFeatures = {
"Added achievements, and rewards. Rewards includes titles and trails",
"Added a Tournament system",
"Added hud themes",
"Reorganized settings for the 1000th time",
"Save gamemode settings",
"Save modifier settings",
"Save blacklist settings",
}
},
["v2.32"] = {
title = "\\#316BE8\\Tag v2.32: Minor Update",
gamemodes = {
"Added " .. get_gamemode(TERMINATOR),
},
modifiers = {
"No modifier changes"
},
romhacks = {
"No romhack changes"
},
levels = {
"No level changes"
},
newFeatures = {
"No new features"
}
},
["v2.31"] = {
title = "\\#316BE8\\Tag v2.31: Minor Update",
gamemodes = {
"No gamemodes added"
},
modifiers = {
"Added " .. get_modifier_text(MODIFIER_FRIENDLY_FIRE)
},
romhacks = {
"No romhack changes"
},
levels = {
"No level changes"
},
newFeatures = {
"Added dust particles to double jump",
"Allow sardines to see other sardines",
"Fixed sardine constantly playing a stomping sound"
}
},
["v2.3"] = {
title = "\\#316BE8\\Tag v2.3: Major Update",
gamemodes = {
"Added " .. get_gamemode(SARDINES),
"Added " .. get_gamemode(HUNT),
"Added " .. get_gamemode(DEATHMATCH),
},
modifiers = {
"Readded " .. get_modifier_text(MODIFIER_FLY),
"Added " .. get_modifier_text(MODIFIER_BLASTER),
"Added " .. get_modifier_text(MODIFIER_DOUBLE_JUMP),
"Added " .. get_modifier_text(MODIFIER_SHELL),
"Added " .. get_modifier_text(MODIFIER_BLJS),
"Added " .. get_modifier_text(MODIFIER_ONE_RUNNER),
"Heavily improve " .. get_modifier_text(MODIFIER_FOG) .. " \\#dcdcdc\\(\\#F2F3AE\\B\\#EDD382\\l\\#FC9E4F\\o\\#F4442E\\c\\#9B1D20\\ky\\#dcdcdc\\)",
},
romhacks = {
"Added Star Road (Murioz)",
"Added Super Mario 74 (Murioz)",
"Added SM64 Sapphire",
"Added Royal Legacy",
"Added SM64 Trouble Town",
},
levels = {
"Added Wet-dry Town",
"Added Red's in HMC Town",
"Added Toxic Maze Town",
},
newFeatures = {
"Add Stats",
"Added Auto Hide Hud",
"Redesigned center ui",
"Allowed gamemodes and modifiers to be blacklisted",
"Hud Redesign",
"Added level api",
"Added support for arena stages",
"Make hazards toggleable",
"Remove join screen",
"Revamp bomb physics",
"Use saves instead of time as runner in Freeze Tag",
}
},
["v2.21"] = {
title = "\\#316BE8\\Tag v2.21: Minor Update",
gamemodes = {
"No gamemode changes"
},
modifiers = {
"No modifier changes"
},
romhacks = {
"No romhack changes"
},
levels = {
"No level changes"
},
newFeatures = {
"Added Binds",
"Fixed clients not being able to see server settings",
}
},
["v2.2"] = {
title = "\\#316BE8\\Tag v2.2: Major Update",
gamemodes = {
"No gamemode changes"
},
modifiers = {
"Added " .. get_modifier_text(MODIFIER_HIGH_GRAVITY),
"Added " .. get_modifier_text(MODIFIER_FOG),
"Improved " .. get_modifier_text(MODIFIER_INCOGNITO),
"Removed " .. get_modifier_text(MODIFIER_FLY),
},
romhacks = {
"No romhack changes"
},
levels = {
"Added Wet-Dry World",
"Added Inside of Tiny Huge Island (now known as Wiggler's Cave)",
},
newFeatures = {
"Added a new voting system",
"Added a custom pause menu",
"Added positions to the leaderboard",
"Added gamemode time limit customizations",
"Added elimination on death option",
"Added help menu to settings",
"Added blacklists to vanilla sm64",
"Added non-auto mode",
}
},
["v2.1"] = {
title = "\\#316BE8\\Tag v2.1: Major Update",
gamemodes = {
"Added " .. get_gamemode(JUGGERNAUT),
"Added " .. get_gamemode(ASSASSINS),
},
modifiers = {
"Added " .. get_modifier_text(MODIFIER_INCOGNITO),
"Improved " .. get_modifier_text(MODIFIER_FLY),
},
romhacks = {
"No romhack changes"
},
levels = {
"No level changes"
},
newFeatures = {
"Added icon next to leaderboard",
"Added update notifier",
}
}
}
showingChangelog = false
selectedChangelog = versions[1]
local firstLaunch = load_bool("firstLaunch")
local changelogVer = load_string("changelogVer")
local bgWidth = djui_hud_get_screen_width() - 400
local bgHeight = djui_hud_get_screen_height() - 30
local scrollOffset = 0
local joystickCooldown = 0
local scrollOffsetClamp = 0
---@param m MarioState
local function mario_update(m)
if firstLaunch == nil then firstLaunch = true end
if firstLaunch then return end
if m.playerIndex ~= 0 then return end
if not isPaused then showingChangelog = false end
if changelogVer ~= versions[1] then
showingChangelog = true
end
if showingChangelog then
if m.controller.buttonPressed & Y_BUTTON ~= 0 then
if changelogVer ~= versions[1] then
changelogVer = versions[1]
save_string("changelogVer", changelogVer)
end
showingChangelog = false
end
joystickCooldown = joystickCooldown - 1
if (m.controller.stickY > 0.5 and joystickCooldown <= 0)
or m.controller.buttonPressed & U_JPAD ~= 0 then
scrollOffset = scrollOffset + 30
joystickCooldown = 0.2 * 30
end
if (m.controller.stickY < -0.5 and joystickCooldown <= 0)
or m.controller.buttonPressed & D_JPAD ~= 0 then
scrollOffset = scrollOffset - 30
joystickCooldown = 0.2 * 30
end
-- clamp
scrollOffset = clamp(scrollOffset, scrollOffsetClamp, 0)
else
scrollOffset = 0
end
end
local function is_within_view(y)
if y + 50 + scrollOffset > bgHeight - 110 then return false end
if y + 50 + scrollOffset < 120 then return false end
return true
end
local function hud_render()
if firstLaunch == nil then firstLaunch = true end
if firstLaunch then return end
if not showingChangelog then return end
local theme = get_selected_theme()
local x = (djui_hud_get_screen_width() / 2) - (bgWidth / 2)
local y = djui_hud_get_screen_height() - bgHeight
djui_hud_set_color(theme.background.r, theme.background.g, theme.background.b, 250)
djui_hud_render_rect_rounded_outlined(x, y / 2, bgWidth, bgHeight, theme.backgroundOutline.r, theme.backgroundOutline.g, theme.backgroundOutline.b, 10, 250)
local changelog = changelogs[selectedChangelog]
local text = ""
if changelog == nil then
text = "No changelog is avaliable for this version"
else
text = changelog.title
end
-- render title
x = (djui_hud_get_screen_width() / 2) - (bgWidth / 2)
y = (djui_hud_get_screen_height() - bgHeight) / 2
djui_hud_set_color(theme.text.r, theme.text.g, theme.text.b, 255)
djui_hud_print_colored_text(text, x + ((bgWidth / 2) - djui_hud_measure_text(strip_hex(text))), y + 50, 2)
if changelog == nil then return end
-- render gamemode header
x = x + 10
y = y + 60
if not is_within_view(y) then goto endgamemodeheader end
text = "Gamemodes"
djui_hud_set_color(theme.text.r, theme.text.g, theme.text.b, 255)
djui_hud_print_colored_text(text, x, y + 50 + scrollOffset, 1.1)
::endgamemodeheader::
y = y + 15
for _, s in ipairs(changelog.gamemodes) do
text = "- " .. s
local wrappedText = wrap_text(text, bgWidth - 30)
for _, wS in ipairs(wrappedText) do
y = y + 30
if not is_within_view(y) then goto continue end
djui_hud_set_color(theme.text.r, theme.text.g, theme.text.b, 255)
djui_hud_print_colored_text(wS, x, y + 50 + scrollOffset, 1)
::continue::
end
end
-- render modifier header
y = y + 45
if not is_within_view(y) then goto endmodifierheader end
text = "Modifiers"
djui_hud_set_color(theme.text.r, theme.text.g, theme.text.b, 255)
djui_hud_print_colored_text(text, x, y + 50 + scrollOffset, 1.1)
::endmodifierheader::
y = y + 15
for _, s in ipairs(changelog.modifiers) do
text = "- " .. s
local wrappedText = wrap_text(text, bgWidth - 30)
for _, wS in ipairs(wrappedText) do
y = y + 30
if not is_within_view(y) then goto continue end
djui_hud_set_color(theme.text.r, theme.text.g, theme.text.b, 255)
djui_hud_print_colored_text(wS, x, y + 50 + scrollOffset, 1)
::continue::
end
end
-- render romhack header
y = y + 45
if not is_within_view(y) then goto endromhackheader end
text = "Romhacks"
djui_hud_set_color(theme.text.r, theme.text.g, theme.text.b, 255)
djui_hud_print_colored_text(text, x, y + 50 + scrollOffset, 1.1)
::endromhackheader::
y = y + 15
for _, s in ipairs(changelog.romhacks) do
text = "- " .. s
local wrappedText = wrap_text(text, bgWidth - 30)
for _, wS in ipairs(wrappedText) do
y = y + 30
if not is_within_view(y) then goto continue end
djui_hud_set_color(theme.text.r, theme.text.g, theme.text.b, 255)
djui_hud_print_colored_text(wS, x, y + 50 + scrollOffset, 1)
::continue::
end
end
-- render levels header
y = y + 45
if not is_within_view(y) then goto endlevelsheader end
text = "Levels"
djui_hud_set_color(theme.text.r, theme.text.g, theme.text.b, 255)
djui_hud_print_colored_text(text, x, y + 50 + scrollOffset, 1.1)
::endlevelsheader::
y = y + 15
for _, s in ipairs(changelog.levels) do
text = "- " .. s
local wrappedText = wrap_text(text, bgWidth - 30)
for _, wS in ipairs(wrappedText) do
y = y + 30
if not is_within_view(y) then goto continue end
djui_hud_set_color(theme.text.r, theme.text.g, theme.text.b, 255)
djui_hud_print_colored_text(wS, x, y + 50 + scrollOffset, 1)
::continue::
end
end
-- render new features
y = y + 45
if not is_within_view(y) then goto endnewfeaturesheader end
text = "New Features"
djui_hud_set_color(theme.text.r, theme.text.g, theme.text.b, 255)
djui_hud_print_colored_text(text, x, y + 50 + scrollOffset, 1.1)
::endnewfeaturesheader::
y = y + 15
for _, s in ipairs(changelog.newFeatures) do
text = "- " .. s
local wrappedText = wrap_text(text, bgWidth - 30)
for _, wS in ipairs(wrappedText) do
y = y + 30
if not is_within_view(y) then goto continue end
djui_hud_set_color(theme.text.r, theme.text.g, theme.text.b, 255)
djui_hud_print_colored_text(wS, x, y + 50 + scrollOffset, 1)
::continue::
end
end
-- render scrollbar based off of current y pos and scrollOffset
x = (djui_hud_get_screen_width() / 2) + (bgWidth / 2 - 8) - 4
local scrollY = djui_hud_get_screen_height() / 2 - bgHeight / 2 + 6
-- set height to the max amount you can scroll
local height = bgHeight
height = height - clamp(y + 50 - (bgHeight - 110), 0, y + 50 - (bgHeight - 110)) - 16
-- increment y counter
scrollY = scrollY - scrollOffset
-- set scroll offset clamp
scrollOffsetClamp = -clamp(y + 50 - (bgHeight - 110), 0, y + 50 - (bgHeight - 110))
djui_hud_set_color(theme.backgroundOutline.r, theme.backgroundOutline.g, theme.backgroundOutline.b, 250)
djui_hud_render_rect_rounded(x, scrollY, 8, height, 8)
-- render complete text
text = "Press Y to dismiss"
-- render title
x = (djui_hud_get_screen_width() / 2) - (bgWidth / 2)
y = bgHeight
djui_hud_set_color(theme.text.r, theme.text.g, theme.text.b, 255)
djui_hud_print_colored_text(text, x + ((bgWidth / 2) - djui_hud_measure_text(strip_hex(text))), y - 50, 2)
end
hook_event(HOOK_MARIO_UPDATE, mario_update)
hook_event(HOOK_ON_HUD_RENDER, hud_render)