(Menu) Refactor netplay_tcp_udp_port setting with MENU_FILE_LINEFEED

This commit is contained in:
twinaphex 2014-09-06 00:16:05 +02:00
parent 5793042b7d
commit 780688ec92
2 changed files with 5 additions and 5 deletions

View File

@ -552,12 +552,12 @@ static void menu_common_setting_set_current_fraction(
}
static void menu_common_setting_set_current_unsigned_integer(
rarch_setting_t *setting, unsigned action)
rarch_setting_t *setting, unsigned id, unsigned action)
{
if (!strcmp(setting->name, "netplay_tcp_udp_port"))
if (id == MENU_FILE_LINEFEED)
{
if (action == MENU_ACTION_OK)
menu_key_start_line(driver.menu, "TCP/UDP Port: ",
menu_key_start_line(driver.menu, setting->short_description,
setting->name, st_uint_callback);
else if (action == MENU_ACTION_START)
*setting->value.unsigned_integer =
@ -641,7 +641,7 @@ static void handle_setting(rarch_setting_t *setting,
if (setting->type == ST_BOOL)
menu_common_setting_set_current_boolean(setting, action);
else if (setting->type == ST_UINT)
menu_common_setting_set_current_unsigned_integer(setting, action);
menu_common_setting_set_current_unsigned_integer(setting, id, action);
else if (setting->type == ST_FLOAT)
menu_common_setting_set_current_fraction(setting, action);
else if (setting->type == ST_DIR)

View File

@ -307,7 +307,7 @@ int menu_entries_push_list(menu_handle_t *menu,
add_setting_entry(menu,list,"netplay_mode", 0, setting_data);
add_setting_entry(menu,list,"netplay_spectator_mode_enable", 0, setting_data);
add_setting_entry(menu,list,"netplay_ip_address", 0, setting_data);
add_setting_entry(menu,list,"netplay_tcp_udp_port", 0, setting_data);
add_setting_entry(menu,list,"netplay_tcp_udp_port", MENU_FILE_LINEFEED, setting_data);
add_setting_entry(menu,list,"netplay_delay_frames", 0, setting_data);
}
else if (!strcmp(label, "core_counters"))