Added scrollwheel weapon swapping

This commit is contained in:
Phnod authored and Catherine Reprobate committed 2023-08-26 16:14:43 -07:00
1 parent 1439f8bbeb
commit 5a0580005f
2 files changed
+18 -2

No files matched your search

+2 -2
View File
@@ -67,8 +67,8 @@ void inputSetDefaultKeyBinds(void)
{ CK_START, SDL_SCANCODE_RETURN, SDL_SCANCODE_TAB },
{ CK_DPAD_D, SDL_SCANCODE_G, VK_MOUSE_MIDDLE },
{ CK_DPAD_U, 0, 0 },
{ CK_DPAD_R, 0, 0 },
{ CK_DPAD_L, 0, 0 },
{ CK_DPAD_R, VK_MOUSE_WHEEL_UP, 0 },
{ CK_DPAD_L, VK_MOUSE_WHEEL_DN, 0 },
{ CK_C_D, SDL_SCANCODE_S, 0 },
{ CK_C_U, SDL_SCANCODE_W, 0 },
{ CK_C_R, SDL_SCANCODE_D, 0 },
+16
View File
@@ -903,6 +903,14 @@ void bmoveProcessInput(bool allowc1x, bool allowc1y, bool allowc1buttons, bool i
}
} else {
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)
|| joyGetButtonsOnSample(i, contpad2, c2allowedbuttons & A_BUTTON)) {
if (g_Vars.currentplayer->invdowntime > -2) {
@@ -1275,6 +1283,14 @@ void bmoveProcessInput(bool allowc1x, bool allowc1y, bool allowc1buttons, bool i
}
} else {
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 (g_Vars.currentplayer->invdowntime > -2) {
if (joyGetButtonsPressedOnSample(i, contpad1, shootbuttons & c1allowedbuttons)) {