-NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.352 $ $NHDT-Date: 1605315160 2020/11/14 00:52:40 $
+NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.353 $ $NHDT-Date: 1605316497 2020/11/14 01:14:57 $
General Fixes and Modified Features
-----------------------------------
curses: 'msg_window' option wasn't functional for curses unless the binary
also included tty support
+Qt: at Xp levels above 20 with 'showexp' On, the combined status field
+ "Level:NN/nnnnnnnn" was too big and truncated by a char at each end
tty: redraw unexplored locations as S_unexplored rather than <space> after
map has been partially overwritten by popup menu or text display
tty: previous change resulted in remnants of previous level being shown on
// call resizePaperDoll() indirectly...
qt_settings->resizeDoll();
#endif
+ // reset widths
+ int w = width(); /* of main window */
+ // 10: approximate size of resizing hotspots
+ int d = qt_settings->doll_is_shown ? 10 + invusage->width() + 10 : 10;
+ if (d % 4)
+ d += 4 - d % 4;
+ splittersizes[2] = w / 2 - (d * 1 / 4); // status
+ splittersizes[1] = d - 10; // invusage
+ splittersizes[0] = w / 2 - (d * 3 / 4); // messages
+ hsplitter->setSizes(splittersizes);
}
}
hsplitter->setSizes(hsplittersizes);
}
- // Height limit is 48 pixels per doll cell;
- // values greater than 44 need taller window which pushes the map down.
+ // Height limit is 48+2 pixels per doll cell plus 1 pixel margin at top;
+ // values greater than 42+2 need taller window which pushes the map down.
// FIXME: this doesn't shrink the window back if size is reduced from 45+
int oldheight = vsplittersizes[0],
newheight = w->height();
// NetHack may be freely redistributed. See license for details.
// qt_stat.cpp -- status window, upper right portion of the overall window
+//
+// The Qt status window consists of many lines:
+//
+// hitpoint bar (when enabled)
+// Title (plname the Rank or plname the MonsterSpecies)
+// Dungeon location (branch and level)
+// separator line
+// six icons (special 40x40 tiles, paired with...)
+// six characteristic texts ("Str:18/03", "Dex:15", &c)
+// separator line
+// five status fields without icons (some containing two values:
+// Gold, HP/HPmax, Energy/Enmax, AC, XpLevel/ExpPoints or HD)
+// optional line with two text fields (Time:1234, Score:89)
+// separator line
+// varying number of icons (one or more, each paired with...)
+// corresponding text (Alignment plus zero or more status conditions
+// including Hunger if not "normal" and encumbrance if not "normal")
+//
+// The hitpoint bar spans the width of the status window when enabled.
+// Title and location are centered.
+// The icons and text for the size characteristics are evenly spaced.
+// The five main stats are padded with an empty sixth and spaced to
+// match the characteristics.
+// Time and Score are spaced as if each were three fields wide.
+// Icons and texts for alignment and conditions are left justified.
+// The separator lines are thin and don't take up much vertical space.
+// The hitpoint bar line and the Time+Score line are omitted when the
+// corresponding items are disabled.
+//
+// FIXME:
+// When hitpoint bar is shown, attempting to resize horizontally won't
+// do anything. Toggling it off, then resizing, and back On works.
+//
+// TODO:
+// If/when status conditions become too wide for the status window, scale
+// down their icons and switch their text to a smaller font to match.
+//
extern "C" {
#include "hack.h"
extern const char *enc_stat[]; /* from botl.c */
extern const char *hu_stat[]; /* from eat.c */
+extern int qt_compact_mode;
+
namespace nethack_qt_ {
NetHackQtStatusWindow::NetHackQtStatusWindow() :
first_set(true),
alreadyfullhp(false)
{
+ if (!qt_compact_mode) {
+ int w = NetHackQtBind::mainWidget()->width();
+ setMaximumWidth(w / 2);
+ }
+
p_str = QPixmap(str_xpm);
p_str = QPixmap(str_xpm);
p_dex = QPixmap(dex_xpm);
// up/down highlighting becomes tricky--don't try very hard
if (::flags.showexp) {
buf.sprintf("%ld/%ld", (long) u.ulevel, (long) u.uexp);
- level.setLabel("Level:" + buf,
+ // at levels above 20, "Level:NN/nnnnnnnn" doesn't fit so
+ // shorten "Level" to "Lvl" at that stage;
+ // at level 30, a few pixels are truncated from the start
+ // and end of "Lvl:30/nnnnnnnnn" but the result is ledgible
+ level.setLabel(((u.ulevel <= 20) ? "Level:" : "Lvl:") + buf,
NetHackQtLabelledIcon::NoNum, (long) u.uexp);
} else {
level.setLabel("Level:", (long) u.ulevel);