Skip to content

Commit

Permalink
rebound B to right click. fixed sm64pc#408 more
Browse files Browse the repository at this point in the history
  • Loading branch information
Bitl committed Dec 22, 2020
1 parent c951d43 commit ab4c020
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
23 changes: 19 additions & 4 deletions src/game/level_update.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,27 @@ u16 level_control_timer(s32 timerOp) {
return gHudDisplay.timer;
}

u32 pressed_pause(void) {
u32 can_pause(void) {
u32 val4 = get_dialog_id() >= 0;
u32 intangible = (gMarioState->action & ACT_FLAG_INTANGIBLE) != 0;

if (!intangible && !val4 && !gWarpTransition.isActive && sDelayedWarpOp == WARP_OP_NONE
&& (gPlayer1Controller->buttonPressed & START_BUTTON)) {
if (!intangible && !val4 && !gWarpTransition.isActive && sDelayedWarpOp == WARP_OP_NONE) {
return TRUE;
}

return FALSE;
}

u32 pressed_pause(void) {
if (can_pause() && (gPlayer1Controller->buttonPressed & START_BUTTON)) {
return TRUE;
}

return FALSE;
}

u32 lost_focus(void) {
if (can_pause() && (focus_Lost == TRUE)) {
return TRUE;
}

Expand Down Expand Up @@ -998,7 +1013,7 @@ s32 play_mode_normal(void) {
set_play_mode(PLAY_MODE_CHANGE_LEVEL);
} else if (sTransitionTimer != 0) {
set_play_mode(PLAY_MODE_CHANGE_AREA);
} else if (pressed_pause() || focus_Lost) {
} else if (pressed_pause() || lost_focus()) {
lower_background_noise(1);
cancel_rumble();
gCameraMovementFlags |= CAM_MOVE_PAUSE_SCREEN;
Expand Down
2 changes: 1 addition & 1 deletion src/pc/configfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ unsigned int configEnvVolume = MAX_VOLUME;

// Keyboard mappings (VK_ values, by default keyboard/gamepad/mouse)
unsigned int configKeyA[MAX_BINDS] = { 0x0039, 0x1000, 0x001C };
unsigned int configKeyB[MAX_BINDS] = { 0x1101, 0x1002, VK_INVALID };
unsigned int configKeyB[MAX_BINDS] = { 0x1101, 0x1002, 0x1103 };
unsigned int configKeyStart[MAX_BINDS] = { 0x0001, 0x1006, VK_INVALID };
unsigned int configKeyL[MAX_BINDS] = { 0x002D, 0x1007, VK_INVALID };
unsigned int configKeyR[MAX_BINDS] = { 0x0013, 0x100A, VK_INVALID };
Expand Down

0 comments on commit ab4c020

Please sign in to comment.