X-Git-Url: https://plomlompom.com/repos/test.html?a=blobdiff_plain;f=src%2Fdraw_wins.c;h=b15e1742d75aab610c6e29e97c34159c28a0f4ba;hb=e505542d10413b5cf94edda90bdc793a48db9385;hp=cb640f0ed45c867a10e01f1138f67552b3634264;hpb=dec2d178db21e98981c87bb2e4b46fed3b2c06c8;p=plomrogue
diff --git a/src/draw_wins.c b/src/draw_wins.c
index cb640f0..b15e174 100644
--- a/src/draw_wins.c
+++ b/src/draw_wins.c
@@ -12,6 +12,7 @@
#include "map.h" /* for Map struct */
#include "main.h" /* for World struct */
#include "rexit.h" /* for err_exit() */
+#include "command_db.h" /* for get_command_longdesc() */
@@ -233,6 +234,7 @@ extern void draw_keys_win(struct Win * win)
char * keydesc = malloc(keydescwidth), * keyname;
char * err_hint = "Trouble with draw_scroll_hint() in draw_keys_win().";
attr_t attri;
+ char * cmd_dsc;
for (y = 0; y <= world->keyswindata->max && y < win->frame.size.y; y++)
{
if (0 == y && offset > 0)
@@ -263,19 +265,19 @@ extern void draw_keys_win(struct Win * win)
keyname = get_keyname(world->keybindings[y + offset].key);
snprintf(keydesc, keydescwidth, "%-9s", keyname);
free(keyname);
+ cmd_dsc = get_command_longdsc(world,
+ world->keybindings[y + offset].name);
for (x = 0; x < win->frame.size.x; x++)
{
if (x < strlen(keydesc))
{
mvwaddch(win->frame.curses_win, y, x, keydesc[x] | attri);
}
- else if (strlen(keydesc) < x
- && x < strlen(world->keybindings[y + offset].name)
- + strlen(keydesc) + 1)
+ else if ( strlen(keydesc) < x
+ && x < strlen(cmd_dsc) + strlen(keydesc) + 1)
{
mvwaddch(win->frame.curses_win, y, x,
- world->keybindings[y + offset]
- .name[x - strlen(keydesc) - 1] | attri);
+ cmd_dsc[x - strlen(keydesc) - 1] | attri);
}
else
{