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

@@ -196,6 +196,9 @@ NetHackQtSettings::NetHackQtSettings() :
NetHackQtGlyphs& NetHackQtSettings::glyphs()
{
// Caveat:
// 'theglyphs' will be Null if the tiles file couldn't be loaded;
// the game can still procede with an ascii map in that situation.
return *theglyphs;
}
@@ -213,8 +216,10 @@ void NetHackQtSettings::resizeTiles()
settings.setValue("tilewidth", tileWidth);
settings.setValue("tileheight", tileHeight);
theglyphs->setSize(tileWidth, tileHeight);
emit tilesChanged();
if (theglyphs) {
theglyphs->setSize(tileWidth, tileHeight);
emit tilesChanged();
}
}
void NetHackQtSettings::toggleGlyphSize()