Remove unnecessary convars (#530)

Removes some convars we don't need at all
This commit is contained in:
BobTheBob 2023-10-10 16:41:48 +01:00 committed by GitHub
parent 70c599a345
commit add7305318
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 22 additions and 82 deletions

View File

@ -288,44 +288,21 @@ void function SetupComboButtonTest( var menu )
int buttonIndex = 0
file.playHeader = AddComboButtonHeader( comboStruct, headerIndex, "#MENU_HEADER_PLAY" )
bool isModded = IsNorthstarServer()
// this will be the server browser
if ( isModded )
{
file.findGameButton = AddComboButton( comboStruct, headerIndex, buttonIndex++, "#MENU_TITLE_SERVER_BROWSER" )
file.lobbyButtons.append( file.findGameButton )
Hud_SetLocked( file.findGameButton, true )
Hud_AddEventHandler( file.findGameButton, UIE_CLICK, OpenServerBrowser )
}
else
{
file.findGameButton = AddComboButton( comboStruct, headerIndex, buttonIndex++, "#MENU_TITLE_FIND_GAME" )
file.lobbyButtons.append( file.findGameButton )
Hud_AddEventHandler( file.findGameButton, UIE_CLICK, BigPlayButton1_Activate )
}
// server browser
file.findGameButton = AddComboButton( comboStruct, headerIndex, buttonIndex++, "#MENU_TITLE_SERVER_BROWSER" )
file.lobbyButtons.append( file.findGameButton )
Hud_SetLocked( file.findGameButton, true )
Hud_AddEventHandler( file.findGameButton, UIE_CLICK, OpenServerBrowser )
// this is used for launching private matches now
if ( isModded )
{
file.inviteRoomButton = AddComboButton( comboStruct, headerIndex, buttonIndex++, "#PRIVATE_MATCH" )
Hud_AddEventHandler( file.inviteRoomButton, UIE_CLICK, StartPrivateMatch )
}
else
{
file.inviteRoomButton = AddComboButton( comboStruct, headerIndex, buttonIndex++, "#MENU_TITLE_INVITE_ROOM" )
Hud_AddEventHandler( file.inviteRoomButton, UIE_CLICK, DoRoomInviteIfAllowed )
}
// private match
file.inviteRoomButton = AddComboButton( comboStruct, headerIndex, buttonIndex++, "#PRIVATE_MATCH" )
Hud_AddEventHandler( file.inviteRoomButton, UIE_CLICK, StartPrivateMatch )
file.inviteFriendsButton = AddComboButton( comboStruct, headerIndex, buttonIndex++, "#MENU_TITLE_INVITE_FRIENDS" )
Hud_AddEventHandler( file.inviteFriendsButton, UIE_CLICK, InviteFriendsIfAllowed )
if ( isModded )
{
Hud_SetEnabled( file.inviteFriendsButton, false )
Hud_SetVisible( file.inviteFriendsButton, false )
}
Hud_SetEnabled( file.inviteFriendsButton, false )
Hud_SetVisible( file.inviteFriendsButton, false )
// file.toggleMenuModeButton = AddComboButton( comboStruct, headerIndex, buttonIndex++, "#MENU_LOBBY_SWITCH_FD" )
// Hud_AddEventHandler( file.toggleMenuModeButton, UIE_CLICK, ToggleLobbyMode )

View File

@ -18,8 +18,8 @@ void function InitModesMenu()
AddMenuFooterOption( menu, BUTTON_A, "#A_BUTTON_SELECT" )
AddMenuFooterOption( menu, BUTTON_B, "#B_BUTTON_BACK", "#BACK" )
AddMenuFooterOption( menu, BUTTON_SHOULDER_LEFT, "#PRIVATE_MATCH_PAGE_PREV", "#PRIVATE_MATCH_PAGE_PREV", CycleModesBack, IsNorthstarServer )
AddMenuFooterOption( menu, BUTTON_SHOULDER_RIGHT, "#PRIVATE_MATCH_PAGE_NEXT", "#PRIVATE_MATCH_PAGE_NEXT", CycleModesForward, IsNorthstarServer )
AddMenuFooterOption( menu, BUTTON_SHOULDER_LEFT, "#PRIVATE_MATCH_PAGE_PREV", "#PRIVATE_MATCH_PAGE_PREV", CycleModesBack )
AddMenuFooterOption( menu, BUTTON_SHOULDER_RIGHT, "#PRIVATE_MATCH_PAGE_NEXT", "#PRIVATE_MATCH_PAGE_NEXT", CycleModesForward )
}
void function OnOpenModesMenu()
@ -56,13 +56,7 @@ void function UpdateVisibleModes()
if ( !ModeSettings_RequiresAI( modesArray[ modeIndex ] ) || modesArray[ modeIndex ] == "aitdm" || modesArray[ modeIndex ] == "at" )
Hud_SetLocked( buttons[ i ], false )
else
Hud_SetLocked( buttons[ i ], true )
if ( !PrivateMatch_IsValidMapModeCombo( PrivateMatch_GetSelectedMap(), modesArray[ modeIndex ] ) && !IsNorthstarServer() )
{
Hud_SetLocked( buttons[ i ], true )
SetButtonRuiText( buttons[ i ], Localize( "#PRIVATE_MATCH_UNAVAILABLE", Localize( GetGameModeDisplayName( modesArray[ modeIndex ] ) ) ) )
}
Hud_SetLocked( buttons[ i ], true )
}
}
@ -90,9 +84,7 @@ void function ModeButton_GetFocus( var button )
string mapName = PrivateMatch_GetSelectedMap()
bool mapSupportsMode = PrivateMatch_IsValidMapModeCombo( mapName, modeName )
if ( !mapSupportsMode && !IsNorthstarServer() )
Hud_SetText( nextModeDesc, Localize( "#PRIVATE_MATCH_MODE_NO_MAP_SUPPORT", Localize( GetGameModeDisplayName( modeName ) ), Localize( GetMapDisplayName( mapName ) ) ) )
else if ( IsFDMode( modeName ) ) // HACK!
if ( IsFDMode( modeName ) ) // HACK!
Hud_SetText( nextModeDesc, Localize( "#FD_PLAYERS_DESC", Localize( GetGameModeDisplayHint( modeName ) ) ) )
else
Hud_SetText( nextModeDesc, GetGameModeDisplayHint( modeName ) )
@ -114,7 +106,7 @@ void function ModeButton_Click( var button )
// on modded servers set us to the first map for that mode automatically
// need this for coliseum mainly which is literally impossible to select without this
if ( IsNorthstarServer() && !PrivateMatch_IsValidMapModeCombo( PrivateMatch_GetSelectedMap(), modesArray[ modeID ] ) )
if ( !PrivateMatch_IsValidMapModeCombo( PrivateMatch_GetSelectedMap(), modesArray[ modeID ] ) )
ClientCommand( "SetCustomMap " + GetPrivateMatchMapsForMode( modeName )[ 0 ] )
// set it

