From 8f2c31afbc61160ca024f2a036e48b06fdd49881 Mon Sep 17 00:00:00 2001 From: Kirill Petrashin Date: Mon, 13 Apr 2026 14:56:07 +0300 Subject: More keybindings in map_editor() --- map.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/map.c b/map.c index 52f65d6..569ab46 100644 --- a/map.c +++ b/map.c @@ -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); -- cgit v1.2.3