Files
nethack/win/Qt/qt_main.h
PatR 9a866d3601 Qt "Paper Doll" inventory
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.)
2020-08-15 19:48:33 -07:00

100 lines
2.3 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_main.h -- the main window
#ifndef QT4MAIN_H
#define QT4MAIN_H
#ifdef KDE
#include <kapp.h>
#include <ktopwidget.h>
#else
#include "qt_kde0.h"
#endif
namespace nethack_qt_ {
class NetHackQtInvUsageWindow;
class NetHackQtKeyBuffer;
class NetHackQtMapWindow2;
class NetHackQtMessageWindow;
class NetHackQtStatusWindow;
class NetHackQtWindow;
// This class is the main widget for NetHack
//
// It is a collection of Message, Map, and Status windows. In the current
// version of nethack there is only one of each, and this class makes this
// assumption, not showing itself until all are inserted.
//
// This class simply knows how to layout such children sensibly.
//
// Since it is only responsible for layout, the class does not
// note the actual class of the windows.
//
class NetHackQtMainWindow : public KTopLevelWidget {
Q_OBJECT
public:
NetHackQtMainWindow(NetHackQtKeyBuffer&);
void AddMessageWindow(NetHackQtMessageWindow* window);
NetHackQtMessageWindow * GetMessageWindow();
void AddMapWindow(NetHackQtMapWindow2* window);
void AddStatusWindow(NetHackQtStatusWindow* window);
void RemoveWindow(NetHackQtWindow* window);
void updateInventory();
void fadeHighlighting();
// this is unconditional in case qt_main.h comes before qt_set.h
void resizePaperDoll(bool); // ENHANCED_PAPERDOLL
public slots:
void doMenuItem(QAction *);
void doQtSettings(bool);
void doAbout(bool);
void doQuit(bool);
//RLC void doGuidebook(bool);
void doKeys(const QString&);
protected:
virtual void resizeEvent(QResizeEvent*);
virtual void keyPressEvent(QKeyEvent*);
virtual void keyReleaseEvent(QKeyEvent* event);
virtual void closeEvent(QCloseEvent*);
private slots:
void layout();
void raiseMap();
void zoomMap();
void raiseMessages();
void raiseStatus();
private:
void ShowIfReady();
#ifdef KDE
KMenuBar* menubar;
#else
QMenuBar* menubar;
#endif
NetHackQtMessageWindow* message;
NetHackQtMapWindow2* map;
NetHackQtStatusWindow* status;
NetHackQtInvUsageWindow* invusage;
QSplitter *hsplitter;
QSplitter *vsplitter;
NetHackQtKeyBuffer& keysink;
QStackedWidget* stack;
int dirkey;
};
} // namespace nethack_qt_
#endif