diff --git a/source-code/data/plugins/keyconfig.ini b/source-code/data/plugins/keyconfig.ini index 70a9be1..018431d 100644 --- a/source-code/data/plugins/keyconfig.ini +++ b/source-code/data/plugins/keyconfig.ini @@ -21,6 +21,9 @@ xinput_preferred =0 # Rumble (Xinput) rumble =true +# Pause when focus is lost +autopause =true + # JVS Buttons: JVS_TEST = F1 JVS_SERVICE = F2 diff --git a/source-code/source/plugins/Launcher/framework.h b/source-code/source/plugins/Launcher/framework.h index efc12e2..6d5dc2b 100644 --- a/source-code/source/plugins/Launcher/framework.h +++ b/source-code/source/plugins/Launcher/framework.h @@ -191,6 +191,9 @@ ConfigOptionBase* optionsArray[] = { new NumericOption(L"frm.motion.rate", GRAPHICS_SECTION, CONFIG_FILE, L"FRM Motion Rate:", L"Sets the motion rate (fps) for the Frame Rate Manager component.\nLarger values should be smoother, but more CPU intensive and possibly buggier.", 300, 1, INT_MAX), new OptionMetaSpacer(8), + new BooleanOption(L"autopause", KEYCONFIG_SECTION, KEYCONFIG_FILE, L"Pause automatically", L"Pause when focus is lost.", true, true), + new OptionMetaSpacer(8), + new BooleanOption(L"rumble", KEYCONFIG_SECTION, KEYCONFIG_FILE, L"XInput Rumble", L"Enables rumble during chainslides.", true, true), new NumericOption(L"xinput_preferred", KEYCONFIG_SECTION, KEYCONFIG_FILE, L"XInput Controller Num:", L"Sets the preferred XInput controller.\nIf unavailable, the next connected controller is used.", 0, 0, 3), new OptionMetaSpacer(8), diff --git a/source-code/source/plugins/TLAC/Components/Pause.cpp b/source-code/source/plugins/TLAC/Components/Pause.cpp index c897548..6b6fef9 100644 --- a/source-code/source/plugins/TLAC/Components/Pause.cpp +++ b/source-code/source/plugins/TLAC/Components/Pause.cpp @@ -8,6 +8,8 @@ #include #include #include +#include "../FileSystem/ConfigFile.h" +#include "../framework.h" namespace TLAC::Components { @@ -91,6 +93,10 @@ namespace TLAC::Components panelState = (TouchPanelState*)TASK_TOUCH_ADDRESS; componentsManager = manager; + TLAC::FileSystem::ConfigFile config(TLAC::framework::GetModuleDirectory(), "keyconfig.ini"); + config.OpenRead(); + autoPause = config.GetBooleanValue("autopause"); + saveOldPatchOps(); DetourTransactionBegin(); @@ -537,7 +543,7 @@ namespace TLAC::Components void Pause::OnFocusLost() { - if (isInGame()) + if (isInGame() && autoPause) pause = true; } diff --git a/source-code/source/plugins/TLAC/Components/Pause.h b/source-code/source/plugins/TLAC/Components/Pause.h index 66afc4f..03f654c 100644 --- a/source-code/source/plugins/TLAC/Components/Pause.h +++ b/source-code/source/plugins/TLAC/Components/Pause.h @@ -131,5 +131,7 @@ namespace TLAC::Components static float getMenuAnimPos(); static TLAC::Utilities::Drawing::Point getMenuItemCoords(menusets set, int pos); + + bool autoPause; }; }