Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input fixups for quick-detonate and radial menu navigation #206

Merged
merged 2 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,22 @@ Note that the mouse only controls player 1.

Controls can be rebound in `pd.ini`. Default control scheme is as follows:

| Action | Keyboard and mouse | Xbox pad | N64 pad |
| - | - | - | - |
| Fire / Accept | LMB/Space | RT | Z Trigger |
| Aim mode | RMB/Z | LT | R Trigger |
| Use / Cancel | E | N/A | B |
| Use / Accept | N/A | A | A |
| Crouch cycle | N/A | L3 | `0x80000000` (Extra) |
| Half-Crouch | Shift | N/A | `0x40000000` (Extra) |
| Full-Crouch | Control | N/A | `0x20000000` (Extra) |
| Reload | R | X | X `(0x40)` |
| Previous weapon | Mousewheel forward | B | D-Left |
| Next weapon | Mousewheel back | Y | Y `(0x80)` |
| Radial menu | Q | LB | D-Down |
| Alt fire mode | F | RB | L Trigger |
| Alt-fire oneshot | F + LMB or E + LMB | A + RT or RB + RT | A + Z, L + Z |
| Quick-detonate | E + Q | A + B | A + D-Left |
| Action | Keyboard and mouse | Xbox pad | N64 pad |
| - | - | - | - |
| Fire / Accept | LMB/Space | RT | Z Trigger |
| Aim mode | RMB/Z | LT | R Trigger |
| Use / Cancel | E | N/A | B |
| Use / Accept | N/A | A | A |
| Crouch cycle | N/A | L3 | `0x80000000` (Extra) |
| Half-Crouch | Shift | N/A | `0x40000000` (Extra) |
| Full-Crouch | Control | N/A | `0x20000000` (Extra) |
| Reload | R | X | X `(0x40)` |
| Previous weapon | Mousewheel forward | B | D-Left |
| Next weapon | Mousewheel back | Y | Y `(0x80)` |
| Radial menu | Q | LB | D-Down |
| Alt fire mode | F | RB | L Trigger |
| Alt-fire oneshot | `F + LMB` or `E + LMB` | `A + RT`` or 'RB + RT` | `A + Z` or `L + Z` |
| Quick-detonate | `E + Q` or `E + R` | `A + B` or `A + X` | `A + D-Left`or `A + 0x40` |

## Building

Expand Down
8 changes: 2 additions & 6 deletions src/game/activemenutick.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ void amTick(void)
s8 gotonextscreen = false;
s8 cstickx = joyGetStickXOnSample(j, contpadnum);
s8 csticky = joyGetStickYOnSample(j, contpadnum);
s8 crstickx = joyGetRStickXOnSample(j, contpadnum);
s8 crsticky = joyGetRStickYOnSample(j, contpadnum);
#ifdef AVOID_UB
// if cstickx is -128, it will get negated and stored into absstickx, negating it again if it's 8 bit
s32 absstickx;
Expand All @@ -75,8 +73,8 @@ void amTick(void)
g_AmMenus[g_AmIndex].allbots = false;

#ifndef PLATFORM_N64
s32 newstickx = (s32)cstickx + (s32)crstickx;
s32 newsticky = (s32)csticky + (s32)crsticky;
s32 newstickx = (s32)cstickx;
s32 newsticky = (s32)csticky;
if (j == 0 && g_Vars.currentplayernum == 0 && inputMouseIsLocked()) {
f32 mdx, mdy;
struct activemenu *am = &g_AmMenus[g_AmIndex];
Expand All @@ -98,8 +96,6 @@ void amTick(void)
buttonsstate = buttonsstate & D_JPAD;
cstickx = 0;
csticky = 0;
crstickx = 0;
crsticky = 0;
buttonspressed = 0;
}

Expand Down
2 changes: 1 addition & 1 deletion src/game/bondmove.c
Original file line number Diff line number Diff line change
Expand Up @@ -1748,7 +1748,7 @@ void bmoveProcessInput(bool allowc1x, bool allowc1y, bool allowc1buttons, bool i
g_Vars.currentplayer->usedowntime = -2;
}
#else
bgunProcessQuickDetonate(&movedata, c1buttons, c1buttonsthisframe, (BUTTON_CANCEL_USE | BUTTON_ACCEPT_USE), (BUTTON_WPNBACK | BUTTON_RADIAL));
bgunProcessQuickDetonate(&movedata, c1buttons, c1buttonsthisframe, (BUTTON_CANCEL_USE | BUTTON_ACCEPT_USE), (BUTTON_WPNBACK | BUTTON_RADIAL | BUTTON_RELOAD));
#endif
}

Expand Down