Optionalize pause on focus lost

This commit is contained in:
nastys
2019-11-16 05:33:44 +01:00
parent 7ffd9ff6da
commit 0dc475103d
4 changed files with 15 additions and 1 deletions
@@ -8,6 +8,8 @@
#include <windows.h>
#include <vector>
#include <chrono>
#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;
}