controls: fix console opening when remapping its key (#2683)
Some checks failed
Publish a pre-release / Build TR1 (push) Has been skipped
Publish a pre-release / Build TR2 (push) Has been skipped
Publish a pre-release / Create a prerelease (push) Has been skipped
Run code linters / Run code linters (push) Has been cancelled

Resolves #2641.
This commit is contained in:
walkawayy 2025-03-26 09:30:47 -04:00 committed by GitHub
parent 0939b6b384
commit 2adaf2ac0f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 11 additions and 2 deletions

View file

@ -32,6 +32,7 @@
- fixed the embedded bats fix causing problems inside rooms with trapdoors (regression from 4.6)
- fixed cutscene music looping (#2591, regression from 4.8)
- fixed saves created before version 2.15 causing a crash on load (#2654, regression from 4.8)
- fixed the console opening when remapping its key (#2641)
- removed perspective filter toggle (it had no effect; repurposed to trapezoid interpolation toggle)
- improved camera mode navigation:
- improved support for pivoting

View file

@ -4,6 +4,7 @@
- added the ability for custom levels to have up to two of each secret type per level (#2674)
- fixed the final two levels not allowing for secrets to be counted in the statistics (#1582)
- fixed Lara's holsters being empty if a game flow level removes all weapons but also re-adds the pistols (#2677)
- fixed the console opening when remapping its key (#2641)
- removed the need to specify in the game flow levels that have no secrets (secrets will be automatically counted) (#1582)
## [0.10](https://github.com/LostArtefacts/TRX/compare/tr2-0.9.2...tr2-0.10) - 2025-03-18

View file

@ -620,6 +620,11 @@ static void M_CheckUnbindKey(INPUT_BACKEND backend, INPUT_LAYOUT layout)
m_Text[TEXT_UNBIND], &m_ProgressBars[M_PROGERSS_BAR_UNBIND], progress);
}
bool Option_Controls_IsKeyChangeMode(void)
{
return m_KeyMode == KM_CHANGE || m_KeyMode == KM_CHANGEKEYUP;
}
CONTROL_MODE Option_Controls_Control(
INVENTORY_ITEM *inv_item, const bool is_busy, INPUT_BACKEND backend)
{

View file

@ -10,6 +10,7 @@ typedef enum {
CM_CONTROLLER,
} CONTROL_MODE;
bool Option_Controls_IsKeyChangeMode(void);
CONTROL_MODE Option_Controls_Control(
INVENTORY_ITEM *inv_item, bool is_busy, INPUT_BACKEND backend);
void Option_Controls_Draw(INVENTORY_ITEM *inv_item, INPUT_BACKEND backend);

View file

@ -4,6 +4,7 @@
#include "game/fmv.h"
#include "game/input.h"
#include "game/music.h"
#include "game/option/option_controls.h"
#include "game/output.h"
#include "game/shell.h"
#include "game/sound.h"
@ -181,7 +182,7 @@ void Shell_ProcessEvents(void)
// some keypresses if the player types really fast, so we need to
// react sooner.
if (!FMV_IsPlaying() && g_Config.gameplay.enable_console
&& !Console_IsOpened()
&& !Console_IsOpened() && !Option_Controls_IsKeyChangeMode()
&& Input_IsPressed(
INPUT_BACKEND_KEYBOARD, g_Config.input.keyboard_layout,
INPUT_ROLE_ENTER_CONSOLE)) {

View file

@ -238,7 +238,7 @@ static void M_HandleKeyDown(const SDL_Event *const event)
// some keypresses if the player types really fast, so we need to
// react sooner.
if (!FMV_IsPlaying() && g_Config.gameplay.enable_console
&& !Console_IsOpened()
&& !Console_IsOpened() && !Input_IsInListenMode()
&& Input_IsPressed(
INPUT_BACKEND_KEYBOARD, g_Config.input.keyboard_layout,
INPUT_ROLE_ENTER_CONSOLE)) {