summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcpasjuste <cpasjuste@gmail.com>2020-04-29 11:17:12 +0200
committercpasjuste <cpasjuste@gmail.com>2020-04-29 11:17:12 +0200
commit63fd641252dd035e51730fa2172f6faea0d5f756 (patch)
tree1cfcfd1b607b2e3c070162cb222ab0bed16d56f0 /src
parent767d987fb02051621ae087534b42ab956abdfc32 (diff)
downloadplus-63fd641252dd035e51730fa2172f6faea0d5f756.tar.gz
plus-63fd641252dd035e51730fa2172f6faea0d5f756.tar.bz2
plus-63fd641252dd035e51730fa2172f6faea0d5f756.tar.xz
plus-63fd641252dd035e51730fa2172f6faea0d5f756.zip
switch: change default input mapping in inputactionmap.h
Diffstat (limited to 'src')
-rw-r--r--src/gui/windows/logindialog.cpp7
-rw-r--r--src/input/inputactionmap.h48
2 files changed, 50 insertions, 5 deletions
diff --git a/src/gui/windows/logindialog.cpp b/src/gui/windows/logindialog.cpp
index f169635dc..7f36704cb 100644
--- a/src/gui/windows/logindialog.cpp
+++ b/src/gui/windows/logindialog.cpp
@@ -204,14 +204,15 @@ void LoginDialog::postInit()
loadWindowState();
reflowLayout(0, 0);
+#ifdef SAVE_PASSWORD
+ mPassField->setText(LoginDialog::savedPassword);
+#else
if (mUserField->getText().empty())
mUserField->requestFocus();
else {
-#ifdef SAVE_PASSWORD
- mPassField->setText(LoginDialog::savedPassword);
-#endif
mPassField->requestFocus();
}
+#endif
mLoginButton->setEnabled(canSubmit());
if (loginHandler != nullptr)
diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h
index 9a7983312..926a98e6b 100644
--- a/src/input/inputactionmap.h
+++ b/src/input/inputactionmap.h
@@ -100,7 +100,11 @@ static const InputActionData inputActionData
Protected_false},
{"keyAttack",
addKey(SDLK_x),
+#ifdef __SWITCH__
+ joystickButton(9),
+#else
emptyKey,
+#endif
Input::GRP_DEFAULT | Input::GRP_REPEAT,
&Actions::attack,
InputAction::NO_VALUE, 50,
@@ -127,7 +131,11 @@ static const InputActionData inputActionData
Protected_false},
{"keyMoveToTarget",
addKey(SDLK_v),
+#ifdef __SWITCH__
+ joystickButton(3),
+#else
emptyKey,
+#endif
Input::GRP_DEFAULT,
&Actions::moveToTarget,
InputAction::NO_VALUE, 50,
@@ -188,7 +196,11 @@ static const InputActionData inputActionData
Protected_false},
{"keyTalk",
addKey(SDLK_t),
+#ifdef __SWITCH__
+ joystickButton(8),
+#else
emptyKey,
+#endif
Input::GRP_DEFAULT,
&Actions::talk,
InputAction::NO_VALUE, 50,
@@ -198,7 +210,11 @@ static const InputActionData inputActionData
Protected_false},
{"keyTarget",
addKey(SDLK_LSHIFT),
+#ifdef __SWITCH__
+ emptyKey,
+#else
joystickButton(4),
+#endif
Input::GRP_DEFAULT,
&Actions::stopAttack,
InputAction::NO_VALUE, 50,
@@ -214,7 +230,11 @@ static const InputActionData inputActionData
Protected_false},
{"keyTargetMonster",
addKey(SDLK_a),
+#ifdef __SWITCH__
+ joystickButton(7),
+#else
joystickButton(3),
+#endif
Input::GRP_DEFAULT | Input::GRP_REPEAT,
&Actions::targetMonster,
InputAction::NO_VALUE, 50,
@@ -227,7 +247,11 @@ static const InputActionData inputActionData
Protected_false},
{"keyTargetNPC",
addKey(SDLK_n),
+#ifdef __SWITCH__
+ joystickButton(6),
+#else
emptyKey,
+#endif
Input::GRP_DEFAULT,
&Actions::targetNPC,
InputAction::NO_VALUE, 50,
@@ -251,7 +275,11 @@ static const InputActionData inputActionData
Protected_false},
{"keyPickup",
addKey(SDLK_z),
+#ifdef __SWITCH__
+ joystickButton(2),
+#else
joystickButton(1),
+#endif
Input::GRP_DEFAULT,
&Actions::pickup,
InputAction::NO_VALUE, 50,
@@ -288,7 +316,11 @@ static const InputActionData inputActionData
Protected_true},
{"keyBeingSit",
addKey(SDLK_s),
+#ifdef __SWITCH__
+ emptyKey,
+#else
joystickButton(2),
+#endif
Input::GRP_DEFAULT,
&Actions::sit,
InputAction::NO_VALUE, 50,
@@ -355,7 +387,7 @@ static const InputActionData inputActionData
#if defined(ANDROID)
addKey(SDLK_AC_BACK),
#elif defined(__SWITCH__)
- joystickButton(10),
+ joystickButton(11),
#else
emptyKey,
#endif
@@ -2320,7 +2352,11 @@ static const InputActionData inputActionData
Protected_true},
{"keyChat",
addKey(SDLK_RETURN),
+#ifdef __SWITCH__
+ joystickButton(10),
+#else
emptyKey,
+#endif
Input::GRP_DEFAULT | Input::GRP_CHAT,
&Actions::toggleChat,
InputAction::NO_VALUE, 50,
@@ -2787,7 +2823,7 @@ static const InputActionData inputActionData
#if defined(ANDROID)
addKey(SDLK_AC_BACK),
#elif defined(__SWITCH__)
- joystickButton(10),
+ joystickButton(11),
#else
emptyKey,
#endif
@@ -2900,7 +2936,15 @@ static const InputActionData inputActionData
UseArgs_false,
Protected_true},
{"keyStopSit",
+#ifdef __SWITCH__
+ emptyKey,
+ joystickButton(1),
+ Input::GRP_DEFAULT,
+ &Actions::stopSit,
+ InputAction::NO_VALUE, 50,
+#else
defaultAction(&Actions::stopSit),
+#endif
InputCondition::KEY_DOWN |
InputCondition::DEFAULT |
InputCondition::INGAME,