Qt extended commands: menu teardown and rebuild

Change qt_get_ext_cmd() to handle calling the extended command
selection menu again after player clicks on Filter/Layout/Reset
instead of relying on the core to do that.  (In order to change
the menu, instead of attempting to reconfigure that on the fly
it returns to caller and then puts up a new menu with different
settings when called back.  Initial checkin relied on the core
for the call back; this maintains full control for that within
the Qt interface code.)
This commit is contained in:
PatR
2020-12-07 01:05:37 -08:00
parent 13359648dd
commit 123b6c38a6
2 changed files with 20 additions and 11 deletions

View File

@@ -790,10 +790,17 @@ void NetHackQtBind::qt_getlin(const char *prompt, char *line)
NetHackQtBind::qt_clear_nhwindow(WIN_MESSAGE);
}
// User has typed '#' to begin entering an extended command; core calls us.
int NetHackQtBind::qt_get_ext_cmd()
{
NetHackQtExtCmdRequestor requestor(mainWidget());
return requestor.get();
NetHackQtExtCmdRequestor *xcmd;
int result;
do {
xcmd = new NetHackQtExtCmdRequestor(mainWidget());
result = xcmd->get();
delete xcmd;
} while (result == xcmdNoMatch);
return result;
}
void NetHackQtBind::qt_number_pad(int)