From 3d4164bcce59fea52e9f6207d1540964d1d6d331 Mon Sep 17 00:00:00 2001 From: PatR Date: Fri, 15 Mar 2019 01:12:59 -0700 Subject: [PATCH 1/3] curses STATUS_HILITES Honor hilite_status rules specifying color even if curses-specific option 'guicolor' is off. Update status from scratch when 'O' is used to manipulate hilite_status rules. --- doc/fixes36.2 | 4 +++- win/curses/cursmain.c | 3 +++ win/curses/cursmisc.c | 5 ++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/doc/fixes36.2 b/doc/fixes36.2 index e71bfd09a..593ed02d2 100644 --- a/doc/fixes36.2 +++ b/doc/fixes36.2 @@ -1,4 +1,4 @@ -$NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.274 $ $NHDT-Date: 1552521022 2019/03/13 23:50:22 $ +$NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.275 $ $NHDT-Date: 1552637574 2019/03/15 08:12:54 $ This fixes36.2 file is here to capture information about updates in the 3.6.x lineage following the release of 3.6.1 in April 2018. Please note, however, @@ -479,6 +479,8 @@ curses: when getting multi-character responses from player, support to core if ESC is typed when there is no input entered curses: extend preceding support to typing of extended command names curses: support hilite_pet and hilite_pile even when color is disabled +curses: support color hilite_status rules even if 'guicolor' is off +curses: update status if 'O' is used to add/change/remove hilite_status rules vms: add compile of isaac64.c to Makefile.src and vmsbuild.com diff --git a/win/curses/cursmain.c b/win/curses/cursmain.c index db7cc4aed..f357fe84c 100644 --- a/win/curses/cursmain.c +++ b/win/curses/cursmain.c @@ -850,6 +850,9 @@ preference_update(preference) void curses_preference_update(const char *pref) { + if (!strcmp(pref, "hilite_status") || !strcmp(pref, "align_status")) + status_initialize(REASSESS_ONLY); + if (!strcmp(pref, "align_status") || !strcmp(pref, "align_message")) { curses_create_main_windows(); diff --git a/win/curses/cursmisc.c b/win/curses/cursmisc.c index e8a829996..b11083b0c 100644 --- a/win/curses/cursmisc.c +++ b/win/curses/cursmisc.c @@ -87,7 +87,10 @@ curses_toggle_color_attr(WINDOW *win, int color, int attr, int onoff) int curses_color; /* if color is disabled, just show attribute */ - if ((win == mapwin) ? !iflags.wc_color : !iflags.wc2_guicolor) { + if ((win == mapwin) ? !iflags.wc_color + /* statuswin is for #if STATUS_HILITES + but doesn't need to be conditional */ + : !(iflags.wc2_guicolor || win == statuswin)) { #endif if (attr != NONE) { if (onoff == ON) From ed55fa23f6f4ba478b8fd67651d287fb655d43d8 Mon Sep 17 00:00:00 2001 From: PatR Date: Fri, 15 Mar 2019 01:45:10 -0700 Subject: [PATCH 2/3] hacklib.c tidbit Describe 'trimspaces()' more accurately. --- src/hacklib.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/hacklib.c b/src/hacklib.c index 9a083e2fc..7cf5a47c6 100644 --- a/src/hacklib.c +++ b/src/hacklib.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 hacklib.c $NHDT-Date: 1518922474 2018/02/18 02:54:34 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.54 $ */ +/* NetHack 3.6 hacklib.c $NHDT-Date: 1552639487 2019/03/15 08:44:47 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.67 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Michael Allison, 2007. */ /* Copyright (c) Robert Patrick Rankin, 1991 */ @@ -170,13 +170,14 @@ char *bp; return bp; } -/* remove leading and trailing whitespace, in place */ -char* +/* skip leading whitespace; remove trailing whitespace, in place */ +char * trimspaces(txt) -char* txt; +char *txt; { - char* end; + char *end; + /* leading whitespace will remain in the buffer */ while (*txt == ' ' || *txt == '\t') txt++; end = eos(txt); From 9d67cd15970d06107d5d823141eb44e8e1a287b1 Mon Sep 17 00:00:00 2001 From: PatR Date: Fri, 15 Mar 2019 17:51:39 -0700 Subject: [PATCH 3/3] status lines' "End Game" Change the generic status line location "End Game" to relevant element name "Earth", "Air", &c. ("Plane of " might be too long if hungry and encumbered and afflicted by conditions. "Astral Plane" is already specific so not affected.) --- doc/fixes36.2 | 4 +++- src/botl.c | 15 +++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/doc/fixes36.2 b/doc/fixes36.2 index 593ed02d2..a0297e8a5 100644 --- a/doc/fixes36.2 +++ b/doc/fixes36.2 @@ -1,4 +1,4 @@ -$NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.275 $ $NHDT-Date: 1552637574 2019/03/15 08:12:54 $ +$NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.276 $ $NHDT-Date: 1552697495 2019/03/16 00:51:35 $ This fixes36.2 file is here to capture information about updates in the 3.6.x lineage following the release of 3.6.1 in April 2018. Please note, however, @@ -392,6 +392,8 @@ if steed ate a mimic corpse and began masquerading as something, hero could kicking an object stack moves the topmost 1, but range calculation used the weight of the whole stack to decide how far it would move, possibly yielding "thump" result with no movement despite being a light item +status lines' dungeon location field in the elemental planes now shows Earth + or Air or Fire or Water instead of generic End Game Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository diff --git a/src/botl.c b/src/botl.c index e58f5c398..152503a10 100644 --- a/src/botl.c +++ b/src/botl.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 botl.c $NHDT-Date: 1549755174 2019/02/09 23:32:54 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.134 $ */ +/* NetHack 3.6 botl.c $NHDT-Date: 1552697495 2019/03/16 00:51:35 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.135 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Michael Allison, 2006. */ /* NetHack may be freely redistributed. See license for details. */ @@ -376,13 +376,16 @@ char *buf; int ret = 1; /* TODO: Add in dungeon name */ - if (Is_knox(&u.uz)) + if (Is_knox(&u.uz)) { Sprintf(buf, "%s ", dungeons[u.uz.dnum].dname); - else if (In_quest(&u.uz)) + } else if (In_quest(&u.uz)) { Sprintf(buf, "Home %d ", dunlev(&u.uz)); - else if (In_endgame(&u.uz)) - Sprintf(buf, Is_astralevel(&u.uz) ? "Astral Plane " : "End Game "); - else { + } else if (In_endgame(&u.uz)) { + /* [3.6.2: this used to be "Astral Plane" or generic "End Game"] */ + (void) endgamelevelname(buf, depth(&u.uz)); + (void) strsubst(buf, "Plane of ", ""); /* just keep */ + Strcat(buf, " "); + } else { /* ports with more room may expand this one */ Sprintf(buf, "Dlvl:%-2d ", depth(&u.uz)); ret = 0;