View File

@ -247,10 +247,7 @@ void function OnSelectMatchSettings_Activate( var button )
if ( Hud_IsLocked( button ) )
return
if ( !IsNorthstarServer() )
AdvanceMenu( GetMenu( "MatchSettingsMenu" ) )
else
AdvanceMenu( GetMenu( "CustomMatchSettingsCategoryMenu" ) )
AdvanceMenu( GetMenu( "CustomMatchSettingsCategoryMenu" ) )
}
void function SetupComboButtons( var menu, var navUpButton, var navDownButton )
@ -274,13 +271,6 @@ void function SetupComboButtons( var menu, var navUpButton, var navDownButton )
file.matchSettingsButton = AddComboButton( comboStruct, headerIndex, buttonIndex++, "#MENU_TITLE_MATCH_SETTINGS" )
Hud_AddEventHandler( file.matchSettingsButton, UIE_CLICK, OnSelectMatchSettings_Activate )
if ( !IsNorthstarServer() )
{
var friendsButton = AddComboButton( comboStruct, headerIndex, buttonIndex++, "#MENU_TITLE_INVITE_FRIENDS" )
file.inviteFriendsButton = friendsButton
Hud_AddEventHandler( friendsButton, UIE_CLICK, InviteFriendsIfAllowed )
}
headerIndex++
buttonIndex = 0
file.customizeHeader = AddComboButtonHeader( comboStruct, headerIndex, "#MENU_HEADER_LOADOUTS" )
@ -575,17 +565,12 @@ function UpdatePrivateMatchButtons()
Hud_SetLocked( file.selectMapButton, true )
Hud_SetLocked( file.selectModeButton, true )
Hud_SetLocked( file.matchSettingsButton, true )
if ( !IsNorthstarServer() )
Hud_SetLocked( file.inviteFriendsButton, true )
}
else
{
RHud_SetText( file.startMatchButton, "#START_MATCH" )
Hud_SetLocked( file.selectMapButton, false )
Hud_SetLocked( file.selectModeButton, false )
if ( !IsNorthstarServer() )
Hud_SetLocked( file.inviteFriendsButton, false )
string modeName = PrivateMatch_GetSelectedMode()
bool settingsLocked = IsFDMode( modeName )
@ -648,7 +633,7 @@ function UpdateLobby()
{
float varOrigVal = float( GetCurrentPlaylistGamemodeByIndexVar( gamemodeIdx, varName, false ) )
float varOverrideVal = float( GetCurrentPlaylistGamemodeByIndexVar( gamemodeIdx, varName, true ) )
if ( varOrigVal == varOverrideVal && !IsNorthstarServer() ) // stuff seems to break outside of northstar servers since we dont always use private_match playlist
if ( varOrigVal == varOverrideVal ) // stuff seems to break outside of northstar servers since we dont always use private_match playlist
continue
string label = Localize( MatchSettings_PlaylistVarLabels[varName] ) + ": "

View File

@ -202,7 +202,10 @@ void function UpdateOpenInvite_Thread()
void function UICodeCallback_OpenInviteUpdated()
{
if ( file.openInviteVisible || IsNorthstarServer() )
// don't support on northstar
return
if ( file.openInviteVisible )
return
int currentPartySize = GetPartySize()

View File

@ -531,7 +531,6 @@ void function OnPlayFDButton_Activate( var button ) // repurposed for launching
{
if ( !Hud_IsLocked( button ) )
{
SetConVarBool( "ns_is_modded_server", true )
SetConVarString( "communities_hostname", "" ) // disable communities due to crash exploits that are still possible through it
NSTryAuthWithLocalServer()
thread TryAuthWithLocalServer()
@ -601,7 +600,6 @@ void function OnPlayMPButton_Activate( var button )
{
Lobby_SetAutoFDOpen( false )
// Lobby_SetFDMode( false )
SetConVarBool( "ns_is_modded_server", false )
thread file.mpButtonActivateFunc()
}
}

View File

@ -4,15 +4,6 @@
"Version": "1.19.0",
"LoadPriority": 0,
"ConVars": [
{
"Name": "ns_lobby_type",
"DefaultValue": "0"
},
{
"Name": "ns_is_modded_server",
"DefaultValue": "1",
"Flags": 8192
},
{
"Name": "ns_should_return_to_lobby",
"DefaultValue": "1"

View File

@ -1,11 +1,5 @@
globalize_all_functions
// whether the server is a modded, northstar server
bool function IsNorthstarServer()
{
return GetConVarBool( "ns_is_modded_server" )
}
// whether the game should return to the lobby on GameRules_EndMatch()
bool function ShouldReturnToLobby()
{