overhauled input symbols to be more gamepad-friendly
This commit is contained in:
parent
3b64e7871b
commit
5f99c595af
|
@ -123,29 +123,26 @@ struct
|
|||
}
|
||||
static buttonCodes[] =
|
||||
{
|
||||
{ "DOWN", Input::Down },
|
||||
{ "LEFT", Input::Left },
|
||||
{ "RIGHT", Input::Right },
|
||||
{ "UP", Input::Up },
|
||||
{ "DOWN", Input::Down },
|
||||
{ "LEFT", Input::Left },
|
||||
{ "RIGHT", Input::Right },
|
||||
{ "UP", Input::Up },
|
||||
|
||||
{ "A", Input::A },
|
||||
{ "B", Input::B },
|
||||
{ "C", Input::C },
|
||||
{ "X", Input::X },
|
||||
{ "Y", Input::Y },
|
||||
{ "Z", Input::Z },
|
||||
{ "L", Input::L },
|
||||
{ "R", Input::R },
|
||||
{ "ACTION", Input::Action },
|
||||
{ "CANCEL", Input::Cancel },
|
||||
{ "MENU", Input::Menu },
|
||||
{ "ITEMS", Input::Items },
|
||||
{ "RUN", Input::Run },
|
||||
{ "DEACTIVATE", Input::Deactivate },
|
||||
|
||||
{ "SHIFT", Input::Shift },
|
||||
{ "CTRL", Input::Ctrl },
|
||||
{ "ALT", Input::Alt },
|
||||
{ "L", Input::L },
|
||||
{ "R", Input::R },
|
||||
|
||||
{ "F5", Input::F5 },
|
||||
{ "F6", Input::F6 },
|
||||
{ "F7", Input::F7 },
|
||||
{ "F8", Input::F8 },
|
||||
{ "F9", Input::F9 },
|
||||
{ "F5", Input::F5 },
|
||||
{ "F6", Input::F6 },
|
||||
{ "F7", Input::F7 },
|
||||
{ "F8", Input::F8 },
|
||||
{ "F9", Input::F9 },
|
||||
|
||||
{ "MOUSELEFT", Input::MouseLeft },
|
||||
{ "MOUSEMIDDLE", Input::MouseMiddle },
|
||||
|
|
|
@ -205,12 +205,6 @@ struct MsBinding : public Binding
|
|||
/* Not rebindable */
|
||||
static const KbBindingData staticKbBindings[] =
|
||||
{
|
||||
{ SDL_SCANCODE_LSHIFT, Input::Shift },
|
||||
{ SDL_SCANCODE_RSHIFT, Input::Shift },
|
||||
{ SDL_SCANCODE_LCTRL, Input::Ctrl },
|
||||
{ SDL_SCANCODE_RCTRL, Input::Ctrl },
|
||||
{ SDL_SCANCODE_LALT, Input::Alt },
|
||||
{ SDL_SCANCODE_RALT, Input::Alt },
|
||||
{ SDL_SCANCODE_F5, Input::F5 },
|
||||
{ SDL_SCANCODE_F6, Input::F6 },
|
||||
{ SDL_SCANCODE_F7, Input::F7 },
|
||||
|
|
11
src/input.h
11
src/input.h
|
@ -34,11 +34,14 @@ public:
|
|||
|
||||
Down = 2, Left = 4, Right = 6, Up = 8,
|
||||
|
||||
A = 11, B = 12, C = 13,
|
||||
X = 14, Y = 15, Z = 16,
|
||||
L = 17, R = 18,
|
||||
Action = 11,
|
||||
Cancel = 12,
|
||||
Menu = 13,
|
||||
Items = 14,
|
||||
Run = 15,
|
||||
Deactivate = 16,
|
||||
|
||||
Shift = 21, Ctrl = 22, Alt = 23,
|
||||
L = 17, R = 18,
|
||||
|
||||
F5 = 25, F6 = 26, F7 = 27, F8 = 28, F9 = 29,
|
||||
|
||||
|
|
|
@ -67,32 +67,33 @@ struct JsBindingData
|
|||
/* Common */
|
||||
static const KbBindingData defaultKbBindings[] =
|
||||
{
|
||||
{ SDL_SCANCODE_LEFT, Input::Left },
|
||||
{ SDL_SCANCODE_RIGHT, Input::Right },
|
||||
{ SDL_SCANCODE_UP, Input::Up },
|
||||
{ SDL_SCANCODE_DOWN, Input::Down },
|
||||
{ SDL_SCANCODE_H, Input::Left },
|
||||
{ SDL_SCANCODE_L, Input::Right },
|
||||
{ SDL_SCANCODE_K, Input::Up },
|
||||
{ SDL_SCANCODE_J, Input::Down },
|
||||
{ SDL_SCANCODE_Z, Input::C },
|
||||
{ SDL_SCANCODE_SPACE, Input::C },
|
||||
{ SDL_SCANCODE_RETURN, Input::C },
|
||||
{ SDL_SCANCODE_X, Input::B },
|
||||
{ SDL_SCANCODE_ESCAPE, Input::B },
|
||||
{ SDL_SCANCODE_KP_0, Input::B },
|
||||
{ SDL_SCANCODE_LSHIFT, Input::A },
|
||||
{ SDL_SCANCODE_LCTRL, Input::X },
|
||||
{ SDL_SCANCODE_LEFT, Input::Left },
|
||||
{ SDL_SCANCODE_RIGHT, Input::Right },
|
||||
{ SDL_SCANCODE_UP, Input::Up },
|
||||
{ SDL_SCANCODE_DOWN, Input::Down },
|
||||
{ SDL_SCANCODE_H, Input::Left },
|
||||
{ SDL_SCANCODE_L, Input::Right },
|
||||
{ SDL_SCANCODE_K, Input::Up },
|
||||
{ SDL_SCANCODE_J, Input::Down },
|
||||
{ SDL_SCANCODE_Z, Input::Action },
|
||||
{ SDL_SCANCODE_SPACE, Input::Action },
|
||||
{ SDL_SCANCODE_RETURN, Input::Action },
|
||||
{ SDL_SCANCODE_X, Input::Cancel },
|
||||
{ SDL_SCANCODE_A, Input::Menu },
|
||||
{ SDL_SCANCODE_ESCAPE, Input::Menu },
|
||||
{ SDL_SCANCODE_KP_0, Input::Menu },
|
||||
{ SDL_SCANCODE_S, Input::Items },
|
||||
{ SDL_SCANCODE_LSHIFT, Input::Run },
|
||||
{ SDL_SCANCODE_LCTRL, Input::Deactivate },
|
||||
{ SDL_SCANCODE_Q, Input::L },
|
||||
{ SDL_SCANCODE_W, Input::R },
|
||||
};
|
||||
|
||||
static elementsN(defaultKbBindings);
|
||||
|
||||
static const JsBindingData defaultJsBindings[] =
|
||||
{
|
||||
{ 0, Input::C },
|
||||
{ 1, Input::B },
|
||||
{ 2, Input::A },
|
||||
{ 3, Input::X },
|
||||
{ 0, Input::Action },
|
||||
};
|
||||
|
||||
static elementsN(defaultJsBindings);
|
||||
|
@ -148,7 +149,7 @@ BDescVec genDefaultBindings()
|
|||
return d;
|
||||
}
|
||||
|
||||
#define FORMAT_VER 2
|
||||
#define FORMAT_VER 3
|
||||
|
||||
struct Header
|
||||
{
|
||||
|
@ -210,10 +211,13 @@ static bool verifyDesc(const BindingDesc &desc)
|
|||
{
|
||||
Input::None,
|
||||
Input::Down, Input::Left, Input::Right, Input::Up,
|
||||
Input::A, Input::B, Input::C,
|
||||
Input::X, Input::Y, Input::Z,
|
||||
Input::Action,
|
||||
Input::Cancel,
|
||||
Input::Menu,
|
||||
Input::Items,
|
||||
Input::Run,
|
||||
Input::Deactivate,
|
||||
Input::L, Input::R,
|
||||
Input::Shift, Input::Ctrl, Input::Alt,
|
||||
Input::F5, Input::F6, Input::F7, Input::F8, Input::F9
|
||||
};
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
#include <algorithm>
|
||||
#include <assert.h>
|
||||
|
||||
const Vec2i winSize(700, 316);
|
||||
const Vec2i winSize(700, 500);
|
||||
|
||||
const uint8_t cBgNorm = 50;
|
||||
const uint8_t cBgDark = 20;
|
||||
|
@ -62,13 +62,18 @@ struct VButton
|
|||
} static const vButtons[] =
|
||||
{
|
||||
BTN_STRING(Up),
|
||||
BTN_STRING(Down),
|
||||
BTN_STRING(Left),
|
||||
BTN_STRING(Action),
|
||||
BTN_STRING(Cancel),
|
||||
BTN_STRING(Menu),
|
||||
BTN_STRING(L),
|
||||
|
||||
BTN_STRING(Down),
|
||||
BTN_STRING(Right),
|
||||
{ Input::C, "Action" },
|
||||
{ Input::B, "Menu" },
|
||||
{ Input::A, "Run/Misc" },
|
||||
{ Input::X, "Deactivate" },
|
||||
BTN_STRING(Run),
|
||||
BTN_STRING(Deactivate),
|
||||
BTN_STRING(Items),
|
||||
BTN_STRING(R),
|
||||
};
|
||||
|
||||
static elementsN(vButtons);
|
||||
|
@ -516,7 +521,6 @@ struct SettingsMenuPrivate
|
|||
}
|
||||
|
||||
dupWarnLabel.setVisible(haveDup);
|
||||
infoLabel.setVisible(!haveDup);
|
||||
}
|
||||
|
||||
void redraw()
|
||||
|
@ -962,7 +966,7 @@ SettingsMenu::SettingsMenu(RGSSThreadData &rtData)
|
|||
p->rgb = p->winSurf->format;
|
||||
|
||||
const size_t layoutW = 2;
|
||||
const size_t layoutH = 4;
|
||||
const size_t layoutH = 6;
|
||||
assert(layoutW*layoutH == vButtonsN);
|
||||
|
||||
const int bWidgetW = winSize.x / layoutW;
|
||||
|
@ -1005,10 +1009,10 @@ SettingsMenu::SettingsMenu(RGSSThreadData &rtData)
|
|||
|
||||
/* Labels */
|
||||
const char *info = "Use left click to bind a slot, right click to clear its binding";
|
||||
p->infoLabel = Label(p, IntRect(112 + 32, buttonY + 8, winSize.x, 16), info, cText, cText, cText);
|
||||
p->infoLabel = Label(p, IntRect(16, 16, winSize.x, 16), info, cText, cText, cText);
|
||||
|
||||
const char *warn = "Warning: Same physical key bound to multiple slots";
|
||||
p->dupWarnLabel = Label(p, IntRect(112 + 32, buttonY + 8, winSize.x, 16), warn, 255, 0, 0);
|
||||
p->dupWarnLabel = Label(p, IntRect(16, 40, winSize.x, 16), warn, 255, 0, 0);
|
||||
|
||||
p->widgets.push_back(&p->infoLabel);
|
||||
p->widgets.push_back(&p->dupWarnLabel);
|
||||
|
|
Loading…
Reference in New Issue