For Qt's pick-an-exetended-command dialog, allow a player to toggle the grid layout from column-oriented to row-oriented and vice versa and when in wizard mode to cycle the set of shown (and typable) commands from 'all' to 'normal mode-only' to 'wizard mode-only' back to 'all'. The most recent values are saved by Qt along with tile size, font size, and some other stuff. The extended command dialog has a Reset button to force them (the two extended command values) back to their defaults. The dialog layout has a slight change to conserve screen space as well as three additional control buttons: Was Now | [ Cancel ] | [Cancel] [Filter][Layout][Reset ] |# |# Grid Title | Grid title | [cmd 1] [cmd R+1] [cmd 2*R+1] ... | [cmd 1] [cmd R+1] [cmd 2*R+1] ... | [cmd 2] [cmd R+2] | [cmd 2] [cmd R+2] |... |... | [cmd R] [cmd 2*R] | [cmd R] [cmd 2*R] '#' is the prompt where typed text gets echoed and 'R' is the number of rows in the grid and varies by the set of commands from the current filter. Grid dimensions have been adjusted: 'all' is 13x9, 'normal' is 13x7, and 'wizard' is 7x4 or 4x7 depending on layout orientation. The wizard mode-only filter setting probably isn't very useful because you can only type--or click on--commands which are visible. So when set to wizard mode-only, you can't #quit for instance. (Via extended command; there are still menu choices for that particular action. And it's trivial to change filter.)
95 lines
1.9 KiB
C++
95 lines
1.9 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
|
|
bool xcmd_by_row = false;
|
|
int xcmd_set = 0; // all_cmds
|
|
|
|
// dialog box for Qt-specific settings
|
|
NetHackQtSettings();
|
|
|
|
void updateXcmd(bool by_row, int which_set);
|
|
|
|
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
|