Qt toolbar: add button for 'search'

The toolbar contains do-Again, Pick up, Drop, Kick, Throw, Fire,
Eat, and Rest.  Insert Search in front of Rest since it's useful
in its own right and some players prefer it even when resting.
Includes a new 12x13 icon; a tiny magnifying glass shown straight
on is something I can manage.
This commit is contained in:
PatR
2020-10-14 03:02:55 -07:00
parent 7011b10f64
commit 6a443226d1
2 changed files with 23 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.328 $ $NHDT-Date: 1602623144 2020/10/13 21:05:44 $
NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.329 $ $NHDT-Date: 1602669770 2020/10/14 10:02:50 $
General Fixes and Modified Features
-----------------------------------
@@ -442,7 +442,7 @@ Qt: for menu search, don't require clicking on the search target popup before
Qt: rest ("Zz") button on the toolbar only worked when 'rest_on_space' was On
(core issue, not Qt's fault)
Qt: rename toolbar button "Get" and action menu choice "Get" to "Pick up"
Qt+QSX: fix control key
Qt+OSX: fix control key
Qt+OSX: rename menu entry "nethack->Preferences..." for invoking nethack's
'O' command to "Game->Run-time options" and entry "Game->Qt settings"
for making persistent Qt customizations to "nethack->Preferences..."
@@ -579,6 +579,7 @@ 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)
Qt: clicking on the status window runs the #attributes command (^X)
Qt: add a Search button to the toolbar
NetHack Community Patches (or Variation) Included

View File

@@ -352,6 +352,25 @@ static const char * eat_xpm[] = {
" oo oo ",
" oo oo "};
/* XPM */
static const char * search_xpm[] = {
"12 13 3 1",
" c None",
". c #FFFFFFFF0000",
"X c #7F0000000000",
" ",
" XXXXX ",
" X ... X ",
" X.....X ",
" X.....X ",
" X ... X ",
" XXXXX ",
" X ",
" X ",
" X ",
" X ",
" X ",
" "};
/* XPM */
static const char * rest_xpm[] = {
"12 13 2 1",
" c None",
@@ -777,6 +796,7 @@ NetHackQtMainWindow::NetHackQtMainWindow(NetHackQtKeyBuffer& ks) :
AddToolButton(toolbar, sm, "Throw", dothrow, QPixmap(throw_xpm));
AddToolButton(toolbar, sm, "Fire", dofire, QPixmap(fire_xpm));
AddToolButton(toolbar, sm, "Eat", doeat, QPixmap(eat_xpm));
AddToolButton(toolbar, sm, "Search", dosearch, QPixmap(search_xpm));
AddToolButton(toolbar, sm, "Rest", donull, QPixmap(rest_xpm));
connect(game, SIGNAL(triggered(QAction *)),