revamped curses status display
I've overhauled the status display for curses. Horizontal layout supports both 2 lines and 3 lines which can be changed dynamically via using 'O' to set 'statuslines'. Fields are spread out a little more than they used to be, making it more readable--at least to me-- but the extra spaces get squeezed out when lines become too long. If 'showexp' is on and either conditions or hunger+encumbrance go off the right edge, experience points are suppressed (but the option is left on, so they'll come back once there is room). For traditional 2-line hozizontal status, if hunger+encumbrance+ conditions go off the right edge even after experience points are knocked out, there will be a '+' in the rightmost column if there are any conditions that are all the way off. At present it doesn't use the tty method of switching to abbreviated condition names to reduce their legnth. I'll probably tackle that eventually if no one beats me to it. For 3-line horizonal status, there was an older implementation (but disabled via #if 0) with gold and score moving to the third line. (I'm not sure how status conditions were handled.) This one ignored that and modified 2-line from scratch, moving alignment from line one to line 2 and level description, time, and conditions from line 2 to line 3. It looks like this (view with a fixed-width font...). Wizard the Hatamoto St:16 Dx:15 Co:18 In:8 Wi:11 Ch:7 S:25 Lawful $:21 HP:25(25) Pw:6(6) AC:4 Xp:2/21 Hungry Burdened Dlvl:1 T:36 Blind Lev Score is actually right aligned with the edge but I've deleted several spaces to keep the line shorter here. The status conditions line up with the hunger slot as that shifts due to changes in gold/HP/power/AC/ experience, and conditions prefer that column even when hunger and/or encumbrance are blank. Howver, if the number of conditions increase to the point where they would go off the edge, the whole list shifts left instead of trying to stay lined up with hunger. (It's just coincidence that the lefthand parts of lines 2 and 3 seem to line up in this sample. In general, they don't.) The vertical layout has reordered most of the fields and now has a few blank lines to separate those fields into some groups for readability. Lines have the form of Field-name : Value and when highlights apply, now they only affect the value portion. Single digit characteristics are padded with a leading space so that all six of them line up (for "18/xx", "/xx" protrudes to the right). HP and Pw are aligned with each other. Hunger and encumbrance share a line. When there are more than three conditions, they're shown three per line instead of wrapping across lines. And if too many lines are present, it will squeeze out enough blank ones to fit. To see the vertical status, you need a display size of at least 106 columns with 'windowborders' explicitly off, or 110 with them on; also set option 'align_status' to 'right' or 'left'. (With borders on, including the default 'auto' setting, the vertical status appears at width of 108 columns, but does so by hiding 2 columns of the map; using 110 columns avoids that.) Resizing from outside the game or changing align_status via 'O' both cause dynamic reconfiguration of the layout; there's no need to save, make config changes, then restore.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
$NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.279 $ $NHDT-Date: 1553296396 2019/03/22 23:13:16 $
|
||||
$NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.280 $ $NHDT-Date: 1553387147 2019/03/24 00:25:47 $
|
||||
|
||||
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,
|
||||
@@ -632,6 +632,9 @@ in wizard mode, ^T can be preceded by 'm' prefix in order to test teleporting
|
||||
include isaac64 for pseudo random number generation
|
||||
core prng and display prng use different contexts
|
||||
when healing magic other than unicorn horn cures blindness, cure deafness too
|
||||
curses: status display substantially revamped for both horizontal (via
|
||||
'align_status:bottom' or 'top') and vertical (via 'align_status:left'
|
||||
or 'right'); 3-line horizontal layout (via 'statuslines:3') added
|
||||
|
||||
|
||||
NetHack Community Patches (or Variation) Included
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 botl.h $NHDT-Date: 1526907469 2018/05/21 12:57:49 $ $NHDT-Branch: NetHack-3.6.2 $:$NHDT-Revision: 1.19 $ */
|
||||
/* NetHack 3.6 botl.h $NHDT-Date: 1553387147 2019/03/24 00:25:47 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.23 $ */
|
||||
/* Copyright (c) Michael Allison, 2003 */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -27,6 +27,13 @@ Astral Plane \GXXXXNNNN:123456 HP:1234(1234) Pw:1234(1234) AC:-127
|
||||
#define MAXCO (COLNO + 40)
|
||||
#endif
|
||||
|
||||
#ifdef STATUS_HILITES
|
||||
struct condmap {
|
||||
const char *id;
|
||||
unsigned long bitmask;
|
||||
};
|
||||
#endif
|
||||
|
||||
enum statusfields {
|
||||
BL_CHARACTERISTICS = -3, /* alias for BL_STR..BL_CH */
|
||||
BL_RESET = -2, /* Force everything to redisplay */
|
||||
@@ -36,7 +43,7 @@ enum statusfields {
|
||||
BL_ALIGN, BL_SCORE, BL_CAP, BL_GOLD, BL_ENE, BL_ENEMAX, /* 7..12 */
|
||||
BL_XP, BL_AC, BL_HD, BL_TIME, BL_HUNGER, BL_HP, /* 13..18 */
|
||||
BL_HPMAX, BL_LEVELDESC, BL_EXP, BL_CONDITION, /* 19..22 */
|
||||
MAXBLSTATS
|
||||
MAXBLSTATS /* [23] */
|
||||
};
|
||||
|
||||
enum relationships { NO_LTEQGT = -1,
|
||||
|
||||
12
src/botl.c
12
src/botl.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 botl.c $NHDT-Date: 1553217909 2019/03/22 01:25:09 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.136 $ */
|
||||
/* NetHack 3.6 botl.c $NHDT-Date: 1553387148 2019/03/24 00:25:48 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.137 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Michael Allison, 2006. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -411,11 +411,6 @@ struct hilite_s {
|
||||
int coloridx;
|
||||
struct hilite_s *next;
|
||||
};
|
||||
|
||||
struct condmap {
|
||||
const char *id;
|
||||
unsigned long bitmask;
|
||||
};
|
||||
#endif /* STATUS_HILITES */
|
||||
|
||||
struct istat_s {
|
||||
@@ -555,7 +550,7 @@ bot_via_windowport()
|
||||
Strcpy(nb = buf, plname);
|
||||
nb[0] = highc(nb[0]);
|
||||
nb[10] = '\0';
|
||||
Sprintf(nb = eos(nb), " the ");
|
||||
Strcpy(nb = eos(nb), " the ");
|
||||
if (Upolyd) {
|
||||
for (i = 0, nb = strcpy(eos(nb), mons[u.umonnum].mname); nb[i]; i++)
|
||||
if (i == 0 || nb[i - 1] == ' ')
|
||||
@@ -834,7 +829,8 @@ boolean *valsetlist;
|
||||
if (context.botlx && (windowprocs.wincap2 & WC2_RESET_STATUS) != 0L)
|
||||
status_update(BL_RESET, (genericptr_t) 0, 0, 0,
|
||||
NO_COLOR, &cond_hilites[0]);
|
||||
else if ((windowprocs.wincap2 & WC2_FLUSH_STATUS) != 0L)
|
||||
else if ((updated || context.botlx) &&
|
||||
(windowprocs.wincap2 & WC2_FLUSH_STATUS) != 0L)
|
||||
status_update(BL_FLUSH, (genericptr_t) 0, 0, 0,
|
||||
NO_COLOR, &cond_hilites[0]);
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user