Qt without tiles

Qt is capable of using an ascii map, and does so on the rogue level.
So failing to load tiles doesn't need to quit; it can continue in
text mode.

Not extensively tested.  This disables the paper doll when the ascii
map is forced (either via options settings or due to tiles loading
failure, but not when simply on the rogue level) rather than trying
to display it with object class characters.
This commit is contained in:
PatR
2020-08-17 16:42:24 -07:00
parent 0438dfe5a3
commit ae4c180cf6
4 changed files with 24 additions and 10 deletions

View File

@@ -85,6 +85,8 @@ void NetHackQtInvUsageWindow::paintEvent(QPaintEvent*)
// show leash-in-use on lower left side
#ifdef ENHANCED_PAPERDOLL
if (iflags.wc_ascii_map)
qt_settings->doll_is_shown = false;
if (!qt_settings->doll_is_shown)
return;
qt_settings->glyphs().setSize(qt_settings->dollWidth,
@@ -144,13 +146,17 @@ QSize NetHackQtInvUsageWindow::sizeHint(void) const
// 1+X+1: one pixel border surrounding each tile in the paper doll,
// so +1 left and +1 right, also +1 above and +1 below
#ifdef ENHANCED_PAPERDOLL
if (iflags.wc_ascii_map)
qt_settings->doll_is_shown = false;
if (qt_settings->doll_is_shown) {
w = (1 + qt_settings->dollWidth + 1) * 3;
h = (1 + qt_settings->dollHeight + 1) * 6;
}
#else
w = (1 + qt_settings->glyphs().width() + 1) * 3;
h = (1 + qt_settings->glyphs().height() + 1) * 6;
if (iflags.wc_tiles_map) {
w = (1 + qt_settings->glyphs().width() + 1) * 3;
h = (1 + qt_settings->glyphs().height() + 1) * 6;
}
#endif
return QSize(w, h);
} else {