mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 03:32:46 +00:00
(Menu) Add Font Options
This commit is contained in:
parent
6c6239a5b7
commit
802bbcb321
@ -972,6 +972,7 @@ static int menu_settings_iterate(void *data, unsigned action)
|
||||
|| menu_type == RGUI_SETTINGS_PRIVACY_OPTIONS
|
||||
|| menu_type == RGUI_SETTINGS_GENERAL_OPTIONS
|
||||
|| menu_type == RGUI_SETTINGS_VIDEO_OPTIONS
|
||||
|| menu_type == RGUI_SETTINGS_FONT_OPTIONS
|
||||
|| menu_type == RGUI_SETTINGS_SHADER_OPTIONS
|
||||
)
|
||||
menu_populate_entries(rgui, menu_type);
|
||||
@ -1904,6 +1905,12 @@ void menu_populate_entries(void *data, unsigned menu_type)
|
||||
file_list_push(rgui->selection_buf, "Monitor Index", RGUI_SETTINGS_VIDEO_MONITOR_INDEX, 0);
|
||||
file_list_push(rgui->selection_buf, "Estimated Monitor FPS", RGUI_SETTINGS_VIDEO_REFRESH_RATE_AUTO, 0);
|
||||
break;
|
||||
case RGUI_SETTINGS_FONT_OPTIONS:
|
||||
file_list_clear(rgui->selection_buf);
|
||||
file_list_push(rgui->selection_buf, "OSD Font Enable", RGUI_SETTINGS_FONT_ENABLE, 0);
|
||||
file_list_push(rgui->selection_buf, "OSD Font Scale to Window", RGUI_SETTINGS_FONT_SCALE, 0);
|
||||
file_list_push(rgui->selection_buf, "OSD Font Size", RGUI_SETTINGS_FONT_SIZE, 0);
|
||||
break;
|
||||
case RGUI_SETTINGS_CORE_OPTIONS:
|
||||
file_list_clear(rgui->selection_buf);
|
||||
|
||||
@ -1992,6 +1999,7 @@ void menu_populate_entries(void *data, unsigned menu_type)
|
||||
#ifdef HAVE_SHADER_MANAGER
|
||||
file_list_push(rgui->selection_buf, "Shader Options", RGUI_SETTINGS_SHADER_OPTIONS, 0);
|
||||
#endif
|
||||
file_list_push(rgui->selection_buf, "Font Options", RGUI_SETTINGS_FONT_OPTIONS, 0);
|
||||
file_list_push(rgui->selection_buf, "Audio Options", RGUI_SETTINGS_AUDIO_OPTIONS, 0);
|
||||
file_list_push(rgui->selection_buf, "Input Options", RGUI_SETTINGS_INPUT_OPTIONS, 0);
|
||||
#ifdef HAVE_OVERLAY
|
||||
|
@ -89,6 +89,10 @@ typedef enum
|
||||
RGUI_SETTINGS_VIDEO_REFRESH_RATE_AUTO,
|
||||
RGUI_SETTINGS_VIDEO_MONITOR_INDEX,
|
||||
RGUI_SETTINGS_VIDEO_OPTIONS_LAST,
|
||||
RGUI_SETTINGS_FONT_OPTIONS,
|
||||
RGUI_SETTINGS_FONT_ENABLE,
|
||||
RGUI_SETTINGS_FONT_SCALE,
|
||||
RGUI_SETTINGS_FONT_SIZE,
|
||||
RGUI_SETTINGS_SHADER_OPTIONS,
|
||||
RGUI_SETTINGS_SHADER_FILTER,
|
||||
RGUI_SETTINGS_SHADER_PRESET,
|
||||
|
@ -95,6 +95,7 @@ unsigned menu_type_is(unsigned type)
|
||||
type == RGUI_SETTINGS_CORE_OPTIONS ||
|
||||
type == RGUI_SETTINGS_CORE_INFO ||
|
||||
type == RGUI_SETTINGS_VIDEO_OPTIONS ||
|
||||
type == RGUI_SETTINGS_FONT_OPTIONS ||
|
||||
type == RGUI_SETTINGS_SHADER_OPTIONS ||
|
||||
type == RGUI_SETTINGS_AUDIO_OPTIONS ||
|
||||
type == RGUI_SETTINGS_DISK_OPTIONS ||
|
||||
@ -1876,6 +1877,29 @@ int menu_set_settings(void *data, unsigned setting, unsigned action)
|
||||
g_settings.location.allow = false;
|
||||
break;
|
||||
#endif
|
||||
case RGUI_SETTINGS_FONT_ENABLE:
|
||||
if (action == RGUI_ACTION_OK || action == RGUI_ACTION_LEFT || action == RGUI_ACTION_RIGHT)
|
||||
g_settings.video.font_enable = !g_settings.video.font_enable;
|
||||
else if (action == RGUI_ACTION_START)
|
||||
g_settings.video.font_enable = true;
|
||||
break;
|
||||
case RGUI_SETTINGS_FONT_SCALE:
|
||||
if (action == RGUI_ACTION_OK || action == RGUI_ACTION_LEFT || action == RGUI_ACTION_RIGHT)
|
||||
g_settings.video.font_scale = !g_settings.video.font_scale;
|
||||
else if (action == RGUI_ACTION_START)
|
||||
g_settings.video.font_scale = true;
|
||||
break;
|
||||
case RGUI_SETTINGS_FONT_SIZE:
|
||||
if (action == RGUI_ACTION_LEFT)
|
||||
{
|
||||
if (g_settings.video.font_size >= 0)
|
||||
g_settings.video.font_size--;
|
||||
}
|
||||
else if (action == RGUI_ACTION_RIGHT)
|
||||
g_settings.video.font_size++;
|
||||
else if (action == RGUI_ACTION_START)
|
||||
g_settings.video.font_size = 0;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -2118,6 +2142,7 @@ void menu_set_settings_label(char *type_str, size_t type_str_size, unsigned *w,
|
||||
case RGUI_SETTINGS_CUSTOM_VIEWPORT:
|
||||
case RGUI_SETTINGS_TOGGLE_FULLSCREEN:
|
||||
case RGUI_SETTINGS_VIDEO_OPTIONS:
|
||||
case RGUI_SETTINGS_FONT_OPTIONS:
|
||||
case RGUI_SETTINGS_AUDIO_OPTIONS:
|
||||
case RGUI_SETTINGS_DISK_OPTIONS:
|
||||
#ifdef HAVE_SHADER_MANAGER
|
||||
@ -2324,6 +2349,15 @@ void menu_set_settings_label(char *type_str, size_t type_str_size, unsigned *w,
|
||||
snprintf(type_str, type_str_size, g_settings.osk.enable ? "ON" : "OFF");
|
||||
break;
|
||||
#endif
|
||||
case RGUI_SETTINGS_FONT_ENABLE:
|
||||
snprintf(type_str, type_str_size, g_settings.video.font_enable ? "ON" : "OFF");
|
||||
break;
|
||||
case RGUI_SETTINGS_FONT_SCALE:
|
||||
snprintf(type_str, type_str_size, g_settings.video.font_scale ? "ON" : "OFF");
|
||||
break;
|
||||
case RGUI_SETTINGS_FONT_SIZE:
|
||||
snprintf(type_str, type_str_size, "%.1f", g_settings.video.font_size);
|
||||
break;
|
||||
default:
|
||||
*type_str = '\0';
|
||||
*w = 0;
|
||||
|
@ -1298,6 +1298,10 @@ bool config_save_file(const char *path)
|
||||
config_set_bool(conf, "location_allow", g_settings.location.allow);
|
||||
#endif
|
||||
|
||||
config_set_bool(conf, "video_font_scale", g_settings.video.font_scale);
|
||||
config_set_float(conf, "video_font_size", g_settings.video.font_size);
|
||||
config_set_bool(conf, "video_font_enable", g_settings.video.font_enable);
|
||||
|
||||
config_set_path(conf, "system_directory", *g_settings.system_directory ? g_settings.system_directory : "default");
|
||||
config_set_path(conf, "extraction_directory", g_settings.extraction_directory);
|
||||
config_set_string(conf, "audio_resampler", g_settings.audio.resampler);
|
||||
|
Loading…
x
Reference in New Issue
Block a user