-NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.321 $ $NHDT-Date: 1601940384 2020/10/05 23:26:24 $
+NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.322 $ $NHDT-Date: 1602002574 2020/10/06 16:42:54 $
General Fixes and Modified Features
-----------------------------------
act on it)
Qt: the "paper doll" inventory subset can be controlled via the "Qt Settings"
dialog box ("Preferences..." on OSX)
-Qt: draw a border around each tile in the paper door inventory; when BUC is
+Qt: draw a border around each tile in the paper doll inventory; when BUC is
known for a doll item, change the border's color and thicken it
+Qt: clicking on the paper doll runs the #seeall command (inventory of wielded
+ and worn items plus tools [lamps, leashes] actively in use; in other
+ words, same set of things whose tiles are used to populate the doll)
NetHack Community Patches (or Variation) Included
#include "qt_post.h"
#include "qt_inv.h"
#include "qt_glyph.h"
+#include "qt_main.h"
#include "qt_set.h"
namespace nethack_qt_ {
if (nhobj) {
border = BORDER_DEFAULT;
+#ifdef ENHANCED_PAPERDOLL
if (Role_if('P') && !Blind)
nhobj->bknown = 1;
if (nhobj->bknown)
border = nhobj->cursed ? BORDER_CURSED
: !nhobj->blessed ? BORDER_UNCURSED
: BORDER_BLESSED;
+#endif
glyph = obj_to_glyph(nhobj, rn2_on_display_rng);
} else {
border = NO_BORDER;
h = (1 + qt_settings->dollHeight + 1) * 6;
}
#else
- if (iflags.wc_tiles_map) {
+ if (iflags.wc_tiled_map) {
w = (1 + qt_settings->glyphs().width() + 1) * 3;
h = (1 + qt_settings->glyphs().height() + 1) * 6;
}
}
}
+// ENHANCED_PAPERDOLL - clicking on the PaperDoll runs #seeall
+void NetHackQtInvUsageWindow::mousePressEvent(QMouseEvent *event UNUSED)
+{
+#ifdef ENHANCED_PAPERDOLL
+ char cmdbuf[32];
+ Strcpy(cmdbuf, "#");
+ (void) cmdname_from_func(doprinuse, &cmdbuf[1], FALSE);
+ // queue up #seeall as if user had typed it; we don't execute doprinuse()
+ // directly because the program might not be ready for the next command
+ QWidget *main = NetHackQtBind::mainWidget();
+ (static_cast <NetHackQtMainWindow *> (main))->DollClickToKeys(cmdbuf);
+#endif
+}
+
} // namespace nethack_qt_
virtual void paintEvent(QPaintEvent*);
virtual QSize sizeHint(void) const;
+protected:
+ virtual void mousePressEvent(QMouseEvent *event);
+
private:
void drawWorn(QPainter& painter, obj*, int x, int y, bool canbe=true);
};
qApp->exit();
}
+// ENHANCED_PAPERDOLL - player clicked on PaperDoll window
+void NetHackQtMainWindow::DollClickToKeys(const char *cmds)
+{
+ keysink.Put(cmds);
+ qApp->exit();
+}
+
void NetHackQtMainWindow::AddMessageWindow(NetHackQtMessageWindow* window)
{
message=window;
void fadeHighlighting(bool before_key);
- // this is unconditional in case qt_main.h comes before qt_set.h
+ // these are unconditional in case qt_main.h comes before qt_set.h
void resizePaperDoll(bool); // ENHANCED_PAPERDOLL
+ void DollClickToKeys(const char *); // ENHANCED_PAPERDOLL
public slots:
void doMenuItem(QAction *);