-
-
Notifications
You must be signed in to change notification settings - Fork 106
Expand file tree
/
Copy pathmain_menu.lua
More file actions
110 lines (105 loc) · 2.62 KB
/
Copy pathmain_menu.lua
File metadata and controls
110 lines (105 loc) · 2.62 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
local game_main_menu_ref = Game.main_menu
---@diagnostic disable-next-line: duplicate-set-field
function Game:main_menu(change_context)
local ret = game_main_menu_ref(self, change_context)
Add_custom_multiplayer_cards(change_context)
Add_version_display()
MP.UI.show_dev_build_warning()
return ret
end
-- Modify play button to take you to mode select first
local create_UIBox_main_menu_buttonsRef = create_UIBox_main_menu_buttons
---@diagnostic disable-next-line: lowercase-global
function create_UIBox_main_menu_buttons()
local menu = create_UIBox_main_menu_buttonsRef()
menu.nodes[1].nodes[1].nodes[1].nodes[1].config.button = "play_options"
return menu
end
G.FUNCS.wipe_off = function()
G.E_MANAGER:add_event(Event({
no_delete = true,
func = function()
delay(0.3)
if not G.screenwipe then return true end
G.screenwipe.children.particles.max = 0
G.E_MANAGER:add_event(Event({
trigger = "ease",
no_delete = true,
blockable = false,
blocking = false,
timer = "REAL",
ref_table = G.screenwipe.colours.black,
ref_value = 4,
ease_to = 0,
delay = 0.3,
func = function(t)
return t
end,
}))
G.E_MANAGER:add_event(Event({
trigger = "ease",
no_delete = true,
blockable = false,
blocking = false,
timer = "REAL",
ref_table = G.screenwipe.colours.white,
ref_value = 4,
ease_to = 0,
delay = 0.3,
func = function(t)
return t
end,
}))
return true
end,
}))
G.E_MANAGER:add_event(Event({
trigger = "after",
delay = 0.55,
no_delete = true,
blocking = false,
timer = "REAL",
func = function()
if not G.screenwipe then return true end
if G.screenwipecard then G.screenwipecard:start_dissolve({ G.C.BLACK, G.C.ORANGE, G.C.GOLD, G.C.RED }) end
if G.screenwipe:get_UIE_by_ID("text") then
for k, v in ipairs(G.screenwipe:get_UIE_by_ID("text").children) do
v.children[1].config.object:pop_out(4)
end
end
return true
end,
}))
G.E_MANAGER:add_event(Event({
trigger = "after",
delay = 1.1,
no_delete = true,
blocking = false,
timer = "REAL",
func = function()
if not G.screenwipe then return true end
G.screenwipe.children.particles:remove()
G.screenwipe:remove()
G.screenwipe.children.particles = nil
G.screenwipe = nil
G.screenwipecard = nil
return true
end,
}))
G.E_MANAGER:add_event(Event({
trigger = "after",
delay = 1.2,
no_delete = true,
blocking = true,
timer = "REAL",
func = function()
return true
end,
}))
end
function MP.UI.update_player_usernames()
if MP.LOBBY.code then
if G.MAIN_MENU_UI then G.MAIN_MENU_UI:remove() end
set_main_menu_UI()
end
end