Change repeat into extended command

This commit is contained in:
Pasi Kallinen
2022-01-17 17:13:59 +02:00
parent a0f222fe66
commit 2e144e814d
8 changed files with 31 additions and 43 deletions

View File

@@ -829,9 +829,7 @@ NetHackQtMainWindow::NetHackQtMainWindow(NetHackQtKeyBuffer& ks) :
QSignalMapper* sm = new QSignalMapper(this);
connect(sm, SIGNAL(mapped(const QString&)),
this, SLOT(doKeys(const QString&)));
// 'donull' is a placeholder here; AddToolButton() will fix it up;
// button will be omitted if DOAGAIN is bound to '\0'
AddToolButton(toolbar, sm, "Again", donull, QPixmap(again_xpm));
AddToolButton(toolbar, sm, "Again", do_repeat, QPixmap(again_xpm));
// this used to be called "Get" which is confusing to experienced players
AddToolButton(toolbar, sm, "Pick up", dopickup, QPixmap(pickup_xpm));
AddToolButton(toolbar, sm, "Drop", doddrop, QPixmap(drop_xpm));
@@ -927,11 +925,7 @@ void NetHackQtMainWindow::AddToolButton(QToolBar *toolbar, QSignalMapper *sm,
char actchar[2];
uchar key;
// the ^A command is just a keystroke, not a full blown command function
if (!strcmp(name, "Again")) {
key = ::g.Cmd.spkeys[NHKF_DOAGAIN];
} else
key = (uchar) cmd_from_func(func);
key = (uchar) cmd_from_func(func);
// if key is valid, add a button for it; otherwise omit the command
// (won't work as intended if a different command is bound to same key)