aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts/vscripts/lobby
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
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')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/lobby/_private_lobby.gnut15
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/lobby/sh_lobby.gnut23
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/lobby/sh_private_lobby_modes_init.gnut2
3 files changed, 39 insertions, 1 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/lobby/_private_lobby.gnut b/Northstar.CustomServers/mod/scripts/vscripts/lobby/_private_lobby.gnut
index 60daa452..63b2c81a 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
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/lobby/sh_lobby.gnut b/Northstar.CustomServers/mod/scripts/vscripts/lobby/sh_lobby.gnut
index 2c02ebdc..605b23fd 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/lobby/sh_lobby.gnut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/lobby/sh_lobby.gnut
@@ -189,11 +189,32 @@ void function AddPrivateMatchModeSettingEnumEx( string category, string playlist
#endif
}
-array< string > function GetPrivateMatchSettingCategories()
+array< string > function GetPrivateMatchSettingCategories( bool uiAllowAllModeCategories = false )
{
array< string > categories
foreach ( string k, v in file.customMatchSettingsByCategory )
+ {
+ // can only do this in ui because it relies on GetUIVar
+ #if UI
+ bool gamemode = k.find( "#GAMEMODE_" ) == 0
+ if ( !uiAllowAllModeCategories && ( gamemode || k.find( "#PL_" ) == 0 ) )
+ {
+ if ( gamemode )
+ {
+ if ( k.slice( 10 ) != PrivateMatch_GetSelectedMode() )
+ {
+ continue
+ }
+ }
+ else if ( k.slice( 4 ) != PrivateMatch_GetSelectedMode() )
+ {
+ continue
+ }
+ }
+ #endif
+
categories.append( k )
+ }
return categories
}
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/lobby/sh_private_lobby_modes_init.gnut b/Northstar.CustomServers/mod/scripts/vscripts/lobby/sh_private_lobby_modes_init.gnut
index 8991ebb0..5cd4de50 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/lobby/sh_private_lobby_modes_init.gnut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/lobby/sh_private_lobby_modes_init.gnut
@@ -4,6 +4,8 @@ void function PrivateMatchModesInit()
{
// match settings
// super temp: do localisation strings later
+ AddPrivateMatchModeSettingEnum( "#MODE_SETTING_CATEGORY_MATCH", "classic_mp", [ "Disabled", "Enabled" ], "1" )
+ AddPrivateMatchModeSettingEnum( "#MODE_SETTING_CATEGORY_MATCH", "run_epilogue", [ "Disabled", "Enabled" ], "1" )
AddPrivateMatchModeSettingArbitrary( "#MODE_SETTING_CATEGORY_MATCH", "scorelimit", "5" ) //, "Score Limit" )
AddPrivateMatchModeSettingArbitrary( "#MODE_SETTING_CATEGORY_MATCH", "roundscorelimit", "0" ) //, "Score Limit (round-based modes)" )
AddPrivateMatchModeSettingArbitrary( "#MODE_SETTING_CATEGORY_MATCH", "timelimit", "12" ) //, "Time Limit" )