Split direction key showing into separate function
This commit is contained in:
@@ -183,6 +183,7 @@ static const char *readchar_queue = "";
|
|||||||
static coord clicklook_cc;
|
static coord clicklook_cc;
|
||||||
|
|
||||||
STATIC_DCL char *NDECL(parse);
|
STATIC_DCL char *NDECL(parse);
|
||||||
|
STATIC_DCL void FDECL(show_direction_keys, (winid, boolean));
|
||||||
STATIC_DCL boolean FDECL(help_dir, (CHAR_P, const char *));
|
STATIC_DCL boolean FDECL(help_dir, (CHAR_P, const char *));
|
||||||
|
|
||||||
STATIC_PTR int
|
STATIC_PTR int
|
||||||
@@ -3790,6 +3791,37 @@ retry:
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
STATIC_OVL void
|
||||||
|
show_direction_keys(win, nodiag)
|
||||||
|
winid win;
|
||||||
|
boolean nodiag;
|
||||||
|
{
|
||||||
|
char buf[BUFSZ];
|
||||||
|
|
||||||
|
if (nodiag) {
|
||||||
|
Sprintf(buf, " %c ", Cmd.move_N);
|
||||||
|
putstr(win, 0, buf);
|
||||||
|
putstr(win, 0, " | ");
|
||||||
|
Sprintf(buf, " %c- . -%c", Cmd.move_W, Cmd.move_E);
|
||||||
|
putstr(win, 0, buf);
|
||||||
|
putstr(win, 0, " | ");
|
||||||
|
Sprintf(buf, " %c ", Cmd.move_S);
|
||||||
|
putstr(win, 0, buf);
|
||||||
|
} else {
|
||||||
|
Sprintf(buf, " %c %c %c", Cmd.move_NW, Cmd.move_N,
|
||||||
|
Cmd.move_NE);
|
||||||
|
putstr(win, 0, buf);
|
||||||
|
putstr(win, 0, " \\ | / ");
|
||||||
|
Sprintf(buf, " %c- . -%c", Cmd.move_W, Cmd.move_E);
|
||||||
|
putstr(win, 0, buf);
|
||||||
|
putstr(win, 0, " / | \\ ");
|
||||||
|
Sprintf(buf, " %c %c %c", Cmd.move_SW, Cmd.move_S,
|
||||||
|
Cmd.move_SE);
|
||||||
|
putstr(win, 0, buf);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
STATIC_OVL boolean
|
STATIC_OVL boolean
|
||||||
help_dir(sym, msg)
|
help_dir(sym, msg)
|
||||||
char sym;
|
char sym;
|
||||||
@@ -3828,29 +3860,12 @@ const char *msg;
|
|||||||
putstr(win, 0, "");
|
putstr(win, 0, "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (NODIAG(u.umonnum)) {
|
|
||||||
putstr(win, 0, "Valid direction keys in your current form are:");
|
Sprintf(buf, "Valid direction keys %sare:",
|
||||||
Sprintf(buf, " %c ", Cmd.move_N);
|
NODIAG(u.umonnum) ? "in your current form " : "");
|
||||||
putstr(win, 0, buf);
|
putstr(win, 0, buf);
|
||||||
putstr(win, 0, " | ");
|
show_direction_keys(win, NODIAG(u.umonnum));
|
||||||
Sprintf(buf, " %c- . -%c", Cmd.move_W, Cmd.move_E);
|
|
||||||
putstr(win, 0, buf);
|
|
||||||
putstr(win, 0, " | ");
|
|
||||||
Sprintf(buf, " %c ", Cmd.move_S);
|
|
||||||
putstr(win, 0, buf);
|
|
||||||
} else {
|
|
||||||
putstr(win, 0, "Valid direction keys are:");
|
|
||||||
Sprintf(buf, " %c %c %c", Cmd.move_NW, Cmd.move_N,
|
|
||||||
Cmd.move_NE);
|
|
||||||
putstr(win, 0, buf);
|
|
||||||
putstr(win, 0, " \\ | / ");
|
|
||||||
Sprintf(buf, " %c- . -%c", Cmd.move_W, Cmd.move_E);
|
|
||||||
putstr(win, 0, buf);
|
|
||||||
putstr(win, 0, " / | \\ ");
|
|
||||||
Sprintf(buf, " %c %c %c", Cmd.move_SW, Cmd.move_S,
|
|
||||||
Cmd.move_SE);
|
|
||||||
putstr(win, 0, buf);
|
|
||||||
};
|
|
||||||
putstr(win, 0, "");
|
putstr(win, 0, "");
|
||||||
putstr(win, 0, " < up");
|
putstr(win, 0, " < up");
|
||||||
putstr(win, 0, " > down");
|
putstr(win, 0, " > down");
|
||||||
|
|||||||
Reference in New Issue
Block a user