start adding ui elements to insert room list into

This commit is contained in:
radius 2017-01-18 22:46:48 -05:00
parent 72cdb390cb
commit 95a2da81e4
11 changed files with 85 additions and 11 deletions

View File

@ -14,6 +14,8 @@ MSG_HASH(MENU_ENUM_LABEL_CONFIGURATIONS_LIST,
"configurations_list")
MSG_HASH(MENU_ENUM_LABEL_ADD_TAB,
"add_tab")
MSG_HASH(MENU_ENUM_LABEL_NETPLAY_TAB,
"netplay_tab")
MSG_HASH(MENU_ENUM_LABEL_ARCHIVE_MODE,
"archive_mode")
MSG_HASH(MENU_ENUM_LABEL_ASSETS_DIRECTORY,

View File

@ -199,6 +199,10 @@ MSG_HASH(
MENU_ENUM_LABEL_VALUE_ADD_TAB,
"Import content"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_NETPLAY_TAB,
"Netplay Rooms"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_ARCHIVE_MODE,
"Archive File Association Action"
@ -967,13 +971,13 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_CLIENT_SWAP_INPUT,
MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_DELAY_FRAMES,
"Netplay Delay Frames")
MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_DISCONNECT,
"Disconnect")
"Disconnect from netplay host")
MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_ENABLE,
"Netplay Enable")
MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_ENABLE_CLIENT,
"Connect to Netplay host")
"Connect to netplay host")
MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_ENABLE_HOST,
"Start hosting")
"Start netplay host")
MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_IP_ADDRESS,
"Server Address")
MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_LAN_SCAN_SETTINGS,

View File

@ -487,6 +487,7 @@ static int menu_cbs_init_bind_left_compare_label(menu_file_list_cbs_t *cbs,
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_HISTORY_TAB)) ||
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_PLAYLISTS_TAB)) ||
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_ADD_TAB)) ||
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_NETPLAY_TAB)) ||
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_MUSIC_TAB)) ||
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_IMAGES_TAB)) ||
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_VIDEO_TAB)) ||
@ -586,6 +587,7 @@ static int menu_cbs_init_bind_left_compare_type(menu_file_list_cbs_t *cbs,
if ( string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_HISTORY_TAB)) ||
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_PLAYLISTS_TAB)) ||
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_ADD_TAB)) ||
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_NETPLAY_TAB)) ||
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_MUSIC_TAB)) ||
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_IMAGES_TAB)) ||
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_VIDEO_TAB)) ||
@ -625,6 +627,7 @@ int menu_cbs_init_bind_left(menu_file_list_cbs_t *cbs,
if ( string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_HISTORY_TAB)) ||
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_PLAYLISTS_TAB)) ||
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_ADD_TAB)) ||
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_NETPLAY_TAB)) ||
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_MAIN_MENU)) ||
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_MUSIC_TAB)) ||
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_IMAGES_TAB)) ||

View File

@ -474,6 +474,7 @@ static int menu_cbs_init_bind_right_compare_type(menu_file_list_cbs_t *cbs,
if ( string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_HISTORY_TAB)) ||
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_PLAYLISTS_TAB)) ||
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_ADD_TAB)) ||
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_NETPLAY_TAB)) ||
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_MUSIC_TAB)) ||
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_IMAGES_TAB)) ||
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_VIDEO_TAB)) ||
@ -594,6 +595,7 @@ static int menu_cbs_init_bind_right_compare_label(menu_file_list_cbs_t *cbs,
if ( string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_HISTORY_TAB)) ||
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_PLAYLISTS_TAB)) ||
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_ADD_TAB)) ||
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_NETPLAY_TAB)) ||
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_MUSIC_TAB)) ||
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_IMAGES_TAB)) ||
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_VIDEO_TAB)) ||
@ -632,6 +634,7 @@ int menu_cbs_init_bind_right(menu_file_list_cbs_t *cbs,
if ( string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_HISTORY_TAB)) ||
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_PLAYLISTS_TAB)) ||
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_ADD_TAB)) ||
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_NETPLAY_TAB)) ||
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_MAIN_MENU)) ||
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_MUSIC_TAB)) ||
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_IMAGES_TAB)) ||

View File

@ -257,6 +257,8 @@ static int action_get_title_group_settings(const char *path, const char *label,
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_PLAYLISTS_TAB), len);
else if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_ADD_TAB)))
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ADD_TAB), len);
else if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_NETPLAY_TAB)))
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_TAB), len);
else if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_HORIZONTAL_MENU)))
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_HORIZONTAL_MENU), len);
else

View File

