From: Christian Heller Date: Tue, 17 Sep 2013 03:26:21 +0000 (+0200) Subject: Added dummy inventory window. X-Git-Tag: tce~957 X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/task?a=commitdiff_plain;h=88aa628d575ff69afba9e7d7a90873e40ded1fde;p=plomrogue Added dummy inventory window. --- diff --git a/config/commands b/config/commands index 50da77c..cdd65b9 100644 --- a/config/commands +++ b/config/commands @@ -44,3 +44,4 @@ 44 map_r map right 45 map_c map center player 46 to_a_keywin toggle view of available keybindings +46 to_inv toggle inventory window diff --git a/config/keybindings_global b/config/keybindings_global index 17e75b3..7d825a6 100644 --- a/config/keybindings_global +++ b/config/keybindings_global @@ -2,10 +2,11 @@ 265 to_a_keywin 266 to_mapwin 267 to_infowin -268 to_logwin -269 to_g_keywin -270 to_wg_keywin -271 to_wk_keywin +268 to_inv +269 to_logwin +270 to_g_keywin +271 to_wg_keywin +272 to_wk_keywin 119 winconf 62 cyc_win_f 60 cyc_win_b diff --git a/config/windows/Win_l b/config/windows/Win_l index c97f608..e2fff52 100644 --- a/config/windows/Win_l +++ b/config/windows/Win_l @@ -1,4 +1,4 @@ Log l --4 +-10 33 diff --git a/config/windows/toggle_order_and_active b/config/windows/toggle_order_and_active index 6053b2c..2ae7c2c 100644 --- a/config/windows/toggle_order_and_active +++ b/config/windows/toggle_order_and_active @@ -1,2 +1,2 @@ -kmil -m \ No newline at end of file +kmicl +m diff --git a/src/control.c b/src/control.c index c1e295f..8531b4c 100644 --- a/src/control.c +++ b/src/control.c @@ -233,6 +233,11 @@ extern uint8_t meta_control(int key, struct World * world) { exit_err(toggle_window(win_meta, win_info), world, err_toggle); } + else if (key == get_available_keycode_to_action(world, "to_inv")) + { + uint8_t test = toggle_window(win_meta, get_win_by_id(world, 'c')); + exit_err(test, world, err_toggle); + } else if (key == get_available_keycode_to_action(world, "to_logwin")) { exit_err(toggle_window(win_meta, win_log), world, err_toggle); diff --git a/src/draw_wins.c b/src/draw_wins.c index 89a3c63..53ce68d 100644 --- a/src/draw_wins.c +++ b/src/draw_wins.c @@ -374,6 +374,13 @@ extern void draw_win_info(struct Win * win) +extern void draw_win_inventory(struct Win * win) +{ + mvwaddstr(win->frame.curses_win, 0, 0, "(empty)"); +} + + + extern void draw_win_available_keybindings(struct Win * win) { struct World * world = (struct World *) win->data; diff --git a/src/draw_wins.h b/src/draw_wins.h index c0a156c..c86f367 100644 --- a/src/draw_wins.h +++ b/src/draw_wins.h @@ -17,6 +17,7 @@ struct Win; extern void draw_win_log(struct Win * win); extern void draw_win_map(struct Win * win); extern void draw_win_info(struct Win * win); +extern void draw_win_inventory(struct Win * win); extern void draw_win_available_keybindings(struct Win * win); extern void draw_win_keybindings_global(struct Win * win); extern void draw_win_keybindings_winconf_geometry(struct Win * win); diff --git a/src/wincontrol.c b/src/wincontrol.c index 6682087..529457c 100644 --- a/src/wincontrol.c +++ b/src/wincontrol.c @@ -18,7 +18,7 @@ #include "main.h" /* for World struct */ #include "draw_wins.h" /* for draw_win_map(), draw_win_info(), draw_win_og(), * draw_win_available_keybindings(), - * draw_win_keybindings_global(), + * draw_win_keybindings_global(), draw_win_inventory(), * draw_win_keybindings_winconf_geometry(), * draw_win_keybindings_winconf_keybindings(), * draw_winconf_geometry(), draw_winconf_keybindings() @@ -276,6 +276,10 @@ static struct WinConf * get_winconf_by_id(struct World * world, char id) static void * get_drawfunc_by_char(char c) { + if ('c' == c) + { + return draw_win_inventory; + } if ('i' == c) { return draw_win_info; @@ -284,14 +288,14 @@ static void * get_drawfunc_by_char(char c) { return draw_win_log; } - else if ('m' == c) - { - return draw_win_map; - } else if ('k' == c) { return draw_win_available_keybindings; } + else if ('m' == c) + { + return draw_win_map; + } else if ('0' == c) { return draw_win_keybindings_global;