diff options
-rw-r--r-- | assets/ui/joinserver.menu | 76 | ||||
-rw-r--r-- | src/client/cl_main.c | 5 | ||||
-rw-r--r-- | src/client/cl_ui.c | 3 | ||||
-rw-r--r-- | src/ui/ui_main.c | 3 | ||||
-rw-r--r-- | src/ui/ui_public.h | 1 |
5 files changed, 72 insertions, 16 deletions
diff --git a/assets/ui/joinserver.menu b/assets/ui/joinserver.menu index 8a240091..975126f0 100644 --- a/assets/ui/joinserver.menu +++ b/assets/ui/joinserver.menu @@ -33,7 +33,8 @@ #define BOTBUTT_W (BOT_W/5) #define BOTBUTT_H BOT_H -#define SERVER_C 0.6 +#define SERVER_C 0.45 +#define GAME_C 0.15 #define MAP_C 0.2 #define PLAYERS_C 0.1 #define PING_C 0.1 @@ -274,13 +275,57 @@ itemDef { + name game + group grpTabs + type ITEM_TYPE_BUTTON + text "Game Type" + textscale .33 + style WINDOW_STYLE_FILLED + rect (LIST_X+(SERVER_C*LIST_W)) LIST_Y (GAME_C*LIST_W) HEADFOOT_H + textalign ALIGN_LEFT + textvalign VALIGN_CENTER + textalignx LIST_TOFF + border WINDOW_BORDER_FULL + bordercolor 0.5 0.5 0.5 1 + forecolor 1 1 1 1 + backcolor 0 0 0 0 + outlinecolor 0.1 0.1 0.1 0.5 + visible MENU_TRUE + action + { + play "sound/misc/menu1.wav"; + uiScript ServerSort 1; + + setitemcolor grpColumn backcolor 0 0 0 0; + setitemcolor grpTabs backcolor 0 0 0 0; + setitemcolor game backcolor 0.3 1 1 0.3; + setitemcolor gameColumn backcolor 0.2 0.6 0.6 0.1; + } + } + + itemDef + { + name gameColumn + group grpColumn + rect (LIST_X+(SERVER_C*LIST_W)) (LIST_Y+HEADFOOT_H) (GAME_C*LIST_W) (LIST_H-(2*HEADFOOT_H)) + style WINDOW_STYLE_FILLED + border WINDOW_BORDER_FULL + backcolor 0 0 0 0 + bordersize 1 + bordercolor .5 .5 .5 1 + visible MENU_TRUE + decoration + } + + itemDef + { name map group grpTabs type ITEM_TYPE_BUTTON text "Map Name" textscale .33 style WINDOW_STYLE_FILLED - rect (LIST_X+(SERVER_C*LIST_W)) LIST_Y (MAP_C*LIST_W) HEADFOOT_H + rect (LIST_X+((SERVER_C+GAME_C)*LIST_W)) LIST_Y (MAP_C*LIST_W) HEADFOOT_H textalign ALIGN_LEFT textvalign VALIGN_CENTER textalignx LIST_TOFF @@ -293,7 +338,7 @@ action { play "sound/misc/menu1.wav"; - uiScript ServerSort 1; + uiScript ServerSort 2; setitemcolor grpColumn backcolor 0 0 0 0; setitemcolor grpTabs backcolor 0 0 0 0; @@ -306,7 +351,7 @@ { name mapColumn group grpColumn - rect (LIST_X+(SERVER_C*LIST_W)) (LIST_Y+HEADFOOT_H) (MAP_C*LIST_W) (LIST_H-(2*HEADFOOT_H)) + rect (LIST_X+((SERVER_C+GAME_C)*LIST_W)) (LIST_Y+HEADFOOT_H) (MAP_C*LIST_W) (LIST_H-(2*HEADFOOT_H)) style WINDOW_STYLE_FILLED border WINDOW_BORDER_FULL backcolor 0 0 0 0 @@ -324,7 +369,7 @@ type ITEM_TYPE_BUTTON textscale .33 style WINDOW_STYLE_FILLED - rect (LIST_X+((SERVER_C+MAP_C)*LIST_W)) LIST_Y (PLAYERS_C*LIST_W) HEADFOOT_H + rect (LIST_X+((SERVER_C+GAME_C+MAP_C)*LIST_W)) LIST_Y (PLAYERS_C*LIST_W) HEADFOOT_H textalign ALIGN_LEFT textvalign VALIGN_CENTER textalignx LIST_TOFF @@ -337,7 +382,7 @@ action { play "sound/misc/menu1.wav"; - uiScript ServerSort 2; + uiScript ServerSort 3; setitemcolor grpColumn backcolor 0 0 0 0; setitemcolor grpTabs backcolor 0 0 0 0; @@ -350,7 +395,7 @@ { name playerColumn group grpColumn - rect (LIST_X+((SERVER_C+MAP_C)*LIST_W)) (LIST_Y+HEADFOOT_H) (PLAYERS_C*LIST_W) (LIST_H-(2*HEADFOOT_H)) + rect (LIST_X+((SERVER_C+GAME_C+MAP_C)*LIST_W)) (LIST_Y+HEADFOOT_H) (PLAYERS_C*LIST_W) (LIST_H-(2*HEADFOOT_H)) style WINDOW_STYLE_FILLED border WINDOW_BORDER_FULL backcolor 0 0 0 0 @@ -368,7 +413,7 @@ type ITEM_TYPE_BUTTON textscale .33 style WINDOW_STYLE_FILLED - rect (LIST_X+((SERVER_C+MAP_C+PLAYERS_C)*LIST_W)) LIST_Y (PING_C*LIST_W) HEADFOOT_H + rect (LIST_X+((SERVER_C+GAME_C+MAP_C+PLAYERS_C)*LIST_W)) LIST_Y (PING_C*LIST_W) HEADFOOT_H textalign ALIGN_LEFT textvalign VALIGN_CENTER textalignx LIST_TOFF @@ -381,7 +426,7 @@ action { play "sound/misc/menu1.wav"; - uiScript ServerSort 3; + uiScript ServerSort 4; setitemcolor grpColumn backcolor 0 0 0 0; setitemcolor grpTabs backcolor 0 0 0 0; @@ -394,7 +439,7 @@ { name pingColumn group grpColumn - rect (LIST_X+((SERVER_C+MAP_C+PLAYERS_C)*LIST_W)) (LIST_Y+HEADFOOT_H) (PING_C*LIST_W) (LIST_H-(2*HEADFOOT_H)) + rect (LIST_X+((SERVER_C+GAME_C+MAP_C+PLAYERS_C)*LIST_W)) (LIST_Y+HEADFOOT_H) (PING_C*LIST_W) (LIST_H-(2*HEADFOOT_H)) style WINDOW_STYLE_FILLED border WINDOW_BORDER_FULL backcolor 0.2 0.6 0.6 0.1 @@ -423,11 +468,12 @@ backcolor 0.2 0.2 0.2 1 outlinecolor 0.1 0.3 0.3 0.4 visible MENU_TRUE - columns 4 - LIST_TOFF ((SERVER_C*LIST_W)-(3*LIST_TOFF)) ALIGN_LEFT - (LIST_TOFF+((SERVER_C)*LIST_W)) ((MAP_C*LIST_W)-(3*LIST_TOFF)) ALIGN_LEFT - (LIST_TOFF+((SERVER_C+MAP_C)*LIST_W)) ((PLAYERS_C*LIST_W)-(3*LIST_TOFF)) ALIGN_LEFT - (LIST_TOFF+((SERVER_C+MAP_C+PLAYERS_C)*LIST_W)) ((PING_C*LIST_W)-(3*LIST_TOFF)) ALIGN_LEFT + columns 5 + LIST_TOFF ((SERVER_C*LIST_W)-(3*LIST_TOFF)) ALIGN_LEFT + (LIST_TOFF+((SERVER_C)*LIST_W)) ((MAP_C*LIST_W)-(3*LIST_TOFF)) ALIGN_LEFT + (LIST_TOFF+((SERVER_C+GAME_C)*LIST_W)) ((MAP_C*LIST_W)-(3*LIST_TOFF)) ALIGN_LEFT + (LIST_TOFF+((SERVER_C+GAME_C+MAP_C)*LIST_W)) ((PLAYERS_C*LIST_W)-(3*LIST_TOFF)) ALIGN_LEFT + (LIST_TOFF+((SERVER_C+GAME_C+MAP_C+PLAYERS_C)*LIST_W)) ((PING_C*LIST_W)-(3*LIST_TOFF)) ALIGN_LEFT doubleClick { uiScript JoinServer } } diff --git a/src/client/cl_main.c b/src/client/cl_main.c index 15df946f..81cb98ac 100644 --- a/src/client/cl_main.c +++ b/src/client/cl_main.c @@ -3561,11 +3561,14 @@ void CL_Shutdown( void ) { static void CL_SetServerInfo(serverInfo_t *server, const char *info, int ping) { if (server) { if (info) { + const char *game; + server->clients = atoi(Info_ValueForKey(info, "clients")); Q_strncpyz(server->hostName,Info_ValueForKey(info, "hostname"), MAX_HOSTNAME_LENGTH ); Q_strncpyz(server->mapName, Info_ValueForKey(info, "mapname"), MAX_NAME_LENGTH); server->maxClients = atoi(Info_ValueForKey(info, "sv_maxclients")); - Q_strncpyz(server->game,Info_ValueForKey(info, "game"), MAX_NAME_LENGTH); + game = Info_ValueForKey(info, "game"); + Q_strncpyz(server->game, (game[0]) ? game : BASEGAME, MAX_NAME_LENGTH); server->gameType = atoi(Info_ValueForKey(info, "gametype")); server->netType = atoi(Info_ValueForKey(info, "nettype")); server->minPing = atoi(Info_ValueForKey(info, "minping")); diff --git a/src/client/cl_ui.c b/src/client/cl_ui.c index faa2dbab..ef53ebd8 100644 --- a/src/client/cl_ui.c +++ b/src/client/cl_ui.c @@ -458,6 +458,9 @@ static int LAN_CompareServers( int source, int sortKey, int sortDir, int s1, int } break; + case SORT_GAME: + res = Q_stricmp( server1->game, server2->game ); + break; case SORT_MAP: res = Q_stricmp( server1->mapName, server2->mapName ); break; diff --git a/src/ui/ui_main.c b/src/ui/ui_main.c index 3c1d21ec..b776521e 100644 --- a/src/ui/ui_main.c +++ b/src/ui/ui_main.c @@ -3617,6 +3617,9 @@ static const char *UI_FeederItemText( int feederID, int index, int column, qhand } } + case SORT_GAME: + return Info_ValueForKey( info, "game" ); + case SORT_MAP: return Info_ValueForKey( info, "mapname" ); diff --git a/src/ui/ui_public.h b/src/ui/ui_public.h index f746eb38..edf2742f 100644 --- a/src/ui/ui_public.h +++ b/src/ui/ui_public.h @@ -152,6 +152,7 @@ uiMenuCommand_t; typedef enum { SORT_HOST, + SORT_GAME, SORT_MAP, SORT_CLIENTS, SORT_PING |