(Menu) Add stub Navigation Wrap-Around options

This commit is contained in:
twinaphex 2014-11-17 16:16:52 +01:00
parent 23a9d43b08
commit d87470c597
5 changed files with 53 additions and 2 deletions

View File

@ -293,6 +293,14 @@ struct settings
char driver[32];
bool pause_libretro;
bool mouse_enable;
struct
{
struct
{
bool horizontal_enable;
bool vertical_enable;
} wraparound;
} navigation;
} menu;
#endif

View File

@ -598,8 +598,8 @@ static int menu_common_iterate(unsigned action)
{
case MENU_ACTION_UP:
if (driver.menu->selection_ptr >= scroll_speed)
menu_navigation_set(driver.menu,
driver.menu->selection_ptr - scroll_speed, true);
menu_navigation_set(driver.menu,
driver.menu->selection_ptr - scroll_speed, true);
else
menu_navigation_set(driver.menu,
menu_list_get_size(driver.menu->menu_list) - 1, true);

View File

@ -548,6 +548,12 @@
# Enable mouse input inside the menu.
# menu_mouse_enable = false
# Wrap-around toe beginning and/or end if boundary of list reached horizontally
# menu_navigation_wraparound_horizontal_enable = false
# Wrap-around to beginning and/or end if boundary of list reached vertically
# menu_navigation_wraparound_vertical_enable = false
#### Camera
# Override the default camera device the camera driver uses. This is driver dependant.

View File

@ -433,6 +433,8 @@ static void config_set_defaults(void)
g_settings.menu_show_start_screen = menu_show_start_screen;
g_settings.menu.pause_libretro = true;
g_settings.menu.mouse_enable = false;
g_settings.menu.navigation.wraparound.horizontal_enable = true;
g_settings.menu.navigation.wraparound.vertical_enable = true;
#endif
g_settings.location.allow = false;
@ -886,6 +888,8 @@ static bool config_load_file(const char *path, bool set_defaults)
#ifdef HAVE_MENU
CONFIG_GET_BOOL(menu.pause_libretro, "menu_pause_libretro");
CONFIG_GET_BOOL(menu.mouse_enable, "menu_mouse_enable");
CONFIG_GET_BOOL(menu.navigation.wraparound.horizontal_enable, "menu_navigation_wraparound_horizontal_enable");
CONFIG_GET_BOOL(menu.navigation.wraparound.vertical_enable, "menu_navigation_wraparound_vertical_enable");
#endif
CONFIG_GET_INT(video.hard_sync_frames, "video_hard_sync_frames");
@ -1657,6 +1661,10 @@ bool config_save_file(const char *path)
g_settings.menu_config_directory : "default");
config_set_bool(conf, "rgui_show_start_screen",
g_settings.menu_show_start_screen);
config_set_bool(conf, "menu_navigation_wraparound_horizontal_enable",
g_settings.menu.navigation.wraparound.horizontal_enable);
config_set_bool(conf, "menu_navigation_wraparound_vertical_enable",
g_settings.menu.navigation.wraparound.vertical_enable);
#endif
config_set_path(conf, "game_history_path", g_settings.content_history_path);

View File

@ -4629,6 +4629,35 @@ static bool setting_data_append_list_menu_options(
general_read_handler);
END_SUB_GROUP(list, list_info);
START_SUB_GROUP(list, list_info, "Navigation", group_info.name, subgroup_info);
CONFIG_BOOL(
g_settings.menu.navigation.wraparound.horizontal_enable,
"menu_navigation_wraparound_horizontal_enable",
"Navigation Wrap-Around Horizontal",
true,
"OFF",
"ON",
group_info.name,
subgroup_info.name,
general_write_handler,
general_read_handler);
CONFIG_BOOL(
g_settings.menu.navigation.wraparound.vertical_enable,
"menu_navigation_wraparound_vertical_enable",
"Navigation Wrap-Around Vertical",
true,
"OFF",
"ON",
group_info.name,
subgroup_info.name,
general_write_handler,
general_read_handler);
END_SUB_GROUP(list, list_info);
END_GROUP(list, list_info);
#endif