diff --git a/win/Qt/qt_glyph.cpp b/win/Qt/qt_glyph.cpp index 06647638d..75bc234d9 100644 --- a/win/Qt/qt_glyph.cpp +++ b/win/Qt/qt_glyph.cpp @@ -44,6 +44,7 @@ NetHackQtGlyphs::NetHackQtGlyphs() char cbuf[BUFSZ]; const char *tile_file = NULL, *tile_list[2]; + this->no_tiles = false; tiles_per_row = TILES_PER_ROW; if (user_tiles) { @@ -77,9 +78,14 @@ NetHackQtGlyphs::NetHackQtGlyphs() } if (!tilesok) { + this->no_tiles = true; + /* tiles wouldn't load so force ascii map */ ::iflags.wc_ascii_map = 1; ::iflags.wc_tiled_map = 0; - tiles_per_row = 40; // arbitrary + /* tiles wouldn't load so don't allow toggling to tiled map */ + ::set_wc_option_mod_status(WC_ASCII_MAP | WC_TILED_MAP, + ::set_in_config); + tiles_per_row = 40; // arbitrary to avoid potential divide-by-0 } if (iflags.wc_tile_width) diff --git a/win/Qt/qt_glyph.h b/win/Qt/qt_glyph.h index 2842d2d14..c00a11214 100644 --- a/win/Qt/qt_glyph.h +++ b/win/Qt/qt_glyph.h @@ -16,6 +16,8 @@ enum border_code { class NetHackQtGlyphs { public: + bool no_tiles; + NetHackQtGlyphs(); int width() const { return size.width(); } diff --git a/win/Qt/qt_inv.cpp b/win/Qt/qt_inv.cpp index 50f17f47c..53a32ac70 100644 --- a/win/Qt/qt_inv.cpp +++ b/win/Qt/qt_inv.cpp @@ -176,7 +176,8 @@ void NetHackQtInvUsageWindow::paintEvent(QPaintEvent*) // Actually indexed by grid[column][row]. #ifdef ENHANCED_PAPERDOLL - if (iflags.wc_ascii_map) + if (qt_settings->doll_is_shown && ::iflags.wc_ascii_map + && qt_settings->glyphs().no_tiles) qt_settings->doll_is_shown = false; if (!qt_settings->doll_is_shown) return; @@ -185,7 +186,7 @@ void NetHackQtInvUsageWindow::paintEvent(QPaintEvent*) qt_settings->dollHeight); /* for drawWorn()'s use of obj->invlet */ - if (!flags.invlet_constant) + if (!::flags.invlet_constant) reassign(); #endif diff --git a/win/Qt/qt_set.cpp b/win/Qt/qt_set.cpp index 2f6655417..4703839f5 100644 --- a/win/Qt/qt_set.cpp +++ b/win/Qt/qt_set.cpp @@ -136,17 +136,28 @@ NetHackQtSettings::NetHackQtSettings() : } theglyphs=new NetHackQtGlyphs(); - resizeTiles(); + if (!theglyphs->no_tiles) { + resizeTiles(); - connect(&whichsize, SIGNAL(toggled(bool)), this, SLOT(setGlyphSize(bool))); - connect(&tilewidth, SIGNAL(valueChanged(int)), this, SLOT(resizeTiles())); - connect(&tileheight, SIGNAL(valueChanged(int)), this, SLOT(resizeTiles())); + connect(&whichsize, SIGNAL(toggled(bool)), this, + SLOT(setGlyphSize(bool))); + connect(&tilewidth, SIGNAL(valueChanged(int)), this, + SLOT(resizeTiles())); + connect(&tileheight, SIGNAL(valueChanged(int)), this, + SLOT(resizeTiles())); #ifdef ENHANCED_PAPERDOLL - connect(&dollshown, SIGNAL(toggled(bool)), this, SLOT(setDollShown(bool))); - connect(&dollwidth, SIGNAL(valueChanged(int)), this, SLOT(resizeDoll())); - connect(&dollheight, SIGNAL(valueChanged(int)), this, SLOT(resizeDoll())); + connect(&dollshown, SIGNAL(toggled(bool)), this, + SLOT(setDollShown(bool))); + connect(&dollwidth, SIGNAL(valueChanged(int)), this, + SLOT(resizeDoll())); + connect(&dollheight, SIGNAL(valueChanged(int)), this, + SLOT(resizeDoll())); #endif + } else { + // paper doll requires map tiles and those just failed to load + doll_is_shown = false; + } fontsize.setMinimumContentsLength((int) strlen("Medium")); fontsize.addItem("Huge");