-
Notifications
You must be signed in to change notification settings - Fork 0
/
re.lua
41 lines (40 loc) · 1.02 KB
/
re.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
if game_state_machine and Network and ReLUA then
local state = game_state_machine:current_state_name()
if state == "menu_main" then
-- menu
if not Network:multiplayer() then
-- RESTART: main menu
ReLUA:reset_menu()
else
-- RESTART: lobby
if ReLUA:GetOption("relua_show_warn") then
ReLUA:yesno(ReLUA.reset_lobby)
else
ReLUA:reset_lobby()
end
end
elseif state == "ingame_lobby_menu" or
state == "ingame_waiting_for_respawn" or
state == "ingame_waiting_for_players" or
state == "ingame_mask_off" or
state == "ingame_standard" then
-- in game
if Network:is_server() then
-- RESTART: as host
if ReLUA:GetOption("relua_show_warn") then
ReLUA:yesno(ReLUA.reset_server)
else
ReLUA:reset_server()
end
else
-- RESTART: as client (reconnect)
if ReLUA:GetOption("relua_show_warn") then
ReLUA:yesno(ReLUA.reset_client)
else
ReLUA:reset_client()
end
end
elseif state == "disconnected" then
-- do nothing
end
end