diff options
| author | Kirill Petrashin <kirill8201@yandex.ru> | 2026-04-13 14:56:07 +0300 |
|---|---|---|
| committer | Kirill Petrashin <kirill8201@yandex.ru> | 2026-04-13 14:56:07 +0300 |
| commit | 8f2c31afbc61160ca024f2a036e48b06fdd49881 (patch) | |
| tree | 1a189c953e766eeb76d08e0ee01ec89c7ee2d076 /map.c | |
| parent | a68f59b62a7a19a079806880004901214ca784f4 (diff) | |
| download | astar-8f2c31afbc61160ca024f2a036e48b06fdd49881.tar.xz | |
More keybindings in map_editor()
Diffstat (limited to 'map.c')
| -rw-r--r-- | map.c | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -432,6 +432,30 @@ void map_editor(Map *map, size_t *width, size_t *height, Position *start, Positi case 'l': map_offset_x -= 2; break; case 'j': map_offset_y -= 1; break; case 'k': map_offset_y += 1; break; + + case 'H': clear(); map_offset_x += 20; break; + case 'L': clear(); map_offset_x -= 20; break; + case 'J': clear(); map_offset_y -= 10; break; + case 'K': clear(); map_offset_y += 10; break; + + case 'z': clear(); map_offset_x = 2; map_offset_y = 1; break; /* Move to top left corner */ + case 'x': clear(); map_offset_x = - *width * 2 + COLS - 2; map_offset_y = - *height + LINES - 2; break; /* Move to bottom right corner */ + + case 'g': + switch (getch()) { + case 's': + clear(); + map_offset_x = -start->x * 2 + COLS/2; + map_offset_y = -start->y + LINES/2; + break; + case 'e': + clear(); + map_offset_x = -goal->x * 2 + COLS/2; + map_offset_y = -goal->y + LINES/2; + break; + } + break; + /* TODO: keybindings to resize the map */ } draw_map(*map, *width, *height, *start, *goal, NULL, NULL, NULL, NULL); |
