(Menu) Add 'Pause if window focus lost' to General Options

This commit is contained in:
twinaphex 2014-02-25 18:23:20 +01:00
parent 7064845e0e
commit 180717faab
3 changed files with 8 additions and 0 deletions

View File

@ -1894,6 +1894,7 @@ void menu_populate_entries(void *data, unsigned menu_type)
#if defined(HAVE_THREADS)
file_list_push(rgui->selection_buf, "SRAM Autosave", RGUI_SETTINGS_SRAM_AUTOSAVE, 0);
#endif
file_list_push(rgui->selection_buf, "Pause if window focus lost", RGUI_SETTINGS_PAUSE_IF_WINDOW_FOCUS_LOST, 0);
file_list_push(rgui->selection_buf, "Savestate Autosave On Exit", RGUI_SETTINGS_SAVESTATE_AUTO_SAVE, 0);
file_list_push(rgui->selection_buf, "Savestate Autoload", RGUI_SETTINGS_SAVESTATE_AUTO_LOAD, 0);
break;

View File

@ -135,6 +135,7 @@ typedef enum
RGUI_SETTINGS_SAVESTATE_AUTO_SAVE,
RGUI_SETTINGS_SAVESTATE_AUTO_LOAD,
RGUI_SETTINGS_BLOCK_SRAM_OVERWRITE,
RGUI_SETTINGS_PAUSE_IF_WINDOW_FOCUS_LOST,
RGUI_SCREENSHOT_DIR_PATH,
RGUI_BROWSER_DIR_PATH,
RGUI_SHADER_DIR_PATH,

View File

@ -1660,6 +1660,9 @@ int menu_set_settings(void *data, unsigned setting, unsigned action)
break;
}
break;
case RGUI_SETTINGS_PAUSE_IF_WINDOW_FOCUS_LOST:
g_settings.pause_nonactive = !g_settings.pause_nonactive;
break;
default:
break;
}
@ -2027,6 +2030,9 @@ void menu_set_settings_label(char *type_str, size_t type_str_size, unsigned *w,
case RGUI_SETTINGS_CUSTOM_BGM_CONTROL_ENABLE:
strlcpy(type_str, (g_extern.lifecycle_state & (1ULL << MODE_AUDIO_CUSTOM_BGM_ENABLE)) ? "ON" : "OFF", type_str_size);
break;
case RGUI_SETTINGS_PAUSE_IF_WINDOW_FOCUS_LOST:
strlcpy(type_str, g_settings.pause_nonactive ? "ON" : "OFF", type_str_size);
break;
default:
*type_str = '\0';
*w = 0;