aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts/vscripts/lobby/_private_lobby.gnut
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-10-14 21:01:40 +0100
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-10-14 21:01:40 +0100
commit9a2778eabc7ba968968e41dda9f03525d6c5383d (patch)
tree6d1c5dc64754d542d68a7f47742a701a4eec9308 /Northstar.CustomServers/mod/scripts/vscripts/lobby/_private_lobby.gnut
parentc0a0c7e502f2bc99185d79a485b965f63de7a203 (diff)
downloadNorthstarMods-9a2778eabc7ba968968e41dda9f03525d6c5383d.tar.gz
NorthstarMods-9a2778eabc7ba968968e41dda9f03525d6c5383d.zip
oh fuck i forgot to commit for a while
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts/lobby/_private_lobby.gnut')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/lobby/_private_lobby.gnut15
1 files changed, 15 insertions, 0 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/lobby/_private_lobby.gnut b/Northstar.CustomServers/mod/scripts/vscripts/lobby/_private_lobby.gnut
index 60daa4528..63b2c81ac 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/lobby/_private_lobby.gnut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/lobby/_private_lobby.gnut
@@ -13,6 +13,11 @@ void function PrivateLobby_Init()
print( "PrivateLobby_Init()" )
//ClearPlaylistVarOverrides()
+ file.map = GetConVarString( "ns_private_match_last_map" )
+ file.mode = GetConVarString( "ns_private_match_last_mode" )
+
+ thread SetupPrivateMatchUIVarsWhenReady()
+
AddClientCommandCallback( "PrivateMatchLaunch", ClientCommandCallback_PrivateMatchLaunch )
AddClientCommandCallback( "PrivateMatchSetMode", ClientCommandCallback_PrivateMatchSetMode )
AddClientCommandCallback( "SetCustomMap", ClientCommandCallback_SetCustomMap )
@@ -22,6 +27,14 @@ void function PrivateLobby_Init()
AddClientCommandCallback( "ResetMatchSettingsToDefault", ClientCommandCallback_ResetMatchSettingsToDefault )
}
+void function SetupPrivateMatchUIVarsWhenReady()
+{
+ // have to wait until end of first frame for SetUIVar to work
+ WaitEndFrame()
+ SetUIVar( level, "privatematch_map", GetPrivateMatchMapIndex( file.map ) )
+ SetUIVar( level, "privatematch_mode", GetPrivateMatchModeIndex( file.mode ) )
+}
+
bool function ClientCommandCallback_PrivateMatchLaunch( entity player, array<string> args )
{
if ( file.startState == ePrivateMatchStartState.STARTING )
@@ -127,6 +140,8 @@ void function StartMatch()
RefreshPlayerTeams()
+ SetConVarString( "ns_private_match_last_map", file.map )
+ SetConVarString( "ns_private_match_last_mode", file.mode )
SetConVarBool( "ns_should_return_to_lobby", true ) // potentially temp?
// TEMP for now: start game