generated from GarandPLG/rust-flake-template
Add toggle_marking and simplify marking logic
Introduce a public `BoardState::toggle_marking` that flips the marking mode and starts or clears marking accordingly. Refactor `set_marked_cell` to accept tuple coordinates and clean up its logic. Update `change_focused_cell` to work with the new signature and use the toggle helper. Adjust cell display to show coordinates when a cell is marked.
This commit is contained in:
1 parent
869ba0bb7f
commit
d5f4d03264
3 files changed
+22
-27
No files matched your search
@@ -83,15 +83,7 @@ pub fn skirmish_keybindings(app: &mut App, key_event: &KeyEvent) {
|
||||
}
|
||||
ZoomLevel::ZoomedOut => {}
|
||||
},
|
||||
Action::Space => {
|
||||
if board.marking_cells {
|
||||
board.marking_cells = false;
|
||||
board.clear_marked_cells();
|
||||
} else {
|
||||
board.marking_cells = true;
|
||||
board.start_marking_cells();
|
||||
}
|
||||
}
|
||||
Action::Space => board.toggle_marking(),
|
||||
Action::Backspace => {
|
||||
board.marking_cells = false;
|
||||
board.clear_marked_cells()
|
||||
|
||||
Reference in new issue
Block a user