Skip to content

Commit

Permalink
fix: fix an issue where automatic solution could not be stopped
Browse files Browse the repository at this point in the history
  • Loading branch information
ShenMian committed Feb 6, 2024
1 parent 776123a commit 396cc0e
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions src/systems/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,23 +58,36 @@ pub fn handle_actions(
&database,
board,
);
handle_toggle_instant_move_action(&action_state, &mut config);
handle_toggle_toggle_fullscreen_action(&action_state, window);
handle_toggle_fullscreen_action(&action_state, window);
handle_undo_redo_action(
&action_state,
&mut player_movement,
board,
&mut update_grid_position_events,
);
handle_toggle_instant_move_action(&action_state, &mut config);
handle_automatic_solution_action(
&action_state,
&state,
&mut next_state,
&mut player_movement,
);
}
AppState::AutoMove => {
handle_viewport_zoom_action(&action_state, main_camera);
handle_toggle_fullscreen_action(&action_state, window);
}
AppState::AutoSolve => {
handle_viewport_zoom_action(&action_state, main_camera);
handle_toggle_fullscreen_action(&action_state, window);
handle_toggle_instant_move_action(&action_state, &mut config);
handle_automatic_solution_action(
&action_state,
&state,
&mut next_state,
&mut player_movement,
);
}
AppState::AutoMove => handle_viewport_zoom_action(&action_state, main_camera),
AppState::AutoSolve => handle_viewport_zoom_action(&action_state, main_camera),
}
}

Expand Down Expand Up @@ -224,7 +237,7 @@ fn handle_toggle_instant_move_action(
}
}

fn handle_toggle_toggle_fullscreen_action(action_state: &ActionState<Action>, window: &mut Window) {
fn handle_toggle_fullscreen_action(action_state: &ActionState<Action>, window: &mut Window) {
if action_state.just_pressed(Action::ToggleFullscreen) {
window.mode = match window.mode {
WindowMode::BorderlessFullscreen => WindowMode::Windowed,
Expand Down

0 comments on commit 396cc0e

Please sign in to comment.