on UNIX/X11 or Mac OS X. This code should also work with Qt/Windows, but
support for that is not currently official.
-You can download Qt for UNIX and Qt for Windows from http://www.trolltech.com.
-Qt for Mac OS X is currently only available commercially. You need Qt 2.0 or
-later to use this code.
+You can download Qt from http://www.trolltech.com.
+You need Qt 2.0 or later to use this code.
-To use this code:
+To use this code on UNIX (not Mac OS X):
1. follow the directions for the UNIX installation (in ../../sys/unix)
to create the Makefiles.
you installed Qt - $QTDIR/include/qwidget.h should exist, for
example.
- ensure CXX and LD are set to the compiler and linker you need
+ ensure CXX and LINK are set to the compiler and linker you need
for compiling and linking C++ software (e.g., set both to g++).
add $(WINQTSRC), $(WINQTOBJ), and $(WINQTLIB) to WINSRC, WINOBJ,
4. ../../Makefile (the top-level makefile)
- change the VARDATND setting to contain the files "x11tiles",
- "rip.xpm", and "nhsplash.xpm":
+ Just change the VARDATND setting to contain the files
+ "x11tiles", "rip.xpm", and "nhsplash.xpm":
VARDATND = x11tiles rip.xpm nhsplash.xpm
OPTIONS=name:player,number_pad,menustyle:partial,!time,showexp
OPTIONS=hilite_pet,toptenwin,msghistory:200,windowtype:Qt
-
If you are using KDE, you may want to also try the KDE version. It just
uses the KDE menubar and follows other KDE conventions - there is no
extra functionality. To do so:
knethack.lnk are useful if you want to install "knethack" in
the KDE games directory.
-
If you are using Qtopia, you can compile NetHack for that environment
with the following additional steps:
5. After building, use the "mkipks" program that ships with Qtopia
to package the result into an ipk file.
+To use this code on Mac OS X:
+
+ 1. follow the directions for the UNIX installation (in ../../sys/unix)
+ to create the Makefiles.
+
+ 2. quite a number of changes are required to the Makefiles. They are
+ slowly being made 'official', but for now they are all in the patch
+ nethack-macosx-qt.patch:
+
+ cd ../..
+ patch -p0 < win/Qt/nethack-macosx-qt.patch
+
+ 3. Follow all the instructions in ../../sys/unix/Install.unx for
+ the remainder of the installation process (basically run "make install").
+
+ 4. Consider adding the lines below to a file called "NetHack Defaults",
+ in your "Library/Preferences" folder, as they are likely to give
+ the best interface for this window port:
+
+ OPTIONS=name:player,number_pad,menustyle:partial,!time,showexp
+ OPTIONS=hilite_pet,toptenwin,msghistory:200,windowtype:Qt
static QPen* pen=0;
if ( !pen ) {
pen = new QPen[17];
- pen[0] = Qt::black;
+ pen[0] = QColor(24,24,24); // "black" on black
pen[1] = Qt::red;
pen[2] = QColor(0,191,0);
pen[3] = QColor(127,127,0);
pen[13] = QColor(255,127,255);
pen[14] = QColor(127,255,255);
pen[15] = Qt::white;
- pen[16] = Qt::black;
+ pen[16] = QColor(24,24,24); // "black" on black
}
return pen[c];
how=h;
ok->setEnabled(how!=PICK_ONE);ok->setDefault(how!=PICK_ONE);
- cancel->setEnabled(how!=PICK_NONE);
+ cancel->setEnabled(TRUE);
all->setEnabled(how==PICK_ANY);
none->setEnabled(how==PICK_ANY);
invert->setEnabled(how==PICK_ANY);
keysource.GetAscii();
*menu_list=0;
- if (result>0 && how!=PICK_NONE) {
+ if (how==PICK_NONE)
+ return result==0 ? -1 : 0;
+
+ if (result>0) {
if (how==PICK_ONE) {
int i;
for (i=0; i<itemcount && !item[i].selected; i++)
rip.hide();
}
int mh = QApplication::desktop()->height()*3/5;
- if ( qt_compact_mode && lines->TotalHeight() > mh || use_rip ) {
+ if ( qt_compact_mode && (lines->TotalHeight() > mh || use_rip) ) {
// big, so make it fill
showMaximized();
} else {