forked from Ports/perfect_dark
Added scrollwheel weapon swapping
This commit is contained in:
1 parent
1439f8bbeb
commit
5a0580005f
2 files changed
+19
-3
No files matched your search
+3
-3
@@ -66,9 +66,9 @@ void inputSetDefaultKeyBinds(void)
|
|||||||
{ CK_ZTRIG, VK_MOUSE_LEFT, SDL_SCANCODE_SPACE },
|
{ CK_ZTRIG, VK_MOUSE_LEFT, SDL_SCANCODE_SPACE },
|
||||||
{ CK_START, SDL_SCANCODE_RETURN, SDL_SCANCODE_TAB },
|
{ CK_START, SDL_SCANCODE_RETURN, SDL_SCANCODE_TAB },
|
||||||
{ CK_DPAD_D, SDL_SCANCODE_G, VK_MOUSE_MIDDLE },
|
{ CK_DPAD_D, SDL_SCANCODE_G, VK_MOUSE_MIDDLE },
|
||||||
{ CK_DPAD_U, 0, 0 },
|
{ CK_DPAD_U, 0, 0 },
|
||||||
{ CK_DPAD_R, 0, 0 },
|
{ CK_DPAD_R, VK_MOUSE_WHEEL_UP, 0 },
|
||||||
{ CK_DPAD_L, 0, 0 },
|
{ CK_DPAD_L, VK_MOUSE_WHEEL_DN, 0 },
|
||||||
{ CK_C_D, SDL_SCANCODE_S, 0 },
|
{ CK_C_D, SDL_SCANCODE_S, 0 },
|
||||||
{ CK_C_U, SDL_SCANCODE_W, 0 },
|
{ CK_C_U, SDL_SCANCODE_W, 0 },
|
||||||
{ CK_C_R, SDL_SCANCODE_D, 0 },
|
{ CK_C_R, SDL_SCANCODE_D, 0 },
|
||||||
|
|||||||
@@ -903,6 +903,14 @@ void bmoveProcessInput(bool allowc1x, bool allowc1y, bool allowc1buttons, bool i
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (i = 0; i < numsamples; i++) {
|
for (i = 0; i < numsamples; i++) {
|
||||||
|
if (joyGetButtonsPressedOnSample(i, contpad1, c1allowedbuttons & L_JPAD)) {
|
||||||
|
movedata.weaponforwardoffset++;
|
||||||
|
g_Vars.currentplayer->invdowntime = -1;
|
||||||
|
} else
|
||||||
|
if (joyGetButtonsPressedOnSample(i, contpad1, c1allowedbuttons & R_JPAD)) {
|
||||||
|
movedata.weaponbackoffset++;
|
||||||
|
g_Vars.currentplayer->invdowntime = -1;
|
||||||
|
}
|
||||||
if (joyGetButtonsOnSample(i, contpad1, c1allowedbuttons & A_BUTTON)
|
if (joyGetButtonsOnSample(i, contpad1, c1allowedbuttons & A_BUTTON)
|
||||||
|| joyGetButtonsOnSample(i, contpad2, c2allowedbuttons & A_BUTTON)) {
|
|| joyGetButtonsOnSample(i, contpad2, c2allowedbuttons & A_BUTTON)) {
|
||||||
if (g_Vars.currentplayer->invdowntime > -2) {
|
if (g_Vars.currentplayer->invdowntime > -2) {
|
||||||
@@ -1275,6 +1283,14 @@ void bmoveProcessInput(bool allowc1x, bool allowc1y, bool allowc1buttons, bool i
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (i = 0; i < numsamples; i++) {
|
for (i = 0; i < numsamples; i++) {
|
||||||
|
if (joyGetButtonsPressedOnSample(i, contpad1, c1allowedbuttons & L_JPAD)) {
|
||||||
|
movedata.weaponforwardoffset++;
|
||||||
|
g_Vars.currentplayer->invdowntime = -1;
|
||||||
|
} else
|
||||||
|
if (joyGetButtonsPressedOnSample(i, contpad1, c1allowedbuttons & R_JPAD)) {
|
||||||
|
movedata.weaponbackoffset++;
|
||||||
|
g_Vars.currentplayer->invdowntime = -1;
|
||||||
|
}
|
||||||
if (joyGetButtonsOnSample(i, contpad1, invbuttons & c1allowedbuttons)) {
|
if (joyGetButtonsOnSample(i, contpad1, invbuttons & c1allowedbuttons)) {
|
||||||
if (g_Vars.currentplayer->invdowntime > -2) {
|
if (g_Vars.currentplayer->invdowntime > -2) {
|
||||||
if (joyGetButtonsPressedOnSample(i, contpad1, shootbuttons & c1allowedbuttons)) {
|
if (joyGetButtonsPressedOnSample(i, contpad1, shootbuttons & c1allowedbuttons)) {
|
||||||
|
|||||||
Reference in new issue
Block a user