Fix: NH002 Problem: 1. Closing the Qt interface main window (by whatever means your window manager allows) doesn't cause the game to exit, nor does it bring up a dialog to confirm that you want to quit. 2. No support for two-weapon combat in menus. Many thanks to Janet Walz of the Dev-team for providing these fixes. Compatible with: NetHack 3.3.0 Slash'EM 0.0.6E0F1 Author: Warwick Allison, warwick@troll.no J. Ali Harlow, ali@avrc.city.ac.uk Date: 25 Jan 2000 *** win/Qt/qt_win.cpp.orig 2000/01/21 19:01:28 1.7 --- win/Qt/qt_win.cpp 2000/01/22 00:50:52 *************** *** 3025,3030 **** --- 3025,3031 ---- { apparel, 0, 0 }, { apparel, "Wield weapon\tw", "w" }, { apparel, "Exchange weapons\tx", "x" }, + { apparel, "Two weapon combat\t#two", "#tw" }, { apparel, 0, 0 }, { apparel, "Wear armour\tShift-W", "W" }, { apparel, "Take off armour\tShift-T", "T" }, *************** *** 3271,3276 **** --- 3272,3303 ---- if (message) message->Scroll(0,+1); break; default: event->ignore(); + } + } + + void NetHackQtMainWindow::closeEvent(QCloseEvent* e) + { + if ( program_state.something_worth_saving ) { + switch ( QMessageBox::information( this, "NetHack", + "This will end your NetHack session", + "&Save", "&Quit", "&Cancel", 0, 2 ) ) + { + case 0: + // See dosave() function + if (dosave0()) { + u.uhp = -1; + terminate(EXIT_SUCCESS); + } + break; + case 1: + u.uhp = -1; + terminate(EXIT_SUCCESS); + break; + case 2: + break; // ignore the event + } + } else { + e->accept(); } } *** include/qt_win.h.orig 1999/12/30 05:11:27 1.3 --- include/qt_win.h 2000/01/22 00:52:32 *************** *** 677,682 **** --- 677,683 ---- protected: virtual void resizeEvent(QResizeEvent*); virtual void keyPressEvent(QKeyEvent*); + virtual void closeEvent(QCloseEvent*); private slots: void layout();