Skip to content

Commit

Permalink
Merge branch 'R2Northstar:main' into northstar_tether_trap_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Zanieon authored Oct 11, 2023
2 parents ec2e780 + bdb2fa3 commit 369edeb
Show file tree
Hide file tree
Showing 11 changed files with 232 additions and 87 deletions.
4 changes: 2 additions & 2 deletions Northstar.Client/mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@
{
"Name": "modlist_show_convars",
"DefaultValue": "0",
"Flags": 16777216
"Flags": "ARCHIVE_PLAYERPROFILE"
},
{
"Name": "modlist_reverse",
"DefaultValue": "0",
"Flags": 16777216
"Flags": "ARCHIVE_PLAYERPROFILE"
}
],
"Scripts": [
Expand Down
45 changes: 11 additions & 34 deletions Northstar.Client/mod/scripts/vscripts/ui/menu_lobby.nut
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down
18 changes: 5 additions & 13 deletions Northstar.Client/mod/scripts/vscripts/ui/menu_mode_select.nut
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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 )
}
}

Expand Down Expand Up @@ -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 ) )
Expand All @@ -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
Expand Down
19 changes: 2 additions & 17 deletions Northstar.Client/mod/scripts/vscripts/ui/menu_private_match.nut
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand All @@ -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" )
Expand Down Expand Up @@ -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 )
Expand Down Expand Up @@ -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] ) + ": "
Expand Down
5 changes: 4 additions & 1 deletion Northstar.Client/mod/scripts/vscripts/ui/openinvites.nut
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 0 additions & 2 deletions Northstar.Client/mod/scripts/vscripts/ui/panel_mainmenu.nut
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()
}
}
Expand Down
11 changes: 1 addition & 10 deletions Northstar.CustomServers/mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,14 @@
"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"
},
{
"Name": "ns_allow_spectators",
"DefaultValue": "0",
"Flags": 8192
"Flags": "REPLICATED"
},
{
"Name": "ns_private_match_last_mode",
Expand Down
12 changes: 12 additions & 0 deletions Northstar.CustomServers/mod/scripts/vscripts/_items.nut
Original file line number Diff line number Diff line change
Expand Up @@ -5700,6 +5700,12 @@ bool function IsSubItemLocked( entity player, string ref, string parentRef )
{
if ( DevEverythingUnlocked( player ) )
return false

if ( IsItemPurchasableEntitlement( ref, parentRef ) )
return false

if ( GetItemType( ref ) == eItemTypes.PRIME_TITAN || GetSubitemType( parentRef, ref ) == eItemTypes.PRIME_TITAN )
return false

if ( IsItemInEntitlementUnlock( ref, parentRef ) )
{
Expand Down Expand Up @@ -5819,6 +5825,12 @@ bool function IsItemLocked( entity player, string ref )
{
if ( DevEverythingUnlocked( player ) )
return false

if ( IsItemPurchasableEntitlement( ref ) )
return false

if ( GetItemType( ref ) == eItemTypes.PRIME_TITAN )
return false

if ( IsItemInEntitlementUnlock( ref ) )
{
Expand Down
Loading

0 comments on commit 369edeb

Please sign in to comment.