From 3393142c717b4f450fda77e5a1f11b2573590cd5 Mon Sep 17 00:00:00 2001 From: F1F7Y Date: Thu, 30 Dec 2021 18:38:16 +0100 Subject: Fix out of range array access; add server count --- Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut | 5 +++++ 1 file changed, 5 insertions(+) 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 dd2f8864..15622a2f 100644 --- a/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut +++ b/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut @@ -742,6 +742,7 @@ void function FilterServerList() printt("---------------------------------------------") Hud_SetText( Hud_GetChild( file.menu, "InGamePlayerCount" ), string( totalPlayers ) ) + Hud_SetText( Hud_GetChild( file.menu, "TotalServerCount" ), string( NSGetServerCount() ) ) } void function CheckGamemode( serverStruct t ) @@ -817,6 +818,9 @@ void function OnServerButtonClicked(var button) void function CheckDoubleClick(int scriptID, bool wasClickNav) { + if ( NSGetServerCount() == 0 ) return + + file.focusedServerIndex = file.serversArrayFiltered[ file.scrollOffset + scriptID ].serverIndex int serverIndex = file.scrollOffset + scriptID @@ -848,6 +852,7 @@ void function DisplayFocusedServerInfo( int scriptID) var menu = GetMenu( "ServerBrowserMenu" ) int serverIndex = file.scrollOffset + scriptID + if (serverIndex < 0) serverIndex = 0 Hud_SetVisible( Hud_GetChild( menu, "BtnServerDescription" ), true ) -- cgit v1.2.3 From d166991d014b2e83c1b337516da152316e429f68 Mon Sep 17 00:00:00 2001 From: F1F7Y Date: Thu, 30 Dec 2021 18:38:42 +0100 Subject: Add server count; improve UI --- .../northstar_client_localisation_english.txt | Bin 20042 -> 20116 bytes .../mod/resource/ui/menus/server_browser.menu | 83 +++++++++++++++------ 2 files changed, 62 insertions(+), 21 deletions(-) diff --git a/Northstar.Client/mod/resource/northstar_client_localisation_english.txt b/Northstar.Client/mod/resource/northstar_client_localisation_english.txt index b37afef3..49ec746c 100644 Binary files a/Northstar.Client/mod/resource/northstar_client_localisation_english.txt and b/Northstar.Client/mod/resource/northstar_client_localisation_english.txt differ diff --git a/Northstar.Client/mod/resource/ui/menus/server_browser.menu b/Northstar.Client/mod/resource/ui/menus/server_browser.menu index feca06fb..3bc5e4e5 100644 --- a/Northstar.Client/mod/resource/ui/menus/server_browser.menu +++ b/Northstar.Client/mod/resource/ui/menus/server_browser.menu @@ -173,9 +173,12 @@ resource/ui/menus/mods_browse.menu // PasswordProtected - // BtnServerPasswordProtected (lock icons) dont pin to specified siblings + // BtnServerPasswordProtectedx (lock icons) dont pin to specified siblings // Their 0,0 is the screen 0,0 - // Too lazy to fix hopefully doesn't break on other resolutions + // I have no idea why, current ypos values hold up pretty well, but some users may still notice the missalignment + // Tried evrything, if I find a difeerent way to do this will try + // - Fifty#8113 + BtnServerPasswordProtectedTab { ControlName ImagePanel @@ -184,7 +187,7 @@ resource/ui/menus/mods_browse.menu wide 48 tall 48 - pin_to_sibling RowButtonsAnchor + pin_to_sibling RowButtonsAnchor pin_corner_to_sibling TOP_LEFT pin_to_sibling_corner TOP_LEFT } @@ -193,16 +196,18 @@ resource/ui/menus/mods_browse.menu { ControlName ImagePanel classname ServerLock - image "ui/menu/common/locked_icon" + image "ui/menu/common/locked_icon" scaleImage 1 wide 48 - tall 48 - xpos 94 - ypos 200 + tall 48 + xpos 94 + ypos 200 + + pin_to_sibling FilterPanel + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_LEFT + - pin_to_sibling BtnServer1 - pin_corner_to_sibling TOP_LEFT - pin_to_sibling_corner BOTTOM_LEFT } BtnServerPasswordProtected2 { @@ -216,8 +221,8 @@ resource/ui/menus/mods_browse.menu ypos 239 pin_to_sibling BtnServer2 - pin_corner_to_sibling TOP_LEFT - pin_to_sibling_corner BOTTOM_LEFT + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_LEFT } BtnServerPasswordProtected3 { @@ -231,8 +236,8 @@ resource/ui/menus/mods_browse.menu ypos 279 pin_to_sibling BtnServer3 - pin_corner_to_sibling TOP_LEFT - pin_to_sibling_corner BOTTOM_LEFT + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_LEFT } BtnServerPasswordProtected4 { @@ -246,8 +251,8 @@ resource/ui/menus/mods_browse.menu ypos 319 pin_to_sibling BtnServer4 - pin_corner_to_sibling TOP_LEFT - pin_to_sibling_corner BOTTOM_LEFT + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_LEFT } BtnServerPasswordProtected5 { @@ -261,8 +266,8 @@ resource/ui/menus/mods_browse.menu ypos 359 pin_to_sibling BtnServer5 - pin_corner_to_sibling TOP_LEFT - pin_to_sibling_corner BOTTOM_LEFT + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_LEFT } BtnServerPasswordProtected6 { @@ -348,7 +353,7 @@ resource/ui/menus/mods_browse.menu wide 48 tall 48 xpos 94 - ypos 399 + ypos 599 pin_to_sibling BtnServer11 pin_corner_to_sibling TOP_LEFT @@ -2566,13 +2571,12 @@ resource/ui/menus/mods_browse.menu pin_corner_to_sibling TOP_LEFT pin_to_sibling_corner BOTTOM_LEFT } - InGamePlayerCount { ControlName Label auto_wide_tocontents 1 tall 40 - labelText "" + labelText "99999" font Default_28_ShadowGlow bgcolor_override "0 0 0 120" fgcolor_override "107 166 196 200" @@ -2585,6 +2589,43 @@ resource/ui/menus/mods_browse.menu pin_to_sibling_corner TOP_RIGHT } + TotalServerLabel + { + ControlName Label + auto_wide_tocontents 1 + tall 40 + labelText "#TOTAL_SERVERS" + xpos 46 + visible 1 + zpos 101 + + font Default_28_ShadowGlow + bgcolor_override "0 0 0 120" + fgcolor_override "255 255 255 175" + visible 1 + + pin_to_sibling InGamePlayerCount + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_RIGHT + } + TotalServerCount + { + ControlName Label + auto_wide_tocontents 1 + tall 40 + labelText "9999" + font Default_28_ShadowGlow + bgcolor_override "0 0 0 120" + fgcolor_override "196 108 108 200" + xpos 6 + visible 1 + zpos 101 + + pin_to_sibling TotalServerLabel + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner TOP_RIGHT + } + FooterButtons { -- cgit v1.2.3 From ac8d50057db558d587767097455f359bb8cce183 Mon Sep 17 00:00:00 2001 From: F1F7Y Date: Thu, 30 Dec 2021 18:41:05 +0100 Subject: . --- .../mod/resource/ui/menus/server_browser.menu | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Northstar.Client/mod/resource/ui/menus/server_browser.menu b/Northstar.Client/mod/resource/ui/menus/server_browser.menu index 3bc5e4e5..b292de93 100644 --- a/Northstar.Client/mod/resource/ui/menus/server_browser.menu +++ b/Northstar.Client/mod/resource/ui/menus/server_browser.menu @@ -204,8 +204,8 @@ resource/ui/menus/mods_browse.menu ypos 200 pin_to_sibling FilterPanel - pin_corner_to_sibling TOP_LEFT - pin_to_sibling_corner TOP_LEFT + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner BOTTOM_LEFT } @@ -221,8 +221,8 @@ resource/ui/menus/mods_browse.menu ypos 239 pin_to_sibling BtnServer2 - pin_corner_to_sibling TOP_LEFT - pin_to_sibling_corner TOP_LEFT + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner BOTTOM_LEFT } BtnServerPasswordProtected3 { @@ -236,8 +236,8 @@ resource/ui/menus/mods_browse.menu ypos 279 pin_to_sibling BtnServer3 - pin_corner_to_sibling TOP_LEFT - pin_to_sibling_corner TOP_LEFT + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner BOTTOM_LEFT } BtnServerPasswordProtected4 { @@ -251,8 +251,8 @@ resource/ui/menus/mods_browse.menu ypos 319 pin_to_sibling BtnServer4 - pin_corner_to_sibling TOP_LEFT - pin_to_sibling_corner TOP_LEFT + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner BOTTOM_LEFT } BtnServerPasswordProtected5 { @@ -266,8 +266,8 @@ resource/ui/menus/mods_browse.menu ypos 359 pin_to_sibling BtnServer5 - pin_corner_to_sibling TOP_LEFT - pin_to_sibling_corner TOP_LEFT + pin_corner_to_sibling TOP_LEFT + pin_to_sibling_corner BOTTOM_LEFT } BtnServerPasswordProtected6 { -- cgit v1.2.3 From df310780fc6cd6650baedda53b521a5a335b805f Mon Sep 17 00:00:00 2001 From: F1F7Y Date: Thu, 30 Dec 2021 18:42:06 +0100 Subject: , --- Northstar.Client/mod/resource/ui/menus/server_browser.menu | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Northstar.Client/mod/resource/ui/menus/server_browser.menu b/Northstar.Client/mod/resource/ui/menus/server_browser.menu index b292de93..959c1b09 100644 --- a/Northstar.Client/mod/resource/ui/menus/server_browser.menu +++ b/Northstar.Client/mod/resource/ui/menus/server_browser.menu @@ -2576,7 +2576,7 @@ resource/ui/menus/mods_browse.menu ControlName Label auto_wide_tocontents 1 tall 40 - labelText "99999" + labelText "" font Default_28_ShadowGlow bgcolor_override "0 0 0 120" fgcolor_override "107 166 196 200" @@ -2613,7 +2613,7 @@ resource/ui/menus/mods_browse.menu ControlName Label auto_wide_tocontents 1 tall 40 - labelText "9999" + labelText "" font Default_28_ShadowGlow bgcolor_override "0 0 0 120" fgcolor_override "196 108 108 200" -- cgit v1.2.3