Skip to content

Commit

Permalink
This is a cursed PR what is even
Browse files Browse the repository at this point in the history
  • Loading branch information
JMM889901 committed Aug 12, 2024
1 parent cc8fc9c commit ca70578
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 27 deletions.
15 changes: 15 additions & 0 deletions Northstar.Client/mod/resource/ui/menus/mode_select.menu
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,21 @@ resource/ui/menus/mode_select.menu
rui "ui/basic_image_add.rpak"
zpos 3
}
ModeIconImagePatch //For patch icons
{
ControlName RuiPanel
xpos 0
ypos -16
wide 72
tall 72
visible 1
scaleImage 1
zpos 3
pin_to_sibling NextModeImage
pin_corner_to_sibling TOP_LEFT
pin_to_sibling_corner TOP_LEFT
rui "ui/callsign_icon_button.rpak"
}

NextModeName
{
Expand Down
46 changes: 19 additions & 27 deletions Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut
Original file line number Diff line number Diff line change
Expand Up @@ -756,16 +756,7 @@ void function FilterServerList()

foreach ( ServerInfo server in servers )
{
serverStruct tempServer
tempServer.serverIndex = i
tempServer.serverProtected = NSServerRequiresPassword( i )
tempServer.serverName = NSGetServerName( i )
tempServer.serverPlayers = NSGetServerPlayerCount( i )
tempServer.serverPlayersMax = NSGetServerMaxPlayerCount( i )
tempServer.serverMap = NSGetServerMap( i )
tempServer.serverGamemode = NSGetServerPlaylist ( i )

totalPlayers += tempServer.serverPlayers
totalPlayers += server.playerCount


// Filters
Expand All @@ -788,12 +779,13 @@ void function FilterServerList()
if ( filterArguments.useSearch )
{
array<string> sName
sName.append( tempServer.serverName.tolower() )
sName.append( Localize( GetMapDisplayName( tempServer.serverMap ) ).tolower() )
sName.append( tempServer.serverMap.tolower() )
sName.append( GetGameModeDisplayName( tempServer.serverGamemode ).tolower() )
sName.append( Localize( GetGameModeDisplayName( tempServer.serverGamemode ) ).tolower() )
sName.append( NSGetServerDescription( i ).tolower() )
sName.append( server.name.tolower() )
sName.append( Localize( GetMapDisplayName( server.map ) ).tolower() )
sName.append( server.map.tolower() )
sName.append( server.playlist.tolower() )
sName.append( Localize( server.playlist ).tolower() )
sName.append( server.description.tolower() )
sName.append( server.region.tolower() )

string sTerm = filterArguments.searchTerm.tolower()

Expand Down Expand Up @@ -841,11 +833,12 @@ void function UpdateShownPage()
Hud_SetEnabled( file.serverButtons[ i ], true )
Hud_SetVisible( file.serverButtons[ i ], true )

Hud_SetVisible( file.serversProtected[ i ], file.serversArrayFiltered[ buttonIndex ].serverProtected )
Hud_SetText( file.serversName[ i ], file.serversArrayFiltered[ buttonIndex ].serverName )
Hud_SetText( file.playerCountLabels[ i ], format( "%i/%i", file.serversArrayFiltered[ buttonIndex ].serverPlayers, file.serversArrayFiltered[ buttonIndex ].serverPlayersMax ) )
Hud_SetText( file.serversMap[ i ], GetMapDisplayName( file.serversArrayFiltered[ buttonIndex ].serverMap ) )
Hud_SetText( file.serversGamemode[ i ], GetGameModeDisplayName( file.serversArrayFiltered[ buttonIndex ].serverGamemode ) )
Hud_SetVisible( file.serversProtected[ i ], server.requiresPassword )
Hud_SetText( file.serversName[ i ], server.name )
Hud_SetText( file.playerCountLabels[ i ], format( "%i/%i", server.playerCount, server.maxPlayerCount ) )
Hud_SetText( file.serversMap[ i ], GetMapDisplayName( server.map ) )
Hud_SetText( file.serversGamemode[ i ], GetGameModeDisplayName( server.playlist ) )
Hud_SetText( file.serversRegion[ i ], server.region )
}


Expand Down Expand Up @@ -934,17 +927,16 @@ void function DisplayFocusedServerInfo( int scriptID )
Hud_SetText( Hud_GetChild( menu, "ServerName" ), server.name )

// mode name/image
string mode = GetGameModeDisplayName( file.serversArrayFiltered[ serverIndex ].serverGamemode )
string playlist = file.serversArrayFiltered[ serverIndex ].serverGamemode
string mode = server.playlist
Hud_SetVisible( Hud_GetChild( menu, "NextModeIcon" ), true )

var nextModeIconAlt = Hud_GetChild( menu, "NextModeIconPatch" )
var nextModeIcon = Hud_GetChild( menu, "NextModeIcon" )
string iconName = GetPlaylistVarOrUseValue( playlist, "iconOverride", "default" )
string iconName = GetPlaylistVarOrUseValue( mode, "iconOverride", "default" )

if(iconName == "default")
{
RuiSetImage( Hud_GetRui( nextModeIcon ), "basicImage", GetPlaylistThumbnailImage( playlist ) )
RuiSetImage( Hud_GetRui( nextModeIcon ), "basicImage", GetPlaylistThumbnailImage( mode ) )

Hud_Show( nextModeIcon )
Hud_Hide( nextModeIconAlt )
Expand Down Expand Up @@ -1269,8 +1261,8 @@ int function ServerSortLogic ( ServerInfo a, ServerInfo b )
direction = filterDirection.serverMap
break;
case sortingBy.GAMEMODE:
aTemp = Localize( GetGameModeDisplayName( a.serverGamemode ) ).tolower()
bTemp = Localize( GetGameModeDisplayName( b.serverGamemode ) ).tolower()
aTemp = Localize( a.playlist ).tolower()
bTemp = Localize( b.playlist ).tolower()
direction = filterDirection.serverGamemode
break;
case sortingBy.REGION:
Expand Down

0 comments on commit ca70578

Please sign in to comment.