diff --git a/doc/fixes36.3 b/doc/fixes36.3 index c7c3be730..1dc12edd1 100644 --- a/doc/fixes36.3 +++ b/doc/fixes36.3 @@ -1,4 +1,4 @@ -$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.54 $ $NHDT-Date: 1560600663 2019/06/15 12:11:03 $ +$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.56 $ $NHDT-Date: 1560611967 2019/06/15 15:19:27 $ This fixes36.3 file is here to capture information about updates in the 3.6.x lineage following the release of 3.6.2 in May 2019. Please note, however, @@ -100,6 +100,8 @@ Platform- and/or Interface-Specific Fixes or Features EDIT_GETLIN: wizard mode 'monpolycontrol' was using the getlin() answer buffer to format the coordinate portion of the "change @ into what kind of monster?" prompt, resulting in "" as default answer +EDIT_GETLIN: when naming an object or a monster use the existing name, if + there is one, as the default answer curses: very tall menus tried to use selector characters a-z, A-Z, and 0-9, but 0-9 should be reserved for counts and if the display was tall enough for more than 62 entries, arbitrary ASCII punctuation got used @@ -132,6 +134,9 @@ tty: re-do one optimization used when status conditions have all been removed and remove another that tried to check whether condition text to be displayed next was the same as the existing value; sometimes new status condition wouldn't be shown unless a screen redraw was forced +tty: take two, if/when autodecribe feedback wraps past top line, clear + continuation lines and redraw map if needed when top line is cleared + ['exposed by git' section has an entry for reversal of 'take one'] Windows: some startup error messages were not being delivered successfully diff --git a/src/do_name.c b/src/do_name.c index 72f91b40f..0200cbba5 100644 --- a/src/do_name.c +++ b/src/do_name.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 do_name.c $NHDT-Date: 1560387831 2019/06/13 01:03:51 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.148 $ */ +/* NetHack 3.6 do_name.c $NHDT-Date: 1560611967 2019/06/15 15:19:27 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.149 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Pasi Kallinen, 2018. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1156,6 +1156,11 @@ do_mname() Sprintf(qbuf, "What do you want to call %s?", distant_monnam(mtmp, ARTICLE_THE, monnambuf)); buf[0] = '\0'; +#ifdef EDIT_GETLIN + /* if there's an existing name, make it be the default answer */ + if (has_mname(mtmp)) + Strcpy(buf, MNAME(mtmp)); +#endif getlin(qbuf, buf); if (!*buf || *buf == '\033') return; @@ -1168,6 +1173,9 @@ do_mname() * * Don't say the name is being rejected if it happens to match * the existing name. + * + * TODO: should have an alternate message when the attempt is to + * remove existing name without assigning a new one. */ if ((mtmp->data->geno & G_UNIQ) && !mtmp->ispriest) { if (!alreadynamed(mtmp, monnambuf, buf)) @@ -1194,7 +1202,7 @@ void do_oname(obj) register struct obj *obj; { - char *bufp, buf[BUFSZ] = DUMMY, bufcpy[BUFSZ], qbuf[QBUFSZ]; + char *bufp, buf[BUFSZ], bufcpy[BUFSZ], qbuf[QBUFSZ]; const char *aname; short objtyp; @@ -1207,6 +1215,12 @@ register struct obj *obj; Sprintf(qbuf, "What do you want to name %s ", is_plural(obj) ? "these" : "this"); (void) safe_qbuf(qbuf, qbuf, "?", obj, xname, simpleonames, "item"); + buf[0] = '\0'; +#ifdef EDIT_GETLIN + /* if there's an existing name, make it be the default answer */ + if (has_oname(obj)) + Strcpy(buf, ONAME(obj)); +#endif getlin(qbuf, buf); if (!*buf || *buf == '\033') return; @@ -1449,7 +1463,7 @@ void docall(obj) struct obj *obj; { - char buf[BUFSZ] = DUMMY, qbuf[QBUFSZ]; + char buf[BUFSZ], qbuf[QBUFSZ]; char **str1; if (!obj->dknown) @@ -1462,12 +1476,19 @@ struct obj *obj; else (void) safe_qbuf(qbuf, "Call ", ":", obj, docall_xname, simpleonames, "thing"); + /* pointer to old name */ + str1 = &(objects[obj->otyp].oc_uname); + buf[0] = '\0'; +#ifdef EDIT_GETLIN + /* if there's an existing name, make it be the default answer */ + if (*str1) + Strcpy(buf, *str1); +#endif getlin(qbuf, buf); if (!*buf || *buf == '\033') return; /* clear old name */ - str1 = &(objects[obj->otyp].oc_uname); if (*str1) free((genericptr_t) *str1); diff --git a/win/tty/topl.c b/win/tty/topl.c index 6d9f464ff..6af7efed0 100644 --- a/win/tty/topl.c +++ b/win/tty/topl.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 topl.c $NHDT-Date: 1560600658 2019/06/15 12:10:58 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.46 $ */ +/* NetHack 3.6 topl.c $NHDT-Date: 1560608320 2019/06/15 14:18:40 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.47 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Michael Allison, 2009. */ /* NetHack may be freely redistributed. See license for details. */ @@ -151,15 +151,16 @@ const char *str; struct WinDesc *cw = wins[WIN_MESSAGE]; if (!(cw->flags & WIN_STOP)) { + if (ttyDisplay->cury && ttyDisplay->toplin == 2) + tty_clear_nhwindow(WIN_MESSAGE); + cw->curx = cw->cury = 0; home(); cl_end(); addtopl(str); -#if 0 /* this doesn't work as intended; it disrupts multi-line prompts */ if (ttyDisplay->cury && ttyDisplay->toplin != 3) - more(); -#endif + ttyDisplay->toplin = 2; } }