@ -96,6 +96,9 @@ enum
XMB_TEXTURE_MUSICS,
XMB_TEXTURE_MOVIES,
#endif
#ifdef HAVE_NETWORKING
XMB_TEXTURE_NETPLAY,
#endif
#ifdef HAVE_IMAGEVIEWER
XMB_TEXTURE_IMAGES,
#endif
@ -151,10 +154,15 @@ enum
#ifdef HAVE_IMAGEVIEWER
XMB_SYSTEM_TAB_IMAGES,
#endif
XMB_SYSTEM_TAB_ADD
XMB_SYSTEM_TAB_ADD,
#ifdef HAVE_NETWORKING
XMB_SYSTEM_TAB_NETPLAY
#endif
};
#ifdef HAVE_LIBRETRODB
#ifdef HAVE_NETWORKING
#define XMB_SYSTEM_TAB_END XMB_SYSTEM_TAB_NETPLAY
#elif defined(HAVE_LIBRETRODB)
#define XMB_SYSTEM_TAB_END XMB_SYSTEM_TAB_ADD
#elif defined(HAVE_IMAGEVIEWER)
#define XMB_SYSTEM_TAB_END XMB_SYSTEM_TAB_IMAGES
@ -164,6 +172,7 @@ enum
#define XMB_SYSTEM_TAB_END XMB_SYSTEM_TAB_HISTORY
#endif
typedef struct xmb_handle
{
file_list_t *menu_stack_old;
@ -300,6 +309,7 @@ typedef struct xmb_handle
xmb_node_t settings_tab_node;
xmb_node_t history_tab_node;
xmb_node_t add_tab_node;
xmb_node_t netplay_tab_node;
font_data_t *font;
font_data_t *font2;
@ -1466,6 +1476,8 @@ static xmb_node_t* xmb_get_node(xmb_handle_t *xmb, unsigned i)
return &xmb->history_tab_node;
case XMB_SYSTEM_TAB_ADD:
return &xmb->add_tab_node;
case XMB_SYSTEM_TAB_NETPLAY:
return &xmb->netplay_tab_node;
default:
if (i > xmb->system_tab_end)
return xmb_get_userdata_from_horizontal_list(
@ -3249,6 +3261,9 @@ static void *xmb_init(void **userdata)
if (settings->menu.xmb.show_add)
xmb->tabs[++xmb->system_tab_end] = XMB_SYSTEM_TAB_ADD;
#endif
#ifdef HAVE_NETWORKING
xmb->tabs[++xmb->system_tab_end] = XMB_SYSTEM_TAB_NETPLAY;
#endif
menu_driver_ctl(RARCH_MENU_CTL_UNSET_PREVENT_POPULATE, NULL);
@ -3464,6 +3479,8 @@ static const char *xmb_texture_path(unsigned id)
return "off.png";
case XMB_TEXTURE_ADD:
return "add.png";
case XMB_TEXTURE_NETPLAY:
return "wifi.png";
case XMB_TEXTURE_KEY:
return "key.png";
case XMB_TEXTURE_KEY_HOVER:
@ -3514,6 +3531,12 @@ static void xmb_context_reset_textures(
xmb->add_tab_node.icon = xmb->textures.list[XMB_TEXTURE_ADD];
xmb->add_tab_node.alpha = xmb->categories.active.alpha;
xmb->add_tab_node.zoom = xmb->categories.active.zoom;
#ifdef HAVE_NETWORKING
xmb->netplay_tab_node.icon = xmb->textures.list[XMB_TEXTURE_NETPLAY];
xmb->netplay_tab_node.alpha = xmb->categories.active.alpha;
xmb->netplay_tab_node.zoom = xmb->categories.active.zoom;
#endif
}
static void xmb_context_reset_background(const char *iconpath)
@ -3826,6 +3849,12 @@ static void xmb_list_cache(void *data, enum menu_list_type type, unsigned action
menu_stack->list[stack_size - 1].type =
MENU_ADD_TAB;
break;
case XMB_SYSTEM_TAB_NETPLAY:
menu_stack->list[stack_size - 1].label =
strdup(msg_hash_to_str(MENU_ENUM_LABEL_NETPLAY_TAB));
menu_stack->list[stack_size - 1].type =
MENU_NETPLAY_TAB;
break;
default:
menu_stack->list[stack_size - 1].label =
strdup(msg_hash_to_str(MENU_ENUM_LABEL_HORIZONTAL_MENU));

View File

@ -244,11 +244,6 @@ static int menu_displaylist_parse_netplay(
MENU_ENUM_LABEL_NETPLAY_DISCONNECT,
MENU_SETTING_ACTION, 0, 0);
menu_entries_append_enum(info->list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_SETTINGS),
msg_hash_to_str(MENU_ENUM_LABEL_NETPLAY_SETTINGS),
MENU_ENUM_LABEL_NETWORK_SETTINGS, MENU_SETTING_GROUP, 0, 0);
menu_entries_append_enum(info->list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_LAN_SCAN_SETTINGS),
msg_hash_to_str(MENU_ENUM_LABEL_NETPLAY_LAN_SCAN_SETTINGS),
@ -2697,6 +2692,11 @@ static int menu_displaylist_parse_load_content_settings(
MENU_ENUM_LABEL_CORE_INPUT_REMAPPING_OPTIONS,
MENU_SETTING_ACTION, 0, 0);
#ifdef HAVE_NETWORKING
menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_NETPLAY,
PARSE_ACTION, false);
#endif
menu_entries_append_enum(info->list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CORE_CHEAT_OPTIONS),
@ -2930,6 +2930,7 @@ static int menu_displaylist_parse_add_content_list(
static int menu_displaylist_parse_scan_directory_list(
menu_displaylist_info_t *info)
{
#ifdef HAVE_LIBRETRODB
menu_entries_append_enum(info->list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SCAN_DIRECTORY),
@ -2947,6 +2948,21 @@ static int menu_displaylist_parse_scan_directory_list(
return 0;
}
static int menu_displaylist_parse_netplay_room_list(
menu_displaylist_info_t *info)
{
#ifdef HAVE_NETWORKING
menu_entries_append_enum(info->list,
"Refresh Room List",
msg_hash_to_str(MENU_ENUM_LABEL_SCAN_DIRECTORY),
MENU_ENUM_LABEL_SCAN_DIRECTORY,
MENU_SETTING_ACTION, 0, 0);
#endif
return 0;
}
static int menu_displaylist_parse_options(
menu_displaylist_info_t *info)
{
@ -3781,6 +3797,12 @@ static bool menu_displaylist_push_internal(
return false;
return true;
}
else if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_NETPLAY_TAB)))
{
if (!menu_displaylist_ctl(DISPLAYLIST_NETPLAY_ROOM_LIST, info))
return false;
return true;
}
else if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_HORIZONTAL_MENU)))
{
if (!menu_displaylist_ctl(DISPLAYLIST_HORIZONTAL, info))
@ -3909,6 +3931,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
case DISPLAYLIST_ADD_CONTENT_LIST:
case DISPLAYLIST_CONFIGURATIONS_LIST:
case DISPLAYLIST_SCAN_DIRECTORY_LIST:
case DISPLAYLIST_NETPLAY_ROOM_LIST:
case DISPLAYLIST_LOAD_CONTENT_LIST:
case DISPLAYLIST_USER_BINDS_LIST:
case DISPLAYLIST_ACCOUNTS_LIST:
@ -5312,6 +5335,12 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
case DISPLAYLIST_SCAN_DIRECTORY_LIST:
ret = menu_displaylist_parse_scan_directory_list(info);
info->need_push = true;
info->need_refresh = true;
break;
case DISPLAYLIST_NETPLAY_ROOM_LIST:
ret = menu_displaylist_parse_netplay_room_list(info);
info->need_push = true;
info->need_refresh = true;
break;

View File

@ -151,6 +151,7 @@ enum menu_displaylist_ctl_state
DISPLAYLIST_ADD_CONTENT_LIST,
DISPLAYLIST_CONFIGURATIONS_LIST,
DISPLAYLIST_SCAN_DIRECTORY_LIST,
DISPLAYLIST_NETPLAY_ROOM_LIST,
DISPLAYLIST_ARCHIVE_ACTION,
DISPLAYLIST_ARCHIVE_ACTION_DETECT_CORE,
DISPLAYLIST_CORE_CONTENT,

View File

@ -158,6 +158,7 @@ enum menu_settings_type
MENU_MUSIC_TAB,
MENU_VIDEO_TAB,
MENU_IMAGES_TAB,
MENU_NETPLAY_TAB,
MENU_ADD_TAB,
MENU_PLAYLISTS_TAB,
MENU_SETTING_NO_ITEM,

View File

@ -1146,6 +1146,7 @@ enum msg_hash_enums
MENU_LABEL(SETTINGS_TAB),
MENU_LABEL(HISTORY_TAB),
MENU_LABEL(ADD_TAB),
MENU_LABEL(NETPLAY_TAB),
MENU_LABEL(PLAYLISTS_TAB),
MENU_LABEL(MAIN_MENU),
MENU_LABEL(INPUT_SETTINGS),

View File

@ -551,7 +551,6 @@ bool netplay_pre_frame(netplay_t *netplay)
{
bool sync_stalled;
reannounce ++;
RARCH_LOG("%d\n", reannounce);
if (reannounce % 3600 == 0)
netplay_announce();
retro_assert(netplay);