aboutsummaryrefslogtreecommitdiff
path: root/Northstar.Client/mod/scripts
diff options
context:
space:
mode:
authorRemy Raes <raes.remy@gmail.com>2021-12-25 23:45:33 +0100
committerRemy Raes <raes.remy@gmail.com>2021-12-25 23:45:33 +0100
commit2dbabfcfbccb83a629a747f33ccef21889349138 (patch)
tree24d7176507553af7ac03ac54093a803a8ad06eff /Northstar.Client/mod/scripts
parente93893cc0083c94044048f920a34fb46bc448b9a (diff)
parente4faa247edaf389d4d52e3a3129af540bb19a0ac (diff)
downloadNorthstarMods-2dbabfcfbccb83a629a747f33ccef21889349138.tar.gz
NorthstarMods-2dbabfcfbccb83a629a747f33ccef21889349138.zip
Merge branch 'main' into chore/french-translations
Diffstat (limited to 'Northstar.Client/mod/scripts')
-rw-r--r--Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut20
1 files changed, 13 insertions, 7 deletions
diff --git a/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut b/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut
index de4a663e..03009764 100644
--- a/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut
+++ b/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut
@@ -127,7 +127,18 @@ void function UpdateShownPage()
Hud_SetVisible( Hud_GetChild( menu, "NextModeIcon" ), false )
Hud_SetVisible( Hud_GetChild( menu, "NextGameModeName" ), false )
- for ( int i = 0; ( file.page * BUTTONS_PER_PAGE ) + i < NSGetServerCount() - 1 && i < serverButtons.len(); i++ )
+ if ( NSGetServerCount() == 0 )
+ {
+ Hud_SetEnabled( serverButtons[ 0 ], true )
+ Hud_SetVisible( serverButtons[ 0 ], true )
+ SetButtonRuiText( serverButtons[ 0 ], "#NS_SERVERBROWSER_NOSERVERS" )
+ return
+ }
+
+ // this trycatch likely isn't necessary, but i can't test whether this'll error on higher pagecounts and want to go sleep
+ try
+ {
+ for ( int i = 0; ( file.page * BUTTONS_PER_PAGE ) + i < NSGetServerCount() && i < serverButtons.len(); i++ )
{
int serverIndex = ( file.page * BUTTONS_PER_PAGE ) + i
@@ -135,13 +146,8 @@ void function UpdateShownPage()
Hud_SetVisible( serverButtons[ i ], true )
SetButtonRuiText( serverButtons[ i ], NSGetServerName( serverIndex ) )
}
-
- if ( NSGetServerCount() == 0 )
- {
- Hud_SetEnabled( serverButtons[ 0 ], true )
- Hud_SetVisible( serverButtons[ 0 ], true )
- SetButtonRuiText( serverButtons[ 0 ], "#NS_SERVERBROWSER_NOSERVERS" )
}
+ catch(ex) {}
}
void function OnServerFocused( var button )