mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-01-19 13:51:16 +00:00
fix WASD input conflict with debug mode
This commit is contained in:
parent
7e1cc77dbe
commit
5eabc65a28
@ -132,6 +132,7 @@ class LegoInputManager : public MxPresenter {
|
|||||||
void SetUnknown335(MxBool p_unk0x335) { m_unk0x335 = p_unk0x335; }
|
void SetUnknown335(MxBool p_unk0x335) { m_unk0x335 = p_unk0x335; }
|
||||||
void SetUnknown336(MxBool p_unk0x336) { m_unk0x336 = p_unk0x336; }
|
void SetUnknown336(MxBool p_unk0x336) { m_unk0x336 = p_unk0x336; }
|
||||||
|
|
||||||
|
MxBool GetWasd() { return m_wasd; }
|
||||||
void SetWasd(MxBool p_wasd) { m_wasd = p_wasd; }
|
void SetWasd(MxBool p_wasd) { m_wasd = p_wasd; }
|
||||||
|
|
||||||
// FUNCTION: BETA10 0x1002e390
|
// FUNCTION: BETA10 0x1002e390
|
||||||
|
|||||||
@ -655,7 +655,44 @@ MxLong LegoNavController::Notify(MxParam& p_param)
|
|||||||
{
|
{
|
||||||
if (((MxNotificationParam&) p_param).GetNotification() == c_notificationKeyPress) {
|
if (((MxNotificationParam&) p_param).GetNotification() == c_notificationKeyPress) {
|
||||||
m_unk0x5d = TRUE;
|
m_unk0x5d = TRUE;
|
||||||
SDL_Keycode key = ((LegoEventNotificationParam&) p_param).GetKey();
|
SDL_Keycode originKey = ((LegoEventNotificationParam&) p_param).GetKey();
|
||||||
|
SDL_Keycode key = originKey;
|
||||||
|
|
||||||
|
// This is necessary so any players using the WASD movement option can
|
||||||
|
// also use Debug Mode, which normally makes use of the WASD keys.
|
||||||
|
//
|
||||||
|
// For those players, we just swap the two and remap
|
||||||
|
// those conflicting debug keys to the arrow keys.
|
||||||
|
if (LegoOmni::GetInstance()->GetInputManager()->GetWasd()) {
|
||||||
|
switch (originKey) {
|
||||||
|
case SDLK_W:
|
||||||
|
key = SDLK_UP;
|
||||||
|
break;
|
||||||
|
case SDLK_A:
|
||||||
|
key = SDLK_LEFT;
|
||||||
|
break;
|
||||||
|
case SDLK_S:
|
||||||
|
key = SDLK_DOWN;
|
||||||
|
break;
|
||||||
|
case SDLK_D:
|
||||||
|
key = SDLK_RIGHT;
|
||||||
|
break;
|
||||||
|
case SDLK_UP:
|
||||||
|
key = SDLK_W;
|
||||||
|
break;
|
||||||
|
case SDLK_LEFT:
|
||||||
|
key = SDLK_A;
|
||||||
|
break;
|
||||||
|
case SDLK_DOWN:
|
||||||
|
key = SDLK_S;
|
||||||
|
break;
|
||||||
|
case SDLK_RIGHT:
|
||||||
|
key = SDLK_D;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case SDLK_PAUSE: // Pause game
|
case SDLK_PAUSE: // Pause game
|
||||||
@ -763,7 +800,7 @@ MxLong LegoNavController::Notify(MxParam& p_param)
|
|||||||
// Check if the the key is part of the debug password
|
// Check if the the key is part of the debug password
|
||||||
if (!*g_currentInput) {
|
if (!*g_currentInput) {
|
||||||
// password "protected" debug shortcuts
|
// password "protected" debug shortcuts
|
||||||
switch (((LegoEventNotificationParam&) p_param).GetKey()) {
|
switch (key) {
|
||||||
case SDLK_TAB:
|
case SDLK_TAB:
|
||||||
VideoManager()->ToggleFPS(g_fpsEnabled);
|
VideoManager()->ToggleFPS(g_fpsEnabled);
|
||||||
if (g_fpsEnabled) {
|
if (g_fpsEnabled) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user