FullscreenUI: Remove Pause on Menu open

And always pause. The option never really worked correctly.
This commit is contained in:
Stenzek 2023-11-06 21:48:09 +10:00
parent 0d5ffda3d3
commit 3ab27e7220
No known key found for this signature in database
4 changed files with 8 additions and 9 deletions

View file

@ -679,7 +679,7 @@ void FullscreenUI::ToggleTheme()
void FullscreenUI::PauseForMenuOpen(bool set_pause_menu_open)
{
s_was_paused_on_quick_menu_open = (System::GetState() == System::State::Paused);
if (g_settings.pause_on_menu && !s_was_paused_on_quick_menu_open)
if (!s_was_paused_on_quick_menu_open)
Host::RunOnCPUThread([]() { System::PauseSystem(true); });
s_pause_menu_was_open |= set_pause_menu_open;
@ -2722,9 +2722,6 @@ void FullscreenUI::DrawInterfaceSettingsPage()
FSUI_CSTR("Pauses the emulator when you minimize the window or switch to another "
"application, and unpauses when you switch back."),
"Main", "PauseOnFocusLoss", false);
DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_FA_WINDOW_MAXIMIZE, "Pause On Menu"),
FSUI_CSTR("Pauses the emulator when you open the quick menu, and unpauses when you close it."),
"Main", "PauseOnMenu", true);
DrawToggleSetting(
bsi, FSUI_ICONSTR(ICON_FA_POWER_OFF, "Confirm Power Off"),
FSUI_CSTR("Determines whether a prompt will be displayed to confirm shutting down the emulator/game "
@ -7084,11 +7081,9 @@ TRANSLATE_NOOP("FullscreenUI", "Patches");
TRANSLATE_NOOP("FullscreenUI", "Patches the BIOS to skip the boot animation. Safe to enable.");
TRANSLATE_NOOP("FullscreenUI", "Path");
TRANSLATE_NOOP("FullscreenUI", "Pause On Focus Loss");
TRANSLATE_NOOP("FullscreenUI", "Pause On Menu");
TRANSLATE_NOOP("FullscreenUI", "Pause On Start");
TRANSLATE_NOOP("FullscreenUI", "Pauses the emulator when a game is started.");
TRANSLATE_NOOP("FullscreenUI", "Pauses the emulator when you minimize the window or switch to another application, and unpauses when you switch back.");
TRANSLATE_NOOP("FullscreenUI", "Pauses the emulator when you open the quick menu, and unpauses when you close it.");
TRANSLATE_NOOP("FullscreenUI", "Per-Game Configuration");
TRANSLATE_NOOP("FullscreenUI", "Per-game controller configuration initialized with global settings.");
TRANSLATE_NOOP("FullscreenUI", "Performance enhancement - jumps directly between blocks instead of returning to the dispatcher.");

View file

@ -144,7 +144,6 @@ void Settings::Load(SettingsInterface& si)
start_paused = si.GetBoolValue("Main", "StartPaused", false);
start_fullscreen = si.GetBoolValue("Main", "StartFullscreen", false);
pause_on_focus_loss = si.GetBoolValue("Main", "PauseOnFocusLoss", false);
pause_on_menu = si.GetBoolValue("Main", "PauseOnMenu", true);
save_state_on_exit = si.GetBoolValue("Main", "SaveStateOnExit", true);
create_save_state_backups = si.GetBoolValue("Main", "CreateSaveStateBackups", DEFAULT_SAVE_STATE_BACKUPS);
compress_save_states = si.GetBoolValue("Main", "CompressSaveStates", DEFAULT_SAVE_STATE_COMPRESSION);
@ -408,7 +407,6 @@ void Settings::Save(SettingsInterface& si) const
si.SetBoolValue("Main", "StartPaused", start_paused);
si.SetBoolValue("Main", "StartFullscreen", start_fullscreen);
si.SetBoolValue("Main", "PauseOnFocusLoss", pause_on_focus_loss);
si.SetBoolValue("Main", "PauseOnMenu", pause_on_menu);
si.SetBoolValue("Main", "SaveStateOnExit", save_state_on_exit);
si.SetBoolValue("Main", "CreateSaveStateBackups", create_save_state_backups);
si.SetBoolValue("Main", "CompressSaveStates", compress_save_states);

View file

@ -75,7 +75,6 @@ struct Settings
bool start_paused = false;
bool start_fullscreen = false;
bool pause_on_focus_loss = false;
bool pause_on_menu = true;
bool save_state_on_exit = true;
bool create_save_state_backups = DEFAULT_SAVE_STATE_BACKUPS;
bool compress_save_states = DEFAULT_SAVE_STATE_COMPRESSION;

View file

@ -113,6 +113,7 @@ static void GenerateRelativeMouseEvents();
static bool DoEventHook(InputBindingKey key, float value);
static bool PreprocessEvent(InputBindingKey key, float value, GenericInputBinding generic_key);
static bool ProcessEvent(InputBindingKey key, float value, bool skip_button_handlers);
static void LoadMacroButtonConfig(SettingsInterface& si, const std::string& section, u32 pad,
const Controller::ControllerInfo* cinfo);
@ -844,7 +845,11 @@ bool InputManager::InvokeEvents(InputBindingKey key, float value, GenericInputBi
// If imgui ate the event, don't fire our handlers.
const bool skip_button_handlers = PreprocessEvent(key, value, generic_key);
return ProcessEvent(key, value, skip_button_handlers);
}
bool InputManager::ProcessEvent(InputBindingKey key, float value, bool skip_button_handlers)
{
// find all the bindings associated with this key
const InputBindingKey masked_key = key.MaskDirection();
const auto range = s_binding_map.equal_range(masked_key);
@ -856,6 +861,7 @@ bool InputManager::InvokeEvents(InputBindingKey key, float value, GenericInputBi
for (auto it = range.first; it != range.second; ++it)
{
InputBinding* binding = it->second.get();
// find the key which matches us
for (u32 i = 0; i < binding->num_keys; i++)
{
@ -865,6 +871,7 @@ bool InputManager::InvokeEvents(InputBindingKey key, float value, GenericInputBi
const u8 bit = static_cast<u8>(1) << i;
const bool negative = binding->keys[i].modifier == InputModifier::Negate;
const bool new_state = (negative ? (value < 0.0f) : (value > 0.0f));
float value_to_pass = 0.0f;
switch (binding->keys[i].modifier)
{