X-Git-Url: https://plomlompom.com/repos/index.html?a=blobdiff_plain;f=src%2Fcontrol.c;h=e73f5a16e4695d916965fd1f17f3df49807d1d4b;hb=b66d0aa40912f26e80a61837cad2b5c743bf4d40;hp=b9ebbe15ee3a7d0897540ce9946253d5aa252625;hpb=e505542d10413b5cf94edda90bdc793a48db9385;p=plomrogue
diff --git a/src/control.c b/src/control.c
index b9ebbe1..e73f5a1 100644
--- a/src/control.c
+++ b/src/control.c
@@ -13,6 +13,8 @@
#include "rexit.h" /* for exit_err() */
#include "wincontrol.h" /* for scroll_pad(), toggle_window(),
* growshrink_active_window(), reload_win_config()
+ * toggle_winconfig(), save_win_configs(),
+ * toggle_win_height_type(), toggle_win_width_type()
*/
#include "map_object_actions.h" /* for player_wait(), move_player() */
#include "command_db.h" /* for is_command_id_shortdsc() */
@@ -78,11 +80,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'); /* Bad hardcoding. */
+ struct Win * win_map = get_win_by_id(world, 'm'); /* TODO: Replace. */
+ 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 "
@@ -133,19 +135,19 @@ extern uint8_t meta_control(int key, struct World * world)
}
else if (key == get_action_key(world->keybindings, "grow_h"))
{
- exit_err(growshrink_active_window(win_meta, '*'), world, err_resize);
+ exit_err(growshrink_active_window(world, '*'), world, err_resize);
}
else if (key == get_action_key(world->keybindings, "shri_h"))
{
- exit_err(growshrink_active_window(win_meta, '_'), world, err_resize);
+ exit_err(growshrink_active_window(world, '_'), world, err_resize);
}
else if (key == get_action_key(world->keybindings, "grow_v"))
{
- exit_err(growshrink_active_window(win_meta, '+'), world, err_resize);
+ exit_err(growshrink_active_window(world, '+'), world, err_resize);
}
else if (key == get_action_key(world->keybindings, "shri_v"))
{
- exit_err(growshrink_active_window(win_meta, '-'), world, err_resize);
+ exit_err(growshrink_active_window(world, '-'), world, err_resize);
}
else if (key == get_action_key(world->keybindings, "save_keys"))
{
@@ -187,5 +189,21 @@ extern uint8_t meta_control(int key, struct World * world)
{
reload_win_config(world);
}
+ else if (key == get_action_key(world->keybindings, "winconf"))
+ {
+ toggle_winconfig(world, world->wmeta->active);
+ }
+ else if (key == get_action_key(world->keybindings, "to_height_t"))
+ {
+ toggle_win_height_type(world, world->wmeta->active);
+ }
+ else if (key == get_action_key(world->keybindings, "to_width_t"))
+ {
+ toggle_win_width_type(world, world->wmeta->active);
+ }
+ else if (key == get_action_key(world->keybindings, "save_winconf"))
+ {
+ save_win_configs(world);
+ }
return 0;
}