mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-02-04 02:26:13 +00:00
Add RetroArch version and use different icons for different room types
This commit is contained in:
parent
b8bbf77196
commit
e09075dc25
@ -932,7 +932,7 @@ static bool menu_content_find_first_core(menu_content_ctx_defer_info_t *def_info
|
||||
core_info_get_current_core((core_info_t**)&info);
|
||||
if (info)
|
||||
{
|
||||
RARCH_LOG("Use the current core (%s) to load this content...\n",
|
||||
RARCH_LOG("[lobby] use the current core (%s) to load this content...\n",
|
||||
info->path);
|
||||
supported = 1;
|
||||
}
|
||||
@ -3415,7 +3415,7 @@ static int action_ok_netplay_connect_room(const char *path,
|
||||
netplay_room_list[idx - 3].port);
|
||||
}
|
||||
|
||||
RARCH_LOG("Connecting to: %s with game: %s/%08x\n",
|
||||
RARCH_LOG("[lobby] connecting to: %s with game: %s/%08x\n",
|
||||
tmp_hostname,
|
||||
netplay_room_list[idx - 3].gamename,
|
||||
netplay_room_list[idx - 3].gamecrc);
|
||||
@ -3649,13 +3649,13 @@ void netplay_refresh_rooms_menu(file_list_t *list)
|
||||
|
||||
if (netplay_room_count != 0)
|
||||
{
|
||||
RARCH_LOG ("Found %d rooms...\n", netplay_room_count);
|
||||
RARCH_LOG ("[lobby] found %d rooms...\n", netplay_room_count);
|
||||
|
||||
for (i = 0; i < netplay_room_count; i++)
|
||||
{
|
||||
/* Uncomment this to debug mismatched room parameters*/
|
||||
#if 0
|
||||
RARCH_LOG("Room Data: %d\n"
|
||||
RARCH_LOG("[lobby] room Data: %d\n"
|
||||
"Nickname: %s\n"
|
||||
"Address: %s\n"
|
||||
"Port: %d\n"
|
||||
@ -3674,24 +3674,21 @@ void netplay_refresh_rooms_menu(file_list_t *list)
|
||||
netplay_room_list[i].timestamp);
|
||||
#endif
|
||||
j+=8;
|
||||
if (netplay_room_list[i].lan)
|
||||
{
|
||||
snprintf(s, sizeof(s),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_ROOM_NICKNAME_LAN),
|
||||
netplay_room_list[i].nickname);
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(s, sizeof(s),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_ROOM_NICKNAME),
|
||||
netplay_room_list[i].nickname);
|
||||
}
|
||||
snprintf(s, sizeof(s),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_ROOM_NICKNAME),
|
||||
netplay_room_list[i].nickname);
|
||||
|
||||
/*
|
||||
netplay_room_list[i - 3].lan ? "LAN game" :
|
||||
(netplay_room_list[i - 3].host_method == NETPLAY_HOST_METHOD_MITM ?
|
||||
"MITM game" : "Lobby game"), netplay_room_list[i - 3].address);*/
|
||||
|
||||
int room_type = netplay_room_list[i].lan ? MENU_ROOM_LAN : (netplay_room_list[i].host_method == NETPLAY_HOST_METHOD_MITM ? MENU_ROOM_MITM : MENU_ROOM);
|
||||
menu_entries_append_enum(list,
|
||||
s,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_CONNECT_NETPLAY_ROOM),
|
||||
MENU_ENUM_LABEL_CONNECT_NETPLAY_ROOM,
|
||||
MENU_ROOM, 0, 0);
|
||||
room_type, 0, 0);
|
||||
}
|
||||
|
||||
netplay_rooms_free();
|
||||
@ -3729,7 +3726,7 @@ static void netplay_refresh_rooms_cb(void *task_data, void *user_data, const cha
|
||||
if (string_is_empty(data->data))
|
||||
{
|
||||
netplay_room_count = 0;
|
||||
RARCH_LOG("Room list empty\n");
|
||||
RARCH_LOG("[lobby] room list empty\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -3804,7 +3801,7 @@ static void netplay_refresh_rooms_cb(void *task_data, void *user_data, const cha
|
||||
netplay_room_list[i].lan = true;
|
||||
|
||||
snprintf(s, sizeof(s),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_ROOM_NICKNAME_LAN),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_ROOM_NICKNAME),
|
||||
netplay_room_list[i].nickname);
|
||||
}
|
||||
netplay_room_count += lan_room_count;
|
||||
|
@ -23,6 +23,9 @@
|
||||
#endif
|
||||
#include "../../verbosity.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <string/stdstring.h>
|
||||
|
||||
#ifndef BIND_ACTION_SUBLABEL
|
||||
#define BIND_ACTION_SUBLABEL(cbs, name) \
|
||||
cbs->action_sublabel = name; \
|
||||
@ -359,13 +362,10 @@ static int action_bind_sublabel_netplay_room(
|
||||
if (i < 1)
|
||||
return 0;
|
||||
|
||||
snprintf(s,len, "%s (%s)\n%s (%08x)\nType: %s (%s)",
|
||||
snprintf(s,len, "RetroArch: %s\nCore: %s (%s)\nGame: %s (%08x)",
|
||||
string_is_empty(netplay_room_list[i - 3].retroarchversion) ? "N/A" : netplay_room_list[i - 3].retroarchversion,
|
||||
netplay_room_list[i - 3].corename, netplay_room_list[i - 3].coreversion,
|
||||
netplay_room_list[i - 3].gamename, netplay_room_list[i - 3].gamecrc,
|
||||
netplay_room_list[i - 3].lan ? "LAN game" :
|
||||
(netplay_room_list[i - 3].host_method == NETPLAY_HOST_METHOD_MITM ?
|
||||
"MITM game" : "Lobby game"), netplay_room_list[i - 3].address);
|
||||
|
||||
netplay_room_list[i - 3].gamename, netplay_room_list[i - 3].gamecrc);
|
||||
#if 0
|
||||
strlcpy(s, netplay_room_list[i - 3].corename, len);
|
||||
#endif
|
||||
|
@ -97,6 +97,8 @@ enum
|
||||
#ifdef HAVE_NETWORKING
|
||||
XMB_TEXTURE_NETPLAY,
|
||||
XMB_TEXTURE_ROOM,
|
||||
XMB_TEXTURE_ROOM_LAN,
|
||||
XMB_TEXTURE_ROOM_MITM,
|
||||
#endif
|
||||
#ifdef HAVE_IMAGEVIEWER
|
||||
XMB_TEXTURE_IMAGES,
|
||||
@ -2148,6 +2150,10 @@ static uintptr_t xmb_icon_get_id(xmb_handle_t *xmb,
|
||||
#ifdef HAVE_NETWORKING
|
||||
case MENU_ROOM:
|
||||
return xmb->textures.list[XMB_TEXTURE_ROOM];
|
||||
case MENU_ROOM_LAN:
|
||||
return xmb->textures.list[XMB_TEXTURE_ROOM_LAN];
|
||||
case MENU_ROOM_MITM:
|
||||
return xmb->textures.list[XMB_TEXTURE_ROOM_MITM];
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -3528,6 +3534,10 @@ static const char *xmb_texture_path(unsigned id)
|
||||
return "netplay.png";
|
||||
case XMB_TEXTURE_ROOM:
|
||||
return "room.png";
|
||||
case XMB_TEXTURE_ROOM_LAN:
|
||||
return "room_lan.png";
|
||||
case XMB_TEXTURE_ROOM_MITM:
|
||||
return "room_mitm.png";
|
||||
#endif
|
||||
case XMB_TEXTURE_KEY:
|
||||
return "key.png";
|
||||
|
@ -167,6 +167,8 @@ enum menu_settings_type
|
||||
MENU_SETTING_HORIZONTAL_MENU,
|
||||
MENU_WIFI,
|
||||
MENU_ROOM,
|
||||
MENU_ROOM_LAN,
|
||||
MENU_ROOM_MITM,
|
||||
MENU_NETPLAY_LAN_SCAN,
|
||||
MENU_INFO_MESSAGE,
|
||||
MENU_SETTINGS_SHADER_PARAMETER_0,
|
||||
|
@ -76,6 +76,7 @@ struct netplay_room
|
||||
bool has_spectate_password;
|
||||
bool lan;
|
||||
bool fixed;
|
||||
char retroarchversion [PATH_MAX_LENGTH];
|
||||
struct netplay_room *next;
|
||||
};
|
||||
|
||||
|
@ -279,6 +279,12 @@ static JSON_Parser_HandlerResult JSON_CALL ObjectMemberHandler(JSON_Parser parse
|
||||
pCtx->cur_field = strdup(pValue);
|
||||
pCtx->cur_member = &rooms->cur->host_method;
|
||||
}
|
||||
else if (string_is_equal_fast(pValue, "retroarch_version", 17))
|
||||
{
|
||||
pCtx->cur_field = strdup(pValue);
|
||||
pCtx->cur_member = &rooms->cur->retroarchversion;
|
||||
pCtx->cur_member_size = sizeof(rooms->cur->retroarchversion);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user