home · contact · privacy
Heavily re-structured initialization of windows and how individual windows are identi...
[plomrogue] / src / control.c
index a2a44b2aaac710ff3b4305abce9a2800f448f1d4..0b601fe861d3b83b2dccd6ff38e41b890266362c 100644 (file)
@@ -11,9 +11,9 @@
 #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(), get_win_by_id(),
+                         * 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() */
 
@@ -78,11 +78,11 @@ extern uint8_t player_control(int key, struct World * world)
 
 extern uint8_t meta_control(int key, struct World * world)
 {
-    struct WinMeta * win_meta = world->wins.meta;
-    struct Win * win_keys     = world->wins.keys;
-    struct Win * win_map      = world->wins.map;
-    struct Win * win_info     = world->wins.info;
-    struct Win * win_log      = world->wins.log;
+    struct WinMeta * win_meta = world->wmeta;
+    struct Win * win_keys     = get_win_by_id(world, 'k');
+    struct Win * win_map      = get_win_by_id(world, 'm');
+    struct Win * win_info     = get_win_by_id(world, 'i');
+    struct Win * win_log      = get_win_by_id(world, 'l');
     char * err_toggle = "Trouble with toggle_window() in meta_keys().";
     char * err_shift  = "Trouble with shift_active_win() in meta_keys().";
     char * err_resize = "Trouble with growshrink_active_window() in "
@@ -181,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;
 }