X-Git-Url: https://plomlompom.com/repos/berlin_corona.txt?a=blobdiff_plain;f=src%2Fcontrol.c;h=b9ebbe15ee3a7d0897540ce9946253d5aa252625;hb=e505542d10413b5cf94edda90bdc793a48db9385;hp=9915891bd756337b7c954ca3c3282b004d7fb451;hpb=58f0067336c9239750009b3f35d18031bec8f7b5;p=plomrogue diff --git a/src/control.c b/src/control.c index 9915891..b9ebbe1 100644 --- a/src/control.c +++ b/src/control.c @@ -11,32 +11,33 @@ #include "map.h" /* for map_scroll(), map_center_player(), dir enum */ #include "main.h" /* for World struct */ #include "rexit.h" /* for exit_err() */ -#include "misc.h" /* for scroll_pad(), toggle_window(), - * growshrink_active_window() - */ +#include "wincontrol.h" /* for scroll_pad(), toggle_window(), + * growshrink_active_window(), reload_win_config() + */ #include "map_object_actions.h" /* for player_wait(), move_player() */ +#include "command_db.h" /* for is_command_id_shortdsc() */ extern void record_control(int action, struct World * world) { - if (0 == action) + if (is_command_id_shortdsc(world, action, "wait")) { player_wait(world); } - else if (NORTH == action) + else if (is_command_id_shortdsc(world, action, "player_u")) { move_player(world, NORTH); } - else if (EAST == action) + else if (is_command_id_shortdsc(world, action, "player_r")) { move_player(world, EAST); } - else if (SOUTH == action) + else if (is_command_id_shortdsc(world, action, "player_d")) { move_player(world, SOUTH); } - else if (WEST == action) + else if (is_command_id_shortdsc(world, action, "player_l")) { move_player(world, WEST); } @@ -180,7 +181,11 @@ extern uint8_t meta_control(int key, struct World * world) } else if (key == get_action_key(world->keybindings, "map_c")) { - map_center_player (world->map, world->player, win_map->frame.size); + map_center_player(world->map, world->player, win_map->frame.size); + } + else if (key == get_action_key(world->keybindings, "reload_wins")) + { + reload_win_config(world); } return 0; }