more curses get_count
A couple of formatting bits I made when investigating cursor positioning misbehavior for curses menu counts. No change in behavior here.
This commit is contained in:
12
src/cmd.c
12
src/cmd.c
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.7 cmd.c $NHDT-Date: 1642630919 2022/01/19 22:21:59 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.500 $ */
|
/* NetHack 3.7 cmd.c $NHDT-Date: 1644610344 2022/02/11 20:12:24 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.519 $ */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/*-Copyright (c) Robert Patrick Rankin, 2013. */
|
/*-Copyright (c) Robert Patrick Rankin, 2013. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
@@ -4746,10 +4746,12 @@ click_to_cmd(int x, int y, int mod)
|
|||||||
|
|
||||||
/* gather typed digits into a number in *count; return the next non-digit */
|
/* gather typed digits into a number in *count; return the next non-digit */
|
||||||
char
|
char
|
||||||
get_count(char *allowchars, char inkey,
|
get_count(
|
||||||
long maxcount, long *count,
|
char *allowchars,
|
||||||
boolean historicmsg) /* whether to include in message
|
char inkey,
|
||||||
* history: True => yes */
|
long maxcount,
|
||||||
|
long *count,
|
||||||
|
boolean historicmsg) /* whether to include in ^P history: True => yes */
|
||||||
{
|
{
|
||||||
char qbuf[QBUFSZ];
|
char qbuf[QBUFSZ];
|
||||||
int key;
|
int key;
|
||||||
|
|||||||
@@ -326,20 +326,18 @@ curses_character_input_dialog(
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (digit(answer)) {
|
if (digit(answer) && accept_count) {
|
||||||
if (accept_count) {
|
if (answer != '0') {
|
||||||
if (answer != '0') {
|
yn_number = curses_get_count(answer);
|
||||||
yn_number = curses_get_count(answer);
|
|
||||||
|
|
||||||
if (iflags.wc_popup_dialog) {
|
if (iflags.wc_popup_dialog) {
|
||||||
curses_count_window(NULL);
|
curses_count_window(NULL);
|
||||||
touchwin(askwin);
|
touchwin(askwin);
|
||||||
wrefresh(askwin);
|
wrefresh(askwin);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
answer = '#';
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
answer = '#';
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (any_choice) {
|
if (any_choice) {
|
||||||
|
|||||||
Reference in New Issue
Block a user