11--
2- -- startDeathmatchClient : initializes the deathmatch client
2+ -- startGamemodeClient : initializes the gamemode client
33--
4- local function startDeathmatchClient ()
4+ local function startGamemodeClient ()
55 -- add scoreboard columns
66 exports .scoreboard :scoreboardAddColumn (" Score" )
77 exports .scoreboard :scoreboardAddColumn (" Rank" )
@@ -13,27 +13,25 @@ local function startDeathmatchClient()
1313 if getElementData (resourceRoot , " gameState" ) == GAME_IN_PROGRESS then
1414 setCameraMatrix (unpack (calculateLoadingCameraMatrix ()))
1515 end
16- -- inform server we are ready to play
17- triggerServerEvent (" onDeathmatchPlayerReady" , localPlayer )
1816end
19- addEventHandler (" onClientResourceStart" , resourceRoot , startDeathmatchClient )
17+ addEventHandler (" onClientResourceStart" , resourceRoot , startGamemodeClient )
2018
2119--
22- -- stopDeathmatchClient : cleans up the deathmatch client
20+ -- stopGamemodeClient : cleans up the gamemode client
2321--
24- local function stopDeathmatchClient ()
22+ local function stopGamemodeClient ()
2523 -- remove scoreboard columns
2624 exports .scoreboard :scoreboardRemoveColumn (" Score" )
2725 exports .scoreboard :scoreboardRemoveColumn (" Rank" )
2826 -- hide scoreboard
2927 exports .scoreboard :setScoreboardForced (false )
3028end
31- addEventHandler (" onClientResourceStop" , resourceRoot , stopDeathmatchClient )
29+ addEventHandler (" onClientResourceStop" , resourceRoot , stopGamemodeClient )
3230
3331--
34- -- startDeathmatchMap : triggered when a deathmatch map starts
32+ -- startGamemodeMap : triggered when a gamemode map starts
3533--
36- local function startDeathmatchMap (mapTitle , mapAuthor , fragLimit , respawnTime )
34+ local function startGamemodeMap (mapTitle , mapAuthor , fragLimit , respawnTime )
3735 -- apply the loading camera matrix - used to stream-in map elements
3836 setCameraMatrix (unpack (calculateLoadingCameraMatrix ()))
3937 -- hide end screen and scoreboard
@@ -48,13 +46,13 @@ local function startDeathmatchMap(mapTitle, mapAuthor, fragLimit, respawnTime)
4846 _hud .loadingScreen :update ()
4947 _hud .loadingScreen :setVisible (true )
5048end
51- addEvent (" onClientDeathmatchMapStart " , true )
52- addEventHandler (" onClientDeathmatchMapStart " , resourceRoot , startDeathmatchMap )
49+ addEvent (" onClientGamemodeMapStart " , true )
50+ addEventHandler (" onClientGamemodeMapStart " , resourceRoot , startGamemodeMap )
5351
5452--
55- -- stopDeathmatchMap : triggered when a deathmatch map stops
53+ -- stopGamemodeMap : triggered when a gamemode map stops
5654--
57- local function stopDeathmatchMap ()
55+ local function stopGamemodeMap ()
5856 -- clear stored map data
5957 _mapTitle = nil
6058 _mapAuthor = nil
@@ -63,13 +61,13 @@ local function stopDeathmatchMap()
6361 -- hide loading text
6462 _hud .loadingScreen :setVisible (false )
6563end
66- addEvent (" onClientDeathmatchMapStop " , true )
67- addEventHandler (" onClientDeathmatchMapStop " , resourceRoot , stopDeathmatchMap )
64+ addEvent (" onClientGamemodeMapStop " , true )
65+ addEventHandler (" onClientGamemodeMapStop " , resourceRoot , stopGamemodeMap )
6866
6967--
70- -- startDeathmatchRound : triggered when a round begins
68+ -- startGamemodeRound : triggered when a round begins
7169--
72- local function startDeathmatchRound ()
70+ local function startGamemodeRound ()
7371 -- attach player wasted handler
7472 addEventHandler (" onClientPlayerWasted" , localPlayer , _hud .respawnScreen .startCountdown )
7573 -- attach element data change handler
@@ -82,13 +80,13 @@ local function startDeathmatchRound()
8280 _hud .scoreDisplay :update ()
8381 _hud .scoreDisplay :setVisible (true )
8482end
85- addEvent (" onClientDeathmatchRoundStart " , true )
86- addEventHandler (" onClientDeathmatchRoundStart " , resourceRoot , startDeathmatchRound )
83+ addEvent (" onClientGamemodeRoundStart " , true )
84+ addEventHandler (" onClientGamemodeRoundStart " , resourceRoot , startGamemodeRound )
8785
8886--
89- -- stopDeathmatchRound : triggered when a round ends
87+ -- stopGamemodeRound : triggered when a round ends
9088--
91- local function stopDeathmatchRound (winner , draw , aborted )
89+ local function stopGamemodeRound (winner , draw , aborted )
9290 -- remove player wasted handler and hide respawn screen if active
9391 removeEventHandler (" onClientPlayerWasted" , localPlayer , _hud .respawnScreen .startCountdown )
9492 _hud .respawnScreen .setVisible (false )
@@ -110,8 +108,8 @@ local function stopDeathmatchRound(winner, draw, aborted)
110108 _hud .endScreen :setVisible (true )
111109 exports .scoreboard :setScoreboardForced (true )
112110end
113- addEvent (" onClientDeathmatchRoundEnd " , true )
114- addEventHandler (" onClientDeathmatchRoundEnd " , resourceRoot , stopDeathmatchRound )
111+ addEvent (" onClientGamemodeRoundEnd " , true )
112+ addEventHandler (" onClientGamemodeRoundEnd " , resourceRoot , stopGamemodeRound )
115113
116114--
117115-- elementDataChange: triggered when element data changes - used to track score changes
0 commit comments