MCPcopy Create free account
hub / github.com/NetHack/NetHack / Reset

Method Reset

win/Qt/qt_xcmd.cpp:415–438  ·  view source on GitHub ↗

Respond to a click on the [Reset] button

Source from the content-addressed store, hash-verified

413
414// Respond to a click on the [Reset] button
415void NetHackQtExtCmdRequestor::Reset()
416{
417 // clear any typed text first (in case future changes are made to
418 // remember it across accept (retry); that would be intended for the
419 // [Layout] case rather than for [Reset])
420 bool clearprompt = (prompt->text() != "#");
421 if (clearprompt)
422 prompt->setText("#");
423
424 int teardown = 0;
425 if (set != (WizardMode ? all_cmds : normal_cmds))
426 set = all_cmds, ++teardown;
427 if (byRow)
428 byRow = false, ++teardown;
429 if (teardown) {
430 Retry();
431 /*NOTREACHED*/
432 }
433
434 if (clearprompt) { // was a subset, now need to show full set
435 DefaultActionIsCancel(true); // in case keyPressEvent cleared it
436 enableButtons(); // redraws the grid after discarding typed text above
437 }
438}
439
440// Return to ExtCmdRequestor::get()'s caller in order to be called back
441void NetHackQtExtCmdRequestor::Retry()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected