diff options
author | eray orçunus <erayorcunus@gmail.com> | 2020-05-28 11:46:51 +0200 |
---|---|---|
committer | eray orçunus <erayorcunus@gmail.com> | 2020-05-28 11:46:51 +0200 |
commit | e6401bce181b2a9eb1ba31db0945e79277207a23 (patch) | |
tree | 1b5ba680e2f51ff00dbef7e48dc999be66066fec /src | |
parent | config reorganization (diff) | |
download | re3-e6401bce181b2a9eb1ba31db0945e79277207a23.tar re3-e6401bce181b2a9eb1ba31db0945e79277207a23.tar.gz re3-e6401bce181b2a9eb1ba31db0945e79277207a23.tar.bz2 re3-e6401bce181b2a9eb1ba31db0945e79277207a23.tar.lz re3-e6401bce181b2a9eb1ba31db0945e79277207a23.tar.xz re3-e6401bce181b2a9eb1ba31db0945e79277207a23.tar.zst re3-e6401bce181b2a9eb1ba31db0945e79277207a23.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/control/Script.cpp | 14 | ||||
-rw-r--r-- | src/control/Script.h | 4 | ||||
-rw-r--r-- | src/core/Frontend.cpp | 21 |
3 files changed, 28 insertions, 11 deletions
diff --git a/src/control/Script.cpp b/src/control/Script.cpp index 0b0341b4..bc15a695 100644 --- a/src/control/Script.cpp +++ b/src/control/Script.cpp @@ -538,22 +538,14 @@ void CRunningScript::Init() } #ifdef USE_DEBUG_SCRIPT_LOADER +int scriptToLoad = 0; + #ifdef _WIN32 #include <Windows.h> #endif int open_script() { - static int scriptToLoad = 0; - - // Doesn't work because of CGame::Initialise is blocking - /* - if (glfwGetKey(PSGLOBAL(window), GLFW_KEY_G) == GLFW_PRESS) - scriptToLoad = 0; - if (glfwGetKey(PSGLOBAL(window), GLFW_KEY_R) == GLFW_PRESS) - scriptToLoad = 1; - if (glfwGetKey(PSGLOBAL(window), GLFW_KEY_D) == GLFW_PRESS) - scriptToLoad = 2; - */ + // glfwGetKey doesn't work because of CGame::Initialise is blocking #ifdef _WIN32 if (GetAsyncKeyState('G') & 0x8000) scriptToLoad = 0; diff --git a/src/control/Script.h b/src/control/Script.h index 743fad99..7964ec6c 100644 --- a/src/control/Script.h +++ b/src/control/Script.h @@ -521,3 +521,7 @@ extern bool doingMissionRetry; uint32 AddExtraDeathDelay(); void RetryMission(int, int); #endif + +#ifdef USE_DEBUG_SCRIPT_LOADER +extern int scriptToLoad; +#endif
\ No newline at end of file diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp index 53a95ae6..cdacc0a4 100644 --- a/src/core/Frontend.cpp +++ b/src/core/Frontend.cpp @@ -3568,6 +3568,9 @@ CMenuManager::Process(void) } #endif if (CheckSlotDataValid(m_nCurrSaveSlot)) { +#ifdef USE_DEBUG_SCRIPT_LOADER + scriptToLoad = 0; +#endif TheCamera.m_bUseMouse3rdPerson = m_ControlMethod == CONTROL_STANDARD; if (m_PrefsVsyncDisp != m_PrefsVsync) m_PrefsVsync = m_PrefsVsyncDisp; @@ -3688,6 +3691,24 @@ CMenuManager::ProcessButtonPresses(void) bool assumeIncrease = false; #endif +#ifdef USE_DEBUG_SCRIPT_LOADER + if (m_nCurrScreen == MENUPAGE_START_MENU || m_nCurrScreen == MENUPAGE_NEW_GAME || m_nCurrScreen == MENUPAGE_NEW_GAME_RELOAD) { +#ifdef RW_GL3 + if (glfwGetKey(PSGLOBAL(window), GLFW_KEY_R) == GLFW_PRESS) { + scriptToLoad = 1; + DoSettingsBeforeStartingAGame(); + return; + } +#elif defined _WIN32 + if (GetAsyncKeyState('R') & 0x8000) { + scriptToLoad = 1; + DoSettingsBeforeStartingAGame(); + return; + } +#endif + } +#endif + if (!m_bShowMouse && (m_nMouseOldPosX != m_nMousePosX || m_nMouseOldPosY != m_nMousePosY)) { m_bShowMouse = true; } |