diff options
| -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); |
