(Menu) Add Font Options

This commit is contained in:
twinaphex 2014-04-07 22:12:23 +02:00
parent 6c6239a5b7
commit 802bbcb321
4 changed files with 50 additions and 0 deletions

View File

@ -972,6 +972,7 @@ static int menu_settings_iterate(void *data, unsigned action)
|| menu_type == RGUI_SETTINGS_PRIVACY_OPTIONS || menu_type == RGUI_SETTINGS_PRIVACY_OPTIONS
|| menu_type == RGUI_SETTINGS_GENERAL_OPTIONS || menu_type == RGUI_SETTINGS_GENERAL_OPTIONS
|| menu_type == RGUI_SETTINGS_VIDEO_OPTIONS || menu_type == RGUI_SETTINGS_VIDEO_OPTIONS
|| menu_type == RGUI_SETTINGS_FONT_OPTIONS
|| menu_type == RGUI_SETTINGS_SHADER_OPTIONS || menu_type == RGUI_SETTINGS_SHADER_OPTIONS
) )
menu_populate_entries(rgui, menu_type); 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, "Monitor Index", RGUI_SETTINGS_VIDEO_MONITOR_INDEX, 0);
file_list_push(rgui->selection_buf, "Estimated Monitor FPS", RGUI_SETTINGS_VIDEO_REFRESH_RATE_AUTO, 0); file_list_push(rgui->selection_buf, "Estimated Monitor FPS", RGUI_SETTINGS_VIDEO_REFRESH_RATE_AUTO, 0);
break; 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: case RGUI_SETTINGS_CORE_OPTIONS:
file_list_clear(rgui->selection_buf); file_list_clear(rgui->selection_buf);
@ -1992,6 +1999,7 @@ void menu_populate_entries(void *data, unsigned menu_type)
#ifdef HAVE_SHADER_MANAGER #ifdef HAVE_SHADER_MANAGER
file_list_push(rgui->selection_buf, "Shader Options", RGUI_SETTINGS_SHADER_OPTIONS, 0); file_list_push(rgui->selection_buf, "Shader Options", RGUI_SETTINGS_SHADER_OPTIONS, 0);
#endif #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, "Audio Options", RGUI_SETTINGS_AUDIO_OPTIONS, 0);
file_list_push(rgui->selection_buf, "Input Options", RGUI_SETTINGS_INPUT_OPTIONS, 0); file_list_push(rgui->selection_buf, "Input Options", RGUI_SETTINGS_INPUT_OPTIONS, 0);
#ifdef HAVE_OVERLAY #ifdef HAVE_OVERLAY

View File

@ -89,6 +89,10 @@ typedef enum
RGUI_SETTINGS_VIDEO_REFRESH_RATE_AUTO, RGUI_SETTINGS_VIDEO_REFRESH_RATE_AUTO,
RGUI_SETTINGS_VIDEO_MONITOR_INDEX, RGUI_SETTINGS_VIDEO_MONITOR_INDEX,
RGUI_SETTINGS_VIDEO_OPTIONS_LAST, 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_OPTIONS,
RGUI_SETTINGS_SHADER_FILTER, RGUI_SETTINGS_SHADER_FILTER,
RGUI_SETTINGS_SHADER_PRESET, RGUI_SETTINGS_SHADER_PRESET,

View File

@ -95,6 +95,7 @@ unsigned menu_type_is(unsigned type)
type == RGUI_SETTINGS_CORE_OPTIONS || type == RGUI_SETTINGS_CORE_OPTIONS ||
type == RGUI_SETTINGS_CORE_INFO || type == RGUI_SETTINGS_CORE_INFO ||
type == RGUI_SETTINGS_VIDEO_OPTIONS || type == RGUI_SETTINGS_VIDEO_OPTIONS ||
type == RGUI_SETTINGS_FONT_OPTIONS ||
type == RGUI_SETTINGS_SHADER_OPTIONS || type == RGUI_SETTINGS_SHADER_OPTIONS ||
type == RGUI_SETTINGS_AUDIO_OPTIONS || type == RGUI_SETTINGS_AUDIO_OPTIONS ||
type == RGUI_SETTINGS_DISK_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; g_settings.location.allow = false;
break; break;
#endif #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: default:
break; 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_CUSTOM_VIEWPORT:
case RGUI_SETTINGS_TOGGLE_FULLSCREEN: case RGUI_SETTINGS_TOGGLE_FULLSCREEN:
case RGUI_SETTINGS_VIDEO_OPTIONS: case RGUI_SETTINGS_VIDEO_OPTIONS:
case RGUI_SETTINGS_FONT_OPTIONS:
case RGUI_SETTINGS_AUDIO_OPTIONS: case RGUI_SETTINGS_AUDIO_OPTIONS:
case RGUI_SETTINGS_DISK_OPTIONS: case RGUI_SETTINGS_DISK_OPTIONS:
#ifdef HAVE_SHADER_MANAGER #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"); snprintf(type_str, type_str_size, g_settings.osk.enable ? "ON" : "OFF");
break; break;
#endif #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: default:
*type_str = '\0'; *type_str = '\0';
*w = 0; *w = 0;

View File

@ -1298,6 +1298,10 @@ bool config_save_file(const char *path)
config_set_bool(conf, "location_allow", g_settings.location.allow); config_set_bool(conf, "location_allow", g_settings.location.allow);
#endif #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, "system_directory", *g_settings.system_directory ? g_settings.system_directory : "default");
config_set_path(conf, "extraction_directory", g_settings.extraction_directory); config_set_path(conf, "extraction_directory", g_settings.extraction_directory);
config_set_string(conf, "audio_resampler", g_settings.audio.resampler); config_set_string(conf, "audio_resampler", g_settings.audio.resampler);