2015-05-18 15:56:32 +02:00
|
|
|
/* RetroArch - A frontend for libretro.
|
2017-01-22 13:40:32 +01:00
|
|
|
* Copyright (C) 2011-2017 - Daniel De Matteis
|
2015-05-18 15:56:32 +02:00
|
|
|
*
|
|
|
|
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
|
|
|
* of the GNU General Public License as published by the Free Software Found-
|
|
|
|
* ation, either version 3 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
|
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE. See the GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along with RetroArch.
|
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2016-09-01 18:01:41 +02:00
|
|
|
#include <compat/strl.h>
|
2015-05-18 15:56:32 +02:00
|
|
|
#include <file/file_path.h>
|
2016-01-20 04:54:17 +01:00
|
|
|
#include <string/stdstring.h>
|
2016-03-20 14:53:54 +01:00
|
|
|
#include <lists/string_list.h>
|
2015-06-05 09:50:47 +02:00
|
|
|
|
2016-09-08 05:39:08 +02:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "../../config.h"
|
|
|
|
#endif
|
|
|
|
|
2016-07-01 15:55:36 +02:00
|
|
|
#include "../menu_content.h"
|
2015-12-06 17:55:27 +01:00
|
|
|
#include "../menu_driver.h"
|
2018-02-25 00:39:20 +01:00
|
|
|
#include "../menu_entries.h"
|
2015-06-26 15:28:01 +02:00
|
|
|
#include "../menu_cbs.h"
|
2015-06-13 19:12:10 +02:00
|
|
|
#include "../menu_input.h"
|
2015-06-08 14:35:58 +02:00
|
|
|
#include "../menu_setting.h"
|
|
|
|
#include "../menu_shader.h"
|
2015-05-18 15:56:32 +02:00
|
|
|
|
2016-09-05 18:31:32 +02:00
|
|
|
#include "../../configuration.h"
|
2016-09-06 06:11:44 +02:00
|
|
|
#include "../../core.h"
|
2015-12-11 13:56:00 +01:00
|
|
|
#include "../../core_info.h"
|
2016-05-09 18:20:52 +02:00
|
|
|
#include "../../managers/cheat_manager.h"
|
2016-07-01 15:55:36 +02:00
|
|
|
#include "../../file_path_special.h"
|
2018-04-09 03:48:08 +02:00
|
|
|
#include "../../driver.h"
|
|
|
|
#include "../../audio/audio_driver.h"
|
|
|
|
#include "../../gfx/video_driver.h"
|
2015-06-08 14:35:58 +02:00
|
|
|
#include "../../retroarch.h"
|
2018-02-02 15:37:02 -05:00
|
|
|
#include "../../network/netplay/netplay.h"
|
2015-05-18 15:56:32 +02:00
|
|
|
|
2015-10-11 20:26:44 +02:00
|
|
|
#ifndef BIND_ACTION_LEFT
|
|
|
|
#define BIND_ACTION_LEFT(cbs, name) \
|
2017-01-09 19:26:34 +01:00
|
|
|
do { \
|
|
|
|
cbs->action_left = name; \
|
|
|
|
cbs->action_left_ident = #name; \
|
|
|
|
} while(0)
|
2015-10-11 20:26:44 +02:00
|
|
|
#endif
|
|
|
|
|
2018-03-31 11:45:36 -05:00
|
|
|
extern struct key_desc key_descriptors[RARCH_MAX_KEYS];
|
2017-09-10 11:30:10 -05:00
|
|
|
|
2015-09-07 21:22:19 +02:00
|
|
|
static int generic_shader_action_parameter_left(
|
2017-01-09 03:18:37 +01:00
|
|
|
struct video_shader_parameter *param,
|
2015-09-07 21:22:19 +02:00
|
|
|
unsigned type, const char *label, bool wraparound)
|
2015-05-18 15:56:32 +02:00
|
|
|
{
|
2017-01-09 03:18:37 +01:00
|
|
|
param->current -= param->step;
|
|
|
|
param->current = MIN(MAX(param->minimum, param->current),
|
|
|
|
param->maximum);
|
2015-09-02 16:36:59 +02:00
|
|
|
return 0;
|
|
|
|
}
|
2015-05-18 15:56:32 +02:00
|
|
|
|
2018-04-11 06:11:38 +02:00
|
|
|
static int shader_action_parameter_left(unsigned type, const char *label, bool wraparound)
|
2015-05-18 15:56:32 +02:00
|
|
|
{
|
2016-02-14 22:13:21 +01:00
|
|
|
video_shader_ctx_t shader_info;
|
2018-02-27 05:07:17 +01:00
|
|
|
struct video_shader *shader = menu_shader_get();
|
2018-03-16 09:32:22 -05:00
|
|
|
struct video_shader_parameter *param_menu = NULL;
|
|
|
|
struct video_shader_parameter *param_prev = NULL;
|
|
|
|
|
|
|
|
int ret = 0;
|
2016-02-14 22:13:21 +01:00
|
|
|
|
2016-05-08 21:11:27 +02:00
|
|
|
video_shader_driver_get_current_shader(&shader_info);
|
2016-02-14 22:13:21 +01:00
|
|
|
|
2018-03-16 09:32:22 -05:00
|
|
|
param_prev = &shader_info.data->parameters[type - MENU_SETTINGS_SHADER_PARAMETER_0];
|
2018-09-15 01:21:03 -04:00
|
|
|
param_menu = shader ? &shader->parameters[type -
|
2018-02-27 05:07:17 +01:00
|
|
|
MENU_SETTINGS_SHADER_PARAMETER_0] : NULL;
|
2018-03-17 14:55:15 -05:00
|
|
|
|
|
|
|
if (!param_prev || !param_menu)
|
2018-02-08 22:24:18 -05:00
|
|
|
return menu_cbs_exit();
|
2018-03-17 14:55:15 -05:00
|
|
|
ret = generic_shader_action_parameter_left(param_prev, type, label, wraparound);
|
|
|
|
|
2018-03-16 09:32:22 -05:00
|
|
|
param_menu->current = param_prev->current;
|
|
|
|
|
|
|
|
return ret;
|
2015-05-18 15:56:32 +02:00
|
|
|
}
|
2018-02-08 22:24:18 -05:00
|
|
|
|
2018-04-30 17:51:01 +02:00
|
|
|
static int audio_mixer_stream_volume_left(unsigned type, const char *label,
|
|
|
|
bool wraparound)
|
|
|
|
{
|
|
|
|
unsigned offset = (type - MENU_SETTINGS_AUDIO_MIXER_STREAM_ACTIONS_VOLUME_BEGIN);
|
|
|
|
float orig_volume = 0.0f;
|
2018-09-15 01:21:03 -04:00
|
|
|
|
2018-04-30 17:51:01 +02:00
|
|
|
if (offset >= AUDIO_MIXER_MAX_STREAMS)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
orig_volume = audio_driver_mixer_get_stream_volume(offset);
|
|
|
|
orig_volume = orig_volume - 1.00f;
|
|
|
|
|
|
|
|
audio_driver_mixer_set_stream_volume(offset, orig_volume);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-04-11 06:11:38 +02:00
|
|
|
static int action_left_cheat(unsigned type, const char *label,
|
2015-05-18 15:56:32 +02:00
|
|
|
bool wraparound)
|
|
|
|
{
|
|
|
|
size_t idx = type - MENU_SETTINGS_CHEAT_BEGIN;
|
2015-09-05 17:09:57 +02:00
|
|
|
return generic_action_cheat_toggle(idx, type, label,
|
|
|
|
wraparound);
|
2015-05-18 15:56:32 +02:00
|
|
|
}
|
|
|
|
|
2018-04-11 06:11:38 +02:00
|
|
|
static int action_left_input_desc(unsigned type, const char *label,
|
|
|
|
bool wraparound)
|
2015-05-18 15:56:32 +02:00
|
|
|
{
|
2018-04-02 22:05:48 -05:00
|
|
|
rarch_system_info_t *system = runloop_get_system_info();
|
|
|
|
settings_t *settings = config_get_ptr();
|
|
|
|
unsigned btn_idx, user_idx, remap_idx;
|
2018-04-01 20:57:33 -05:00
|
|
|
|
2018-04-02 22:05:48 -05:00
|
|
|
if (!settings || !system)
|
2018-04-01 20:57:33 -05:00
|
|
|
return 0;
|
|
|
|
|
2018-04-02 20:27:51 -05:00
|
|
|
user_idx = (type - MENU_SETTINGS_INPUT_DESC_BEGIN) / (RARCH_FIRST_CUSTOM_BIND + 8);
|
|
|
|
btn_idx = (type - MENU_SETTINGS_INPUT_DESC_BEGIN) - (RARCH_FIRST_CUSTOM_BIND + 8) * user_idx;
|
2018-04-01 20:57:33 -05:00
|
|
|
|
2018-04-03 00:21:33 -05:00
|
|
|
if (settings->uints.input_remap_ids[user_idx][btn_idx] == RARCH_UNMAPPED)
|
|
|
|
settings->uints.input_remap_ids[user_idx][btn_idx] = RARCH_CUSTOM_BIND_LIST_END - 1;
|
|
|
|
|
2018-04-02 20:27:51 -05:00
|
|
|
if (settings->uints.input_remap_ids[user_idx][btn_idx] > 0)
|
|
|
|
settings->uints.input_remap_ids[user_idx][btn_idx]--;
|
2018-04-03 00:21:33 -05:00
|
|
|
else if (settings->uints.input_remap_ids[user_idx][btn_idx] == 0)
|
|
|
|
settings->uints.input_remap_ids[user_idx][btn_idx] = RARCH_UNMAPPED;
|
2018-04-02 22:05:48 -05:00
|
|
|
else
|
2018-04-03 00:21:33 -05:00
|
|
|
settings->uints.input_remap_ids[user_idx][btn_idx] = RARCH_CUSTOM_BIND_LIST_END - 1;
|
2018-04-02 22:05:48 -05:00
|
|
|
|
|
|
|
remap_idx = settings->uints.input_remap_ids[user_idx][btn_idx];
|
2018-04-03 00:21:33 -05:00
|
|
|
|
|
|
|
/* skip the not used buttons (unless they are at the end by calling the right desc function recursively
|
|
|
|
also skip all the axes until analog remapping is implemented */
|
2018-09-15 01:21:03 -04:00
|
|
|
if (remap_idx != RARCH_UNMAPPED)
|
|
|
|
{
|
|
|
|
if ((string_is_empty(system->input_desc_btn[user_idx][remap_idx]) && remap_idx < RARCH_CUSTOM_BIND_LIST_END) /*||
|
|
|
|
(remap_idx >= RARCH_FIRST_CUSTOM_BIND && remap_idx < RARCH_CUSTOM_BIND_LIST_END)*/)
|
|
|
|
action_left_input_desc(type, label, wraparound);
|
|
|
|
}
|
2015-05-18 15:56:32 +02:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-04-11 06:11:38 +02:00
|
|
|
static int action_left_input_desc_kbd(unsigned type, const char *label,
|
|
|
|
bool wraparound)
|
2017-09-10 11:30:10 -05:00
|
|
|
{
|
2017-09-18 16:40:38 +02:00
|
|
|
unsigned remap_id;
|
2018-05-13 13:31:55 +02:00
|
|
|
unsigned key_id, user_idx, btn_idx;
|
2017-09-18 16:40:38 +02:00
|
|
|
settings_t *settings = config_get_ptr();
|
2017-09-10 11:30:10 -05:00
|
|
|
|
|
|
|
if (!settings)
|
|
|
|
return 0;
|
|
|
|
|
2018-05-13 13:31:55 +02:00
|
|
|
user_idx = (type - MENU_SETTINGS_INPUT_DESC_KBD_BEGIN) / RARCH_FIRST_CUSTOM_BIND;
|
|
|
|
btn_idx = (type - MENU_SETTINGS_INPUT_DESC_KBD_BEGIN) - RARCH_FIRST_CUSTOM_BIND * user_idx;
|
2018-03-30 11:56:01 -05:00
|
|
|
|
|
|
|
remap_id =
|
2018-05-13 13:31:55 +02:00
|
|
|
settings->uints.input_keymapper_ids[user_idx][btn_idx];
|
2017-09-18 16:40:38 +02:00
|
|
|
|
2018-04-12 14:20:38 -05:00
|
|
|
for (key_id = 0; key_id < RARCH_MAX_KEYS - 1; key_id++)
|
2017-09-10 11:30:10 -05:00
|
|
|
{
|
2018-09-25 01:49:48 +02:00
|
|
|
if (remap_id == key_descriptors[key_id].key)
|
2017-09-10 11:30:10 -05:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2017-09-10 11:44:16 -05:00
|
|
|
if (key_id > 0)
|
2017-09-10 11:30:10 -05:00
|
|
|
key_id--;
|
|
|
|
else
|
2018-04-19 10:07:59 -05:00
|
|
|
key_id = (RARCH_MAX_KEYS - 1) + MENU_SETTINGS_INPUT_DESC_KBD_BEGIN;
|
2017-09-10 11:30:10 -05:00
|
|
|
|
2018-05-13 13:31:55 +02:00
|
|
|
settings->uints.input_keymapper_ids[user_idx][btn_idx] = key_descriptors[key_id].key;
|
2017-09-10 11:30:10 -05:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-04-11 06:11:38 +02:00
|
|
|
static int action_left_scroll(unsigned type, const char *label,
|
2015-05-18 15:56:32 +02:00
|
|
|
bool wraparound)
|
|
|
|
{
|
2015-09-25 18:43:42 +02:00
|
|
|
size_t scroll_accel = 0;
|
2015-05-18 15:56:32 +02:00
|
|
|
unsigned scroll_speed = 0, fast_scroll_speed = 0;
|
2017-04-23 14:31:49 +02:00
|
|
|
size_t selection = menu_navigation_get_selection();
|
|
|
|
|
2017-05-17 04:57:43 +02:00
|
|
|
if (!menu_driver_ctl(MENU_NAVIGATION_CTL_GET_SCROLL_ACCEL, &scroll_accel))
|
2015-09-25 18:43:42 +02:00
|
|
|
return false;
|
2015-09-25 14:57:37 +02:00
|
|
|
|
2017-02-26 21:46:19 +01:00
|
|
|
scroll_speed = (unsigned)((MAX(scroll_accel, 2) - 2) / 4 + 1);
|
2016-03-02 00:07:31 +01:00
|
|
|
fast_scroll_speed = 4 + 4 * scroll_speed;
|
2015-05-18 15:56:32 +02:00
|
|
|
|
2015-09-06 02:06:02 +02:00
|
|
|
if (selection > fast_scroll_speed)
|
2015-09-25 15:42:31 +02:00
|
|
|
{
|
|
|
|
size_t idx = selection - fast_scroll_speed;
|
2017-04-23 14:31:49 +02:00
|
|
|
menu_navigation_set_selection(idx);
|
2017-05-15 07:56:22 +02:00
|
|
|
menu_driver_navigation_set(true);
|
2015-09-25 15:42:31 +02:00
|
|
|
}
|
2015-05-18 15:56:32 +02:00
|
|
|
else
|
2015-09-25 15:15:31 +02:00
|
|
|
{
|
|
|
|
bool pending_push = false;
|
2017-05-17 04:57:43 +02:00
|
|
|
menu_driver_ctl(MENU_NAVIGATION_CTL_CLEAR, &pending_push);
|
2015-09-25 15:15:31 +02:00
|
|
|
}
|
2015-05-18 15:56:32 +02:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-04-11 06:11:38 +02:00
|
|
|
static int action_left_mainmenu(unsigned type, const char *label,
|
2015-05-18 15:56:32 +02:00
|
|
|
bool wraparound)
|
|
|
|
{
|
2016-02-11 00:59:55 +01:00
|
|
|
menu_ctx_list_t list_info;
|
2017-02-22 18:45:07 +01:00
|
|
|
unsigned push_list = 0;
|
2018-04-11 06:11:38 +02:00
|
|
|
menu_handle_t *menu = NULL;
|
2017-12-11 23:55:31 -08:00
|
|
|
|
2018-04-11 06:11:38 +02:00
|
|
|
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
2017-02-22 18:44:59 +01:00
|
|
|
return menu_cbs_exit();
|
|
|
|
|
2018-09-26 14:22:22 +02:00
|
|
|
menu_driver_list_get_selection(&list_info);
|
2016-02-11 00:59:55 +01:00
|
|
|
|
2016-02-11 01:07:30 +01:00
|
|
|
list_info.type = MENU_LIST_PLAIN;
|
|
|
|
|
2018-09-26 14:22:22 +02:00
|
|
|
menu_driver_list_get_size(&list_info);
|
2016-02-11 01:07:30 +01:00
|
|
|
|
|
|
|
if (list_info.size == 1)
|
2015-05-18 15:56:32 +02:00
|
|
|
{
|
2017-02-22 06:00:50 +01:00
|
|
|
settings_t *settings = config_get_ptr();
|
|
|
|
|
2016-02-11 00:59:55 +01:00
|
|
|
if ((list_info.selection != 0)
|
2017-04-28 13:43:47 +02:00
|
|
|
|| settings->bools.menu_navigation_wraparound_enable)
|
2017-02-22 18:45:07 +01:00
|
|
|
push_list = 1;
|
2015-05-18 15:56:32 +02:00
|
|
|
}
|
2015-05-20 21:11:20 -05:00
|
|
|
else
|
2017-02-22 18:45:07 +01:00
|
|
|
push_list = 2;
|
2015-05-18 15:56:32 +02:00
|
|
|
|
2017-02-22 18:45:07 +01:00
|
|
|
switch (push_list)
|
|
|
|
{
|
|
|
|
case 1:
|
|
|
|
{
|
|
|
|
menu_ctx_list_t list_info;
|
|
|
|
file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0);
|
|
|
|
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
|
2017-04-23 14:31:49 +02:00
|
|
|
size_t selection = menu_navigation_get_selection();
|
2019-05-13 04:27:03 +02:00
|
|
|
menu_file_list_cbs_t *cbs = selection_buf ?
|
|
|
|
(menu_file_list_cbs_t*)
|
|
|
|
selection_buf->list[selection].actiondata : NULL;
|
2017-02-22 18:45:07 +01:00
|
|
|
|
2017-04-23 14:31:49 +02:00
|
|
|
list_info.type = MENU_LIST_HORIZONTAL;
|
|
|
|
list_info.action = MENU_ACTION_LEFT;
|
2017-02-22 18:45:07 +01:00
|
|
|
|
2018-09-26 14:22:22 +02:00
|
|
|
menu_driver_list_cache(&list_info);
|
2017-02-22 18:45:07 +01:00
|
|
|
|
|
|
|
if (cbs && cbs->action_content_list_switch)
|
2018-04-11 06:11:38 +02:00
|
|
|
return cbs->action_content_list_switch(
|
2017-02-22 18:45:07 +01:00
|
|
|
selection_buf, menu_stack, "", "", 0);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 2:
|
2018-04-11 06:11:38 +02:00
|
|
|
action_left_scroll(0, "", false);
|
2017-02-22 18:45:07 +01:00
|
|
|
break;
|
|
|
|
case 0:
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2015-05-18 15:56:32 +02:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-04-11 06:11:38 +02:00
|
|
|
static int action_left_shader_scale_pass(unsigned type, const char *label,
|
2015-05-18 15:56:32 +02:00
|
|
|
bool wraparound)
|
|
|
|
{
|
2017-01-09 03:06:24 +01:00
|
|
|
unsigned current_scale, delta;
|
2017-12-11 23:55:31 -08:00
|
|
|
unsigned pass = type -
|
2017-01-09 03:06:24 +01:00
|
|
|
MENU_SETTINGS_SHADER_PASS_SCALE_0;
|
2018-02-27 05:07:17 +01:00
|
|
|
struct video_shader *shader = menu_shader_get();
|
|
|
|
struct video_shader_pass *shader_pass = shader ? &shader->pass[pass] : NULL;
|
2015-05-20 21:11:20 -05:00
|
|
|
|
2015-05-18 15:56:32 +02:00
|
|
|
if (!shader_pass)
|
2016-02-10 21:42:18 +01:00
|
|
|
return menu_cbs_exit();
|
2015-05-18 15:56:32 +02:00
|
|
|
|
2017-01-09 03:06:24 +01:00
|
|
|
current_scale = shader_pass->fbo.scale_x;
|
|
|
|
delta = 5;
|
|
|
|
current_scale = (current_scale + delta) % 6;
|
2015-05-18 15:56:32 +02:00
|
|
|
|
2017-01-09 03:06:24 +01:00
|
|
|
shader_pass->fbo.valid = current_scale;
|
|
|
|
shader_pass->fbo.scale_x = current_scale;
|
|
|
|
shader_pass->fbo.scale_y = current_scale;
|
2015-05-18 15:56:32 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-04-11 06:11:38 +02:00
|
|
|
static int action_left_shader_filter_pass(unsigned type, const char *label,
|
2015-05-18 15:56:32 +02:00
|
|
|
bool wraparound)
|
|
|
|
{
|
2015-09-02 16:36:59 +02:00
|
|
|
unsigned delta = 2;
|
2015-12-10 19:56:08 +01:00
|
|
|
unsigned pass = type - MENU_SETTINGS_SHADER_PASS_FILTER_0;
|
2018-02-27 05:07:17 +01:00
|
|
|
struct video_shader *shader = menu_shader_get();
|
|
|
|
struct video_shader_pass *shader_pass = shader ? &shader->pass[pass] : NULL;
|
2015-05-20 21:11:20 -05:00
|
|
|
|
2015-05-18 15:56:32 +02:00
|
|
|
if (!shader_pass)
|
2016-02-10 21:42:18 +01:00
|
|
|
return menu_cbs_exit();
|
2015-05-18 15:56:32 +02:00
|
|
|
|
2015-09-02 16:36:59 +02:00
|
|
|
shader_pass->filter = ((shader_pass->filter + delta) % 3);
|
2015-05-18 15:56:32 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-04-11 06:11:38 +02:00
|
|
|
static int action_left_shader_filter_default(unsigned type, const char *label,
|
2015-05-18 15:56:32 +02:00
|
|
|
bool wraparound)
|
|
|
|
{
|
2016-07-02 07:05:43 +02:00
|
|
|
rarch_setting_t *setting = menu_setting_find_enum(
|
|
|
|
MENU_ENUM_LABEL_VIDEO_SMOOTH);
|
2015-06-03 10:33:41 +02:00
|
|
|
if (!setting)
|
2016-02-10 21:42:18 +01:00
|
|
|
return menu_cbs_exit();
|
2018-04-11 06:11:23 +02:00
|
|
|
return menu_action_handle_setting(setting,
|
2016-10-31 15:01:40 +01:00
|
|
|
setting_get_type(setting), MENU_ACTION_LEFT, wraparound);
|
2015-05-18 15:56:32 +02:00
|
|
|
}
|
|
|
|
|
2018-04-11 06:11:38 +02:00
|
|
|
static int action_left_cheat_num_passes(unsigned type, const char *label,
|
2015-05-18 15:56:32 +02:00
|
|
|
bool wraparound)
|
|
|
|
{
|
2015-12-12 02:14:50 +01:00
|
|
|
bool refresh = false;
|
2015-05-18 15:56:32 +02:00
|
|
|
unsigned new_size = 0;
|
|
|
|
|
2015-12-01 02:55:07 +01:00
|
|
|
if (cheat_manager_get_size())
|
|
|
|
new_size = cheat_manager_get_size() - 1;
|
2015-12-12 02:14:50 +01:00
|
|
|
menu_entries_ctl(MENU_ENTRIES_CTL_SET_REFRESH, &refresh);
|
2015-12-07 16:55:13 +01:00
|
|
|
menu_driver_ctl(RARCH_MENU_CTL_SET_PREVENT_POPULATE, NULL);
|
2018-09-23 15:25:51 -04:00
|
|
|
cheat_manager_realloc(new_size, CHEAT_HANDLER_TYPE_EMU);
|
2015-05-18 15:56:32 +02:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-04-11 06:11:38 +02:00
|
|
|
static int action_left_shader_num_passes(unsigned type, const char *label,
|
2015-05-18 15:56:32 +02:00
|
|
|
bool wraparound)
|
|
|
|
{
|
2015-12-12 02:14:50 +01:00
|
|
|
bool refresh = false;
|
2017-01-09 03:53:55 +01:00
|
|
|
struct video_shader *shader = menu_shader_get();
|
2018-02-27 05:07:17 +01:00
|
|
|
unsigned pass_count = shader ? shader->passes : 0;
|
2015-05-20 21:11:20 -05:00
|
|
|
|
2015-05-18 15:56:32 +02:00
|
|
|
if (!shader)
|
2016-02-10 21:42:18 +01:00
|
|
|
return menu_cbs_exit();
|
2015-05-18 15:56:32 +02:00
|
|
|
|
2018-02-27 05:07:17 +01:00
|
|
|
if (pass_count > 0)
|
2019-04-13 06:40:21 +02:00
|
|
|
shader->passes--;
|
2017-01-09 20:42:15 +01:00
|
|
|
|
2015-12-12 02:14:50 +01:00
|
|
|
menu_entries_ctl(MENU_ENTRIES_CTL_SET_REFRESH, &refresh);
|
2015-12-07 16:55:13 +01:00
|
|
|
menu_driver_ctl(RARCH_MENU_CTL_SET_PREVENT_POPULATE, NULL);
|
2015-12-10 19:56:08 +01:00
|
|
|
video_shader_resolve_parameters(NULL, shader);
|
2015-05-18 15:56:32 +02:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-04-11 06:11:38 +02:00
|
|
|
static int action_left_shader_watch_for_changes(unsigned type, const char *label,
|
2018-01-25 15:50:57 -05:00
|
|
|
bool wraparound)
|
|
|
|
{
|
|
|
|
settings_t *settings = config_get_ptr();
|
|
|
|
settings->bools.video_shader_watch_files = !settings->bools.video_shader_watch_files;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-04-11 06:11:38 +02:00
|
|
|
static int action_left_video_resolution(unsigned type, const char *label,
|
2015-05-18 15:56:32 +02:00
|
|
|
bool wraparound)
|
2015-05-20 21:11:20 -05:00
|
|
|
{
|
2016-05-08 14:00:51 +02:00
|
|
|
video_driver_get_prev_video_out();
|
2015-05-18 15:56:32 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-04-11 06:11:38 +02:00
|
|
|
static int playlist_association_left(unsigned type, const char *label,
|
2015-10-26 07:16:37 +01:00
|
|
|
bool wraparound)
|
|
|
|
{
|
2019-06-12 12:01:31 +01:00
|
|
|
size_t i, next, found, current = 0;
|
2015-11-25 04:05:04 +01:00
|
|
|
core_info_t *info = NULL;
|
2015-11-25 03:38:57 +01:00
|
|
|
struct string_list *stnames = NULL;
|
|
|
|
struct string_list *stcores = NULL;
|
2015-11-20 05:20:13 +07:00
|
|
|
settings_t *settings = config_get_ptr();
|
|
|
|
const char *path = path_basename(label);
|
2015-12-11 13:51:17 +01:00
|
|
|
core_info_list_t *list = NULL;
|
2019-06-12 12:01:31 +01:00
|
|
|
char core_path[PATH_MAX_LENGTH];
|
|
|
|
char new_playlist_cores[sizeof(settings->arrays.playlist_cores) / sizeof(settings->arrays.playlist_cores[0])];
|
2017-12-11 23:55:31 -08:00
|
|
|
|
2016-05-09 18:11:17 +02:00
|
|
|
core_info_get_list(&list);
|
2015-12-11 13:51:17 +01:00
|
|
|
|
2015-11-20 05:20:13 +07:00
|
|
|
if (!list)
|
2016-02-10 21:42:18 +01:00
|
|
|
return menu_cbs_exit();
|
2015-11-20 05:20:13 +07:00
|
|
|
|
2016-10-08 19:16:25 +02:00
|
|
|
core_path[0] = new_playlist_cores[0] = '\0';
|
|
|
|
|
2017-04-28 22:59:13 +02:00
|
|
|
stnames = string_split(settings->arrays.playlist_names, ";");
|
|
|
|
stcores = string_split(settings->arrays.playlist_cores, ";");
|
2015-11-20 05:20:13 +07:00
|
|
|
|
2016-07-02 07:05:43 +02:00
|
|
|
if (!menu_content_playlist_find_associated_core(path,
|
|
|
|
core_path, sizeof(core_path)))
|
2016-07-01 15:55:36 +02:00
|
|
|
strlcpy(core_path,
|
2016-07-02 07:05:43 +02:00
|
|
|
file_path_str(FILE_PATH_DETECT),
|
|
|
|
sizeof(core_path));
|
2015-11-20 05:20:13 +07:00
|
|
|
|
|
|
|
for (i = 0; i < list->count; i++)
|
|
|
|
{
|
|
|
|
core_info_t *info = core_info_get(list, i);
|
2016-01-20 04:54:17 +01:00
|
|
|
if (string_is_equal(info->path, core_path))
|
2015-11-20 05:20:13 +07:00
|
|
|
current = i;
|
|
|
|
}
|
|
|
|
|
|
|
|
next = current - 1;
|
|
|
|
if (next < 0)
|
|
|
|
{
|
|
|
|
if (wraparound)
|
2017-03-08 21:32:33 +01:00
|
|
|
next = (int)(list->count-1);
|
2015-11-20 05:20:13 +07:00
|
|
|
else
|
|
|
|
next = 0;
|
|
|
|
}
|
|
|
|
|
2015-11-25 04:05:04 +01:00
|
|
|
info = core_info_get(list, next);
|
2015-11-20 05:20:13 +07:00
|
|
|
found = string_list_find_elem(stnames, path);
|
2017-02-24 06:58:22 +01:00
|
|
|
if (found && info)
|
2015-11-20 05:20:13 +07:00
|
|
|
string_list_set(stcores, found-1, info->path);
|
|
|
|
|
2016-07-02 07:05:43 +02:00
|
|
|
string_list_join_concat(new_playlist_cores,
|
|
|
|
sizeof(new_playlist_cores), stcores, ";");
|
2015-10-26 07:16:37 +01:00
|
|
|
|
2017-04-28 22:59:13 +02:00
|
|
|
strlcpy(settings->arrays.playlist_cores,
|
|
|
|
new_playlist_cores, sizeof(settings->arrays.playlist_cores));
|
2015-10-26 07:16:37 +01:00
|
|
|
|
2016-05-23 22:17:28 +02:00
|
|
|
string_list_free(stnames);
|
|
|
|
string_list_free(stcores);
|
|
|
|
|
2015-10-26 07:16:37 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-04-11 06:11:38 +02:00
|
|
|
static int core_setting_left(unsigned type, const char *label,
|
2015-05-18 15:56:32 +02:00
|
|
|
bool wraparound)
|
|
|
|
{
|
|
|
|
unsigned idx = type - MENU_SETTINGS_CORE_OPTION_START;
|
|
|
|
|
2017-05-15 05:06:23 +02:00
|
|
|
rarch_ctl(RARCH_CTL_CORE_OPTION_PREV, &idx);
|
2015-05-18 15:56:32 +02:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-04-11 06:11:38 +02:00
|
|
|
static int disk_options_disk_idx_left(unsigned type, const char *label,
|
2015-05-18 15:56:32 +02:00
|
|
|
bool wraparound)
|
|
|
|
{
|
2016-05-09 20:51:53 +02:00
|
|
|
command_event(CMD_EVENT_DISK_PREV, NULL);
|
2015-05-18 15:56:32 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-04-11 06:11:38 +02:00
|
|
|
static int bind_left_generic(unsigned type, const char *label,
|
2015-05-18 15:56:32 +02:00
|
|
|
bool wraparound)
|
|
|
|
{
|
2018-09-23 10:59:09 +02:00
|
|
|
return menu_setting_set(type, MENU_ACTION_LEFT, wraparound);
|
2015-05-18 15:56:32 +02:00
|
|
|
}
|
|
|
|
|
2015-06-12 16:01:46 +02:00
|
|
|
static int menu_cbs_init_bind_left_compare_label(menu_file_list_cbs_t *cbs,
|
2018-02-09 01:09:17 +01:00
|
|
|
const char *label, uint32_t label_hash, const char *menu_label)
|
2015-05-18 15:56:32 +02:00
|
|
|
{
|
2015-06-07 18:10:01 +02:00
|
|
|
|
2015-08-17 19:38:00 +02:00
|
|
|
if (cbs->setting)
|
2015-06-07 18:44:42 +02:00
|
|
|
{
|
2016-10-23 03:13:49 +02:00
|
|
|
const char *parent_group = cbs->setting->parent_group;
|
2015-06-14 16:06:25 +02:00
|
|
|
|
2017-12-11 23:55:31 -08:00
|
|
|
if (string_is_equal(parent_group, msg_hash_to_str(MENU_ENUM_LABEL_MAIN_MENU))
|
2016-10-31 15:01:40 +01:00
|
|
|
&& (setting_get_type(cbs->setting) == ST_GROUP))
|
2015-06-07 18:44:42 +02:00
|
|
|
{
|
2015-10-20 19:11:43 +07:00
|
|
|
BIND_ACTION_LEFT(cbs, action_left_mainmenu);
|
2015-06-07 18:44:42 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-08-13 00:45:20 +02:00
|
|
|
if (strstr(label, "input_player") && strstr(label, "_joypad_index"))
|
2015-06-07 18:10:01 +02:00
|
|
|
{
|
2017-08-13 00:45:20 +02:00
|
|
|
unsigned i;
|
|
|
|
for (i = 0; i < MAX_USERS; i++)
|
|
|
|
{
|
2018-02-09 01:09:17 +01:00
|
|
|
uint32_t label_setting_hash;
|
2017-08-13 00:45:20 +02:00
|
|
|
char label_setting[128];
|
2018-02-09 01:09:17 +01:00
|
|
|
|
2017-08-13 00:45:20 +02:00
|
|
|
label_setting[0] = '\0';
|
2015-06-14 16:06:25 +02:00
|
|
|
|
2017-08-13 00:45:20 +02:00
|
|
|
snprintf(label_setting, sizeof(label_setting), "input_player%d_joypad_index", i + 1);
|
2018-02-09 01:09:17 +01:00
|
|
|
label_setting_hash = msg_hash_calculate(label_setting);
|
2015-06-14 16:06:25 +02:00
|
|
|
|
2018-02-09 01:09:17 +01:00
|
|
|
if (label_hash != label_setting_hash)
|
2017-08-13 00:45:20 +02:00
|
|
|
continue;
|
|
|
|
|
|
|
|
BIND_ACTION_LEFT(cbs, bind_left_generic);
|
|
|
|
return 0;
|
|
|
|
}
|
2015-06-07 18:10:01 +02:00
|
|
|
}
|
|
|
|
|
2016-07-09 02:18:58 +02:00
|
|
|
if (string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_PLAYLISTS_TAB)))
|
|
|
|
{
|
|
|
|
BIND_ACTION_LEFT(cbs, action_left_mainmenu);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2019-06-06 17:35:44 +01:00
|
|
|
if (strstr(label, "rdb_entry") || strstr(label, "content_info"))
|
2015-10-11 20:26:44 +02:00
|
|
|
{
|
|
|
|
BIND_ACTION_LEFT(cbs, action_left_scroll);
|
|
|
|
}
|
2015-06-07 18:05:26 +02:00
|
|
|
else
|
2015-05-18 15:56:32 +02:00
|
|
|
{
|
2016-06-20 00:31:13 +02:00
|
|
|
if (cbs->enum_idx != MSG_UNKNOWN)
|
2015-05-18 15:56:32 +02:00
|
|
|
{
|
2016-06-16 20:14:15 +02:00
|
|
|
switch (cbs->enum_idx)
|
|
|
|
{
|
2018-12-22 20:36:42 -05:00
|
|
|
case MENU_ENUM_LABEL_SUBSYSTEM_ADD:
|
|
|
|
case MENU_ENUM_LABEL_SUBSYSTEM_LOAD:
|
2017-02-01 22:38:18 +01:00
|
|
|
case MENU_ENUM_LABEL_CONNECT_NETPLAY_ROOM:
|
|
|
|
BIND_ACTION_LEFT(cbs, action_left_mainmenu);
|
|
|
|
break;
|
2016-06-16 20:14:15 +02:00
|
|
|
case MENU_ENUM_LABEL_VIDEO_SHADER_SCALE_PASS:
|
|
|
|
BIND_ACTION_LEFT(cbs, action_left_shader_scale_pass);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_VIDEO_SHADER_FILTER_PASS:
|
|
|
|
BIND_ACTION_LEFT(cbs, action_left_shader_filter_pass);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_VIDEO_SHADER_DEFAULT_FILTER:
|
|
|
|
BIND_ACTION_LEFT(cbs, action_left_shader_filter_default);
|
|
|
|
break;
|
2018-01-25 15:50:57 -05:00
|
|
|
case MENU_ENUM_LABEL_SHADER_WATCH_FOR_CHANGES:
|
|
|
|
BIND_ACTION_LEFT(cbs, action_left_shader_watch_for_changes);
|
|
|
|
break;
|
2016-06-16 20:14:15 +02:00
|
|
|
case MENU_ENUM_LABEL_VIDEO_SHADER_NUM_PASSES:
|
|
|
|
BIND_ACTION_LEFT(cbs, action_left_shader_num_passes);
|
|
|
|
break;
|
|
|
|
case MENU_ENUM_LABEL_CHEAT_NUM_PASSES:
|
|
|
|
BIND_ACTION_LEFT(cbs, action_left_cheat_num_passes);
|
|
|
|
break;
|
2017-12-11 23:55:31 -08:00
|
|
|
case MENU_ENUM_LABEL_SCREEN_RESOLUTION:
|
2016-06-16 20:14:15 +02:00
|
|
|
BIND_ACTION_LEFT(cbs, action_left_video_resolution);
|
|
|
|
break;
|
2017-01-07 17:51:17 +01:00
|
|
|
case MENU_ENUM_LABEL_OPEN_ARCHIVE_DETECT_CORE:
|
|
|
|
case MENU_ENUM_LABEL_LOAD_ARCHIVE_DETECT_CORE:
|
|
|
|
BIND_ACTION_LEFT(cbs, action_left_scroll);
|
|
|
|
break;
|
2016-06-17 20:43:42 +02:00
|
|
|
case MENU_ENUM_LABEL_NO_ITEMS:
|
2016-06-16 20:14:15 +02:00
|
|
|
case MENU_ENUM_LABEL_NO_PLAYLIST_ENTRIES_AVAILABLE:
|
2017-12-11 23:55:31 -08:00
|
|
|
if (
|
2017-01-08 03:30:20 +01:00
|
|
|
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_HISTORY_TAB)) ||
|
2017-08-12 17:10:14 +02:00
|
|
|
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_FAVORITES_TAB)) ||
|
2017-01-08 03:30:20 +01:00
|
|
|
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_MAIN_MENU)) ||
|
2016-06-20 00:31:13 +02:00
|
|
|
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_PLAYLISTS_TAB)) ||
|
2017-01-08 03:13:34 +01:00
|
|
|
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)) ||
|
2016-06-20 00:31:13 +02:00
|
|
|
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_HORIZONTAL_MENU))
|
2016-06-17 20:43:42 +02:00
|
|
|
)
|
2016-06-16 20:14:15 +02:00
|
|
|
{
|
2016-06-17 20:43:42 +02:00
|
|
|
BIND_ACTION_LEFT(cbs, action_left_mainmenu);
|
2016-06-16 20:14:15 +02:00
|
|
|
}
|
2017-01-07 17:44:27 +01:00
|
|
|
else
|
2017-01-09 19:49:46 +01:00
|
|
|
{
|
2017-01-07 17:44:27 +01:00
|
|
|
BIND_ACTION_LEFT(cbs, action_left_scroll);
|
2017-01-09 19:49:46 +01:00
|
|
|
}
|
2017-01-07 17:44:27 +01:00
|
|
|
break;
|
2016-07-30 19:43:33 +02:00
|
|
|
case MENU_ENUM_LABEL_START_VIDEO_PROCESSOR:
|
2016-07-30 19:47:39 +02:00
|
|
|
case MENU_ENUM_LABEL_TAKE_SCREENSHOT:
|
2017-12-11 23:55:31 -08:00
|
|
|
if (
|
2017-01-08 03:30:20 +01:00
|
|
|
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_HISTORY_TAB)) ||
|
2017-08-12 17:10:14 +02:00
|
|
|
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_FAVORITES_TAB)) ||
|
2016-07-30 19:43:33 +02:00
|
|
|
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)) ||
|
2017-01-18 22:46:48 -05:00
|
|
|
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_NETPLAY_TAB)) ||
|
2016-07-30 19:43:33 +02:00
|
|
|
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)) ||
|
|
|
|
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_HORIZONTAL_MENU)) ||
|
|
|
|
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_SETTINGS_TAB))
|
|
|
|
)
|
|
|
|
{
|
|
|
|
BIND_ACTION_LEFT(cbs, action_left_mainmenu);
|
|
|
|
break;
|
|
|
|
}
|
2016-06-16 20:14:15 +02:00
|
|
|
default:
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2016-07-10 13:51:40 +02:00
|
|
|
else
|
|
|
|
{
|
|
|
|
return -1;
|
|
|
|
}
|
2015-05-18 15:56:32 +02:00
|
|
|
}
|
|
|
|
|
2015-06-07 18:05:26 +02:00
|
|
|
return 0;
|
|
|
|
}
|
2015-05-18 15:56:32 +02:00
|
|
|
|
2015-06-12 16:01:46 +02:00
|
|
|
static int menu_cbs_init_bind_left_compare_type(menu_file_list_cbs_t *cbs,
|
2016-07-02 07:05:43 +02:00
|
|
|
unsigned type, const char *menu_label)
|
2015-06-07 18:05:26 +02:00
|
|
|
{
|
2015-09-07 22:30:20 +02:00
|
|
|
if (type >= MENU_SETTINGS_CHEAT_BEGIN
|
|
|
|
&& type <= MENU_SETTINGS_CHEAT_END)
|
2015-10-11 20:26:44 +02:00
|
|
|
{
|
|
|
|
BIND_ACTION_LEFT(cbs, action_left_cheat);
|
|
|
|
}
|
2018-04-30 17:51:01 +02:00
|
|
|
else if (type >= MENU_SETTINGS_AUDIO_MIXER_STREAM_ACTIONS_VOLUME_BEGIN
|
|
|
|
&& type <= MENU_SETTINGS_AUDIO_MIXER_STREAM_ACTIONS_VOLUME_END)
|
|
|
|
{
|
|
|
|
BIND_ACTION_LEFT(cbs, audio_mixer_stream_volume_left);
|
|
|
|
}
|
2015-09-07 22:30:20 +02:00
|
|
|
else if (type >= MENU_SETTINGS_SHADER_PARAMETER_0
|
2015-05-18 15:56:32 +02:00
|
|
|
&& type <= MENU_SETTINGS_SHADER_PARAMETER_LAST)
|
2015-10-11 20:26:44 +02:00
|
|
|
{
|
|
|
|
BIND_ACTION_LEFT(cbs, shader_action_parameter_left);
|
|
|
|
}
|
2015-05-18 15:56:32 +02:00
|
|
|
else if (type >= MENU_SETTINGS_SHADER_PRESET_PARAMETER_0
|
|
|
|
&& type <= MENU_SETTINGS_SHADER_PRESET_PARAMETER_LAST)
|
2015-10-11 20:26:44 +02:00
|
|
|
{
|
2018-02-08 22:24:18 -05:00
|
|
|
BIND_ACTION_LEFT(cbs, shader_action_parameter_left);
|
2015-10-11 20:26:44 +02:00
|
|
|
}
|
2015-05-18 15:56:32 +02:00
|
|
|
else if (type >= MENU_SETTINGS_INPUT_DESC_BEGIN
|
|
|
|
&& type <= MENU_SETTINGS_INPUT_DESC_END)
|
2015-10-11 20:26:44 +02:00
|
|
|
{
|
|
|
|
BIND_ACTION_LEFT(cbs, action_left_input_desc);
|
|
|
|
}
|
2017-09-10 11:30:10 -05:00
|
|
|
else if (type >= MENU_SETTINGS_INPUT_DESC_KBD_BEGIN
|
|
|
|
&& type <= MENU_SETTINGS_INPUT_DESC_KBD_END)
|
|
|
|
{
|
|
|
|
BIND_ACTION_LEFT(cbs, action_left_input_desc_kbd);
|
|
|
|
}
|
2015-10-26 07:16:37 +01:00
|
|
|
else if ((type >= MENU_SETTINGS_PLAYLIST_ASSOCIATION_START))
|
|
|
|
{
|
|
|
|
BIND_ACTION_LEFT(cbs, playlist_association_left);
|
|
|
|
}
|
2015-06-05 12:24:00 +02:00
|
|
|
else if ((type >= MENU_SETTINGS_CORE_OPTION_START))
|
2015-10-11 20:26:44 +02:00
|
|
|
{
|
|
|
|
BIND_ACTION_LEFT(cbs, core_setting_left);
|
|
|
|
}
|
2015-06-05 12:25:27 +02:00
|
|
|
else
|
|
|
|
{
|
2015-06-07 18:05:26 +02:00
|
|
|
switch (type)
|
2015-06-05 12:25:27 +02:00
|
|
|
{
|
2015-06-07 18:05:26 +02:00
|
|
|
case MENU_SETTINGS_CORE_DISK_OPTIONS_DISK_INDEX:
|
2015-10-11 20:26:44 +02:00
|
|
|
BIND_ACTION_LEFT(cbs, disk_options_disk_idx_left);
|
2015-06-05 12:25:27 +02:00
|
|
|
break;
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_PLAIN:
|
|
|
|
case FILE_TYPE_DIRECTORY:
|
|
|
|
case FILE_TYPE_CARCHIVE:
|
|
|
|
case FILE_TYPE_IN_CARCHIVE:
|
|
|
|
case FILE_TYPE_CORE:
|
|
|
|
case FILE_TYPE_RDB:
|
|
|
|
case FILE_TYPE_RDB_ENTRY:
|
|
|
|
case FILE_TYPE_RPL_ENTRY:
|
|
|
|
case FILE_TYPE_CURSOR:
|
|
|
|
case FILE_TYPE_SHADER:
|
|
|
|
case FILE_TYPE_SHADER_PRESET:
|
|
|
|
case FILE_TYPE_IMAGE:
|
|
|
|
case FILE_TYPE_OVERLAY:
|
2019-03-31 00:17:08 +00:00
|
|
|
#ifdef HAVE_VIDEO_LAYOUT
|
|
|
|
case FILE_TYPE_VIDEO_LAYOUT:
|
|
|
|
#endif
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_VIDEOFILTER:
|
|
|
|
case FILE_TYPE_AUDIOFILTER:
|
|
|
|
case FILE_TYPE_CONFIG:
|
|
|
|
case FILE_TYPE_USE_DIRECTORY:
|
|
|
|
case FILE_TYPE_PLAYLIST_ENTRY:
|
2015-10-23 03:43:25 +07:00
|
|
|
case MENU_INFO_MESSAGE:
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_DOWNLOAD_CORE:
|
|
|
|
case FILE_TYPE_CHEAT:
|
|
|
|
case FILE_TYPE_REMAP:
|
|
|
|
case FILE_TYPE_MOVIE:
|
|
|
|
case FILE_TYPE_MUSIC:
|
|
|
|
case FILE_TYPE_IMAGEVIEWER:
|
|
|
|
case FILE_TYPE_PLAYLIST_COLLECTION:
|
|
|
|
case FILE_TYPE_DOWNLOAD_CORE_CONTENT:
|
|
|
|
case FILE_TYPE_DOWNLOAD_THUMBNAIL_CONTENT:
|
2016-06-27 21:29:38 +02:00
|
|
|
case FILE_TYPE_DOWNLOAD_URL:
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_SCAN_DIRECTORY:
|
2017-05-26 16:20:57 +02:00
|
|
|
case FILE_TYPE_FONT:
|
2015-06-07 18:05:26 +02:00
|
|
|
case MENU_SETTING_GROUP:
|
2016-06-28 11:34:17 +02:00
|
|
|
case MENU_SETTINGS_CORE_INFO_NONE:
|
2016-06-20 00:31:13 +02:00
|
|
|
if ( string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_HISTORY_TAB)) ||
|
2017-08-12 17:10:14 +02:00
|
|
|
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_FAVORITES_TAB)) ||
|
2016-06-20 00:31:13 +02:00
|
|
|
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)) ||
|
2017-01-18 22:46:48 -05:00
|
|
|
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_NETPLAY_TAB)) ||
|
2016-07-30 19:12:56 +02:00
|
|
|
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)) ||
|
2016-06-20 00:31:13 +02:00
|
|
|
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_HORIZONTAL_MENU)) ||
|
|
|
|
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_SETTINGS_TAB))
|
2016-06-17 20:07:00 +02:00
|
|
|
)
|
2016-06-17 19:57:48 +02:00
|
|
|
{
|
|
|
|
BIND_ACTION_LEFT(cbs, action_left_mainmenu);
|
|
|
|
break;
|
|
|
|
}
|
2016-06-17 20:18:46 +02:00
|
|
|
BIND_ACTION_LEFT(cbs, action_left_scroll);
|
2015-06-05 12:25:27 +02:00
|
|
|
break;
|
2015-06-07 18:05:26 +02:00
|
|
|
case MENU_SETTING_ACTION:
|
2016-06-20 15:50:37 +02:00
|
|
|
case FILE_TYPE_CONTENTLIST_ENTRY:
|
2015-10-11 20:26:44 +02:00
|
|
|
BIND_ACTION_LEFT(cbs, action_left_mainmenu);
|
2015-06-05 12:25:27 +02:00
|
|
|
break;
|
2015-06-07 18:05:26 +02:00
|
|
|
default:
|
|
|
|
return -1;
|
2015-06-05 12:25:27 +02:00
|
|
|
}
|
|
|
|
}
|
2015-05-18 15:56:32 +02:00
|
|
|
|
2015-06-07 18:05:26 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-06-12 16:01:46 +02:00
|
|
|
int menu_cbs_init_bind_left(menu_file_list_cbs_t *cbs,
|
2015-06-07 18:05:26 +02:00
|
|
|
const char *path, const char *label, unsigned type, size_t idx,
|
2018-02-09 01:09:17 +01:00
|
|
|
const char *menu_label,
|
|
|
|
uint32_t label_hash)
|
2015-06-07 18:05:26 +02:00
|
|
|
{
|
|
|
|
if (!cbs)
|
2015-06-07 18:36:10 +02:00
|
|
|
return -1;
|
2015-06-07 18:05:26 +02:00
|
|
|
|
2015-10-11 20:26:44 +02:00
|
|
|
BIND_ACTION_LEFT(cbs, bind_left_generic);
|
2015-06-07 18:05:26 +02:00
|
|
|
|
2015-10-29 15:00:29 +01:00
|
|
|
if (type == MENU_SETTING_NO_ITEM)
|
|
|
|
{
|
2016-06-20 00:31:13 +02:00
|
|
|
if ( string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_HISTORY_TAB)) ||
|
2017-08-12 17:10:14 +02:00
|
|
|
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_FAVORITES_TAB)) ||
|
2016-06-20 00:31:13 +02:00
|
|
|
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)) ||
|
2017-01-18 22:46:48 -05:00
|
|
|
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_NETPLAY_TAB)) ||
|
2016-06-20 00:31:13 +02:00
|
|
|
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_MAIN_MENU)) ||
|
2016-07-30 19:12:56 +02:00
|
|
|
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)) ||
|
2016-06-20 00:31:13 +02:00
|
|
|
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_HORIZONTAL_MENU)) ||
|
|
|
|
string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_SETTINGS_TAB))
|
2016-06-17 20:50:36 +02:00
|
|
|
)
|
2015-10-29 15:00:29 +01:00
|
|
|
{
|
|
|
|
BIND_ACTION_LEFT(cbs, action_left_mainmenu);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-09 01:09:17 +01:00
|
|
|
if (menu_cbs_init_bind_left_compare_label(cbs, label, label_hash, menu_label) == 0)
|
2015-06-07 18:36:10 +02:00
|
|
|
return 0;
|
|
|
|
|
2016-07-02 07:05:43 +02:00
|
|
|
if (menu_cbs_init_bind_left_compare_type(cbs, type, menu_label) == 0)
|
2015-06-07 18:36:10 +02:00
|
|
|
return 0;
|
2015-06-07 18:05:26 +02:00
|
|
|
|
2015-06-07 18:36:10 +02:00
|
|
|
return -1;
|
2015-05-18 15:56:32 +02:00
|
|
|
}
|