Enhance the "Qt Settings" dialog box to provide control over the paper doll subset of inventory displayed between the message and status windows (above the map). A ton of flailing about for a fairly small but useful change in functionality. Old dialog (no title): | [ ] Zoomed -- check box | "Width:" [ ] -- number entry spinner | "Height:" [ ] -- ditto | "Font:" [ ] -- Huge:18pt, Large:14, Medium:12, Small:10, Tiny:8 | [ Dismiss ] -- button New dialog: | "Qt NetHack Settings" | | "Map:" [ ] "Zoomed" -- check box | "Tile Width" [ ] -- number entry spinner | "Tile Height" [ ] -- ditto | "Invent:" [ ] "Shown" -- check box | "Doll Width" [ ] -- number entry spinner | "Doll Height" [ ] -- ditto | "Font:" [ ] -- Huge:18pt, Large:14, Medium:12, Small:10, Tiny:8 | [ Dismiss ] -- button The inventory subset can now be suppressed. When shown (the default), its size can be set independently of the map tiles' size. I've set the default to be 32x32 tiles instead of 16x16 used for the map. The settings are saved and restored automatically by Qt, and persist not just across save/restore cycles but into new games. (That's not a change, just a reminder.)
90 lines
1.8 KiB
C++
90 lines
1.8 KiB
C++
// Copyright (c) Warwick Allison, 1999.
|
|
// Qt4 conversion copyright (c) Ray Chason, 2012-2014.
|
|
// NetHack may be freely redistributed. See license for details.
|
|
|
|
// qt_set.h -- the Qt settings
|
|
|
|
#ifndef QT4SET_H
|
|
#define QT4SET_H
|
|
|
|
#define ENHANCED_PAPERDOLL /* separate size from map tiles, can be hidden */
|
|
|
|
#include "qt_bind.h" // needed for mainWidget() for updateInventory()
|
|
|
|
namespace nethack_qt_ {
|
|
|
|
class NetHackQtGlyphs;
|
|
class NetHackQtMainWindow;
|
|
|
|
class NetHackQtSettings : public QDialog {
|
|
Q_OBJECT
|
|
public:
|
|
int tileWidth = 16, tileHeight = 16;
|
|
#ifdef ENHANCED_PAPERDOLL
|
|
int dollWidth = 32, dollHeight = 32;
|
|
bool doll_is_shown = true;
|
|
#endif
|
|
// dialog box for Qt-specific settings
|
|
NetHackQtSettings();
|
|
|
|
NetHackQtGlyphs& glyphs();
|
|
const QFont& normalFont();
|
|
const QFont& normalFixedFont();
|
|
const QFont& largeFont();
|
|
|
|
bool ynInMessages();
|
|
|
|
signals:
|
|
void fontChanged();
|
|
void tilesChanged();
|
|
|
|
public slots:
|
|
void toggleGlyphSize();
|
|
void setGlyphSize(bool);
|
|
#ifdef ENHANCED_PAPERDOLL
|
|
void toggleDollShown();
|
|
void setDollShown(bool);
|
|
void resizeDoll();
|
|
#endif
|
|
|
|
private:
|
|
QSettings settings;
|
|
|
|
QCheckBox whichsize;
|
|
QSpinBox tilewidth;
|
|
QSpinBox tileheight;
|
|
QLabel widthlbl;
|
|
QLabel heightlbl;
|
|
QSize othersize;
|
|
#ifdef ENHANCED_PAPERDOLL
|
|
QCheckBox dollshown;
|
|
QSpinBox dollwidth;
|
|
QSpinBox dollheight;
|
|
QLabel dollwidthlbl;
|
|
QLabel dollheightlbl;
|
|
#endif
|
|
|
|
QComboBox fontsize;
|
|
|
|
QFont normal, normalfixed, large;
|
|
|
|
NetHackQtGlyphs* theglyphs;
|
|
#if 0
|
|
void updateInventory()
|
|
{
|
|
static_cast <NetHackQtMainWindow *> (NetHackQtBind::mainWidget())
|
|
->updateInventory();
|
|
}
|
|
#endif
|
|
|
|
private slots:
|
|
void resizeTiles();
|
|
void changedFont();
|
|
};
|
|
|
|
extern NetHackQtSettings* qt_settings;
|
|
|
|
} // namespace nethack_qt_
|
|
|
|
#endif
|