add "Mods" tab

This commit is contained in:
m 2022-12-26 06:45:36 -06:00
parent 308485be98
commit 8e7e2982db
14 changed files with 39 additions and 31 deletions

View File

@ -10,19 +10,23 @@ local columns = {{
text = "@MENU_HOST_NAME", text = "@MENU_HOST_NAME",
dataindex = 0 dataindex = 0
}, { }, {
offset = 500, offset = 440,
text = "@MENU_MAP", text = "@MENU_MAP",
dataindex = 1 dataindex = 1
}, { }, {
offset = 725, offset = 615,
text = "@MENU_TYPE1", text = "@MENU_TYPE1",
dataindex = 3 dataindex = 3
}, { }, {
offset = 920, offset = 780,
text = "@MENU_MOD",
dataindex = 6
}, {
offset = 980,
text = "@MENU_NUMPLAYERS", text = "@MENU_NUMPLAYERS",
dataindex = 2 dataindex = 2
}, { }, {
offset = 1070, offset = 1100,
text = "@MENU_PING", text = "@MENU_PING",
dataindex = 4 dataindex = 4
}, { }, {

View File

@ -3,6 +3,7 @@
"PLATFORM_SYSTEM_LINK_TITLE": "LISTE DES SERVEURS", "PLATFORM_SYSTEM_LINK_TITLE": "LISTE DES SERVEURS",
"MENU_NUMPLAYERS": "Joueurs", "MENU_NUMPLAYERS": "Joueurs",
"MENU_PING": "Latence", "MENU_PING": "Latence",
"MENU_MODS": "Mods",
"SERVERLIST_PLAYER_COUNT": "&&1 Joueurs", "SERVERLIST_PLAYER_COUNT": "&&1 Joueurs",
"SERVERLIST_SERVER_COUNT": "&&1 Serveurs", "SERVERLIST_SERVER_COUNT": "&&1 Serveurs",

View File

@ -31,6 +31,7 @@
"PLATFORM_SYSTEM_LINK_TITLE": "SERVER LIST", "PLATFORM_SYSTEM_LINK_TITLE": "SERVER LIST",
"MENU_NUMPLAYERS": "Players", "MENU_NUMPLAYERS": "Players",
"MENU_PING": "Ping", "MENU_PING": "Ping",
"MENU_MOD": "Mod",
"SERVERLIST_PLAYER_COUNT": "&&1 Players", "SERVERLIST_PLAYER_COUNT": "&&1 Players",
"SERVERLIST_SERVER_COUNT": "&&1 Servers", "SERVERLIST_SERVER_COUNT": "&&1 Servers",
"EXE_SAY": "^3Match^7", "EXE_SAY": "^3Match^7",

View File

@ -3,6 +3,7 @@
"PLATFORM_SYSTEM_LINK_TITLE": "SERVERLISTE", "PLATFORM_SYSTEM_LINK_TITLE": "SERVERLISTE",
"MENU_NUMPLAYERS": "Spieler", "MENU_NUMPLAYERS": "Spieler",
"MENU_PING": "Ping", "MENU_PING": "Ping",
"MENU_MODS": "Modifikationen",
"LOCALE_ENGLISH": "Englisch", "LOCALE_ENGLISH": "Englisch",
"LOCALE_ENGLISH_SAFE": "Englisch (Sicher)", "LOCALE_ENGLISH_SAFE": "Englisch (Sicher)",
"LOCALE_FRENCH": "Französisch", "LOCALE_FRENCH": "Französisch",

View File

@ -3,6 +3,7 @@
"PLATFORM_SYSTEM_LINK_TITLE": "ELENCO DEI SERVER", "PLATFORM_SYSTEM_LINK_TITLE": "ELENCO DEI SERVER",
"MENU_NUMPLAYERS": "Giocatori", "MENU_NUMPLAYERS": "Giocatori",
"MENU_PING": "Ping", "MENU_PING": "Ping",
"MENU_MODS": "Mod",
"LUA_MENU_CAMPAIGN_UNLOCKED_ALL_TITLE": "Sblocca tutte le missioni", "LUA_MENU_CAMPAIGN_UNLOCKED_ALL_TITLE": "Sblocca tutte le missioni",
"LUA_MENU_CANCEL_UNLOCK_CAPS": "Annulla sblocco", "LUA_MENU_CANCEL_UNLOCK_CAPS": "Annulla sblocco",

View File

@ -3,6 +3,7 @@
"PLATFORM_SYSTEM_LINK_TITLE": "サーバーリスト", "PLATFORM_SYSTEM_LINK_TITLE": "サーバーリスト",
"MENU_NUMPLAYERS": "プレイヤー", "MENU_NUMPLAYERS": "プレイヤー",
"MENU_PING": "Ping", "MENU_PING": "Ping",
"MENU_MODS": "改造",
"LOCALE_ENGLISH": "英語", "LOCALE_ENGLISH": "英語",
"LOCALE_ENGLISH_SAFE": "英語(検閲)", "LOCALE_ENGLISH_SAFE": "英語(検閲)",
"LOCALE_FRENCH": "フランス語", "LOCALE_FRENCH": "フランス語",

View File

@ -3,6 +3,7 @@
"PLATFORM_SYSTEM_LINK_TITLE": "서버 목록", "PLATFORM_SYSTEM_LINK_TITLE": "서버 목록",
"MENU_NUMPLAYERS": "플레이어", "MENU_NUMPLAYERS": "플레이어",
"MENU_PING": "핑", "MENU_PING": "핑",
"MENU_MODS": "모드",
"LOCALE_ENGLISH": "영어", "LOCALE_ENGLISH": "영어",
"LOCALE_ENGLISH_SAFE": "영어(검열)", "LOCALE_ENGLISH_SAFE": "영어(검열)",
"LOCALE_FRENCH": "프랑스어", "LOCALE_FRENCH": "프랑스어",

View File

@ -3,6 +3,7 @@
"PLATFORM_SYSTEM_LINK_TITLE": "LISTA SERWERÓW", "PLATFORM_SYSTEM_LINK_TITLE": "LISTA SERWERÓW",
"MENU_NUMPLAYERS": "Gracze", "MENU_NUMPLAYERS": "Gracze",
"MENU_PING": "Ping", "MENU_PING": "Ping",
"MENU_MODS": "Mody",
"LOCALE_ENGLISH": "Angielski", "LOCALE_ENGLISH": "Angielski",
"LOCALE_ENGLISH_SAFE": "Angielski (cenzuralny)", "LOCALE_ENGLISH_SAFE": "Angielski (cenzuralny)",
"LOCALE_FRENCH": "Francuski", "LOCALE_FRENCH": "Francuski",

View File

@ -3,6 +3,7 @@
"PLATFORM_SYSTEM_LINK_TITLE": "LISTA DE SERVIDORES", "PLATFORM_SYSTEM_LINK_TITLE": "LISTA DE SERVIDORES",
"MENU_NUMPLAYERS": "Jogadores", "MENU_NUMPLAYERS": "Jogadores",
"MENU_PING": "Ping", "MENU_PING": "Ping",
"MENU_MODS": "Modificações",
"LOCALE_ENGLISH": "Inglês", "LOCALE_ENGLISH": "Inglês",
"LOCALE_ENGLISH_SAFE": "Inglês (Censurado)", "LOCALE_ENGLISH_SAFE": "Inglês (Censurado)",
"LOCALE_FRENCH": "Français", "LOCALE_FRENCH": "Français",

View File

@ -2,7 +2,8 @@
"LUA_MENU_SERVERLIST": "服务器列表", "LUA_MENU_SERVERLIST": "服务器列表",
"PLATFORM_SYSTEM_LINK_TITLE": "服务器列表", "PLATFORM_SYSTEM_LINK_TITLE": "服务器列表",
"MENU_NUMPLAYERS": "玩家", "MENU_NUMPLAYERS": "玩家",
"MENU_PING": "Ping", "MENU_PING": "平",
"MENU_MODS": "模组",
"LOCALE_ENGLISH": "英语", "LOCALE_ENGLISH": "英语",
"LOCALE_ENGLISH_SAFE": "英语 (审查制度)", "LOCALE_ENGLISH_SAFE": "英语 (审查制度)",
"LOCALE_FRENCH": "法语", "LOCALE_FRENCH": "法语",

View File

@ -2,7 +2,8 @@
"LUA_MENU_SERVERLIST": "Lista de servidores", "LUA_MENU_SERVERLIST": "Lista de servidores",
"PLATFORM_SYSTEM_LINK_TITLE": "LISTA DE SERVIDORES", "PLATFORM_SYSTEM_LINK_TITLE": "LISTA DE SERVIDORES",
"MENU_NUMPLAYERS": "Jugadores", "MENU_NUMPLAYERS": "Jugadores",
"MENU_PING": "Ping", "MENU_PING": "Silbido",
"MENU_MODS": "Mods",
"LOCALE_ENGLISH": "Inglés", "LOCALE_ENGLISH": "Inglés",
"LOCALE_ENGLISH_SAFE": "Inglés (censura)", "LOCALE_ENGLISH_SAFE": "Inglés (censura)",
"LOCALE_FRENCH": "Français", "LOCALE_FRENCH": "Français",

View File

@ -3,6 +3,7 @@
"PLATFORM_SYSTEM_LINK_TITLE": "伺服器列表", "PLATFORM_SYSTEM_LINK_TITLE": "伺服器列表",
"MENU_NUMPLAYERS": "玩家", "MENU_NUMPLAYERS": "玩家",
"MENU_PING": "網路延遲", "MENU_PING": "網路延遲",
"MENU_MODS": "模組",
"MENU_TYPE1": "類型", "MENU_TYPE1": "類型",
"LOCALE_ENGLISH": "英文", "LOCALE_ENGLISH": "英文",
"LOCALE_ENGLISH_SAFE": "英文 (審查制度)", "LOCALE_ENGLISH_SAFE": "英文 (審查制度)",

View File

@ -10,6 +10,7 @@
"PLATFORM_SYSTEM_LINK_TITLE": "СПИСОК СЕРВЕРОВ", "PLATFORM_SYSTEM_LINK_TITLE": "СПИСОК СЕРВЕРОВ",
"MENU_NUMPLAYERS": "Игроки [+боты]", "MENU_NUMPLAYERS": "Игроки [+боты]",
"MENU_PING": "Пинг", "MENU_PING": "Пинг",
"MENU_MODS": "Моды",
"SERVERLIST_PLAYER_COUNT": "Игроков: &&1", "SERVERLIST_PLAYER_COUNT": "Игроков: &&1",
"SERVERLIST_SERVER_COUNT": "Серверов: &&1", "SERVERLIST_SERVER_COUNT": "Серверов: &&1",
"EXE_SAY": "^3Всем^7", "EXE_SAY": "^3Всем^7",

View File

@ -33,6 +33,7 @@ namespace server_list
std::string host_name; std::string host_name;
std::string map_name; std::string map_name;
std::string game_type; std::string game_type;
std::string mod_name;
game::CodPlayMode play_mode; game::CodPlayMode play_mode;
char in_game; char in_game;
game::netadr_s address; game::netadr_s address;
@ -131,39 +132,29 @@ namespace server_list
return ""; return "";
} }
if (column == 0) switch (column)
{ {
return servers[i].host_name.empty() ? "" : utils::string::va("%s", servers[i].host_name.data()); case 0:
} return servers[i].host_name.empty() ? "" : servers[i].host_name.data();
case 1:
if (column == 1) return servers[i].map_name.empty() ? "Unknown" : servers[i].map_name.data();
{ case 2:
return servers[i].map_name.empty() ? "Unknown" : utils::string::va("%s", servers[i].map_name.data());
}
if (column == 2)
{ {
const auto client_count = servers[i].clients - servers[i].bots; const auto client_count = servers[i].clients - servers[i].bots;
return utils::string::va("%d/%d [%d]", client_count, servers[i].max_clients, return utils::string::va("%d/%d [%d]", client_count, servers[i].max_clients,
servers[i].clients); servers[i].clients);
} }
case 3:
if (column == 3) return servers[i].game_type.empty() ? "" : servers[i].game_type.data();
{ case 4:
return servers[i].game_type.empty() ? "" : utils::string::va("%s", servers[i].game_type.data()); return servers[i].ping ? utils::string::va("%i", servers[i].ping) : "999";
} case 5:
if (column == 4)
{
return servers[i].game_type.empty() ? "" : utils::string::va("%i", servers[i].ping);
}
if (column == 5)
{
return servers[i].is_private ? "1" : "0"; return servers[i].is_private ? "1" : "0";
case 6:
return servers[i].mod_name.empty() ? "" : servers[i].mod_name.data();
default:
return "";
} }
return "";
} }
void sort_serverlist() void sort_serverlist()
@ -372,6 +363,7 @@ namespace server_list
server.host_name = info.get("hostname"); server.host_name = info.get("hostname");
server.map_name = game::UI_GetMapDisplayName(info.get("mapname").data()); server.map_name = game::UI_GetMapDisplayName(info.get("mapname").data());
server.game_type = game::UI_GetGameTypeDisplayName(info.get("gametype").data()); server.game_type = game::UI_GetGameTypeDisplayName(info.get("gametype").data());
server.mod_name = info.get("fs_game");
server.play_mode = playmode; server.play_mode = playmode;
server.clients = atoi(info.get("clients").data()); server.clients = atoi(info.get("clients").data());
server.max_clients = atoi(info.get("sv_maxclients").data()); server.max_clients = atoi(info.get("sv_maxclients").data());