From: warwick Date: Thu, 1 Jul 2004 18:21:51 +0000 (+0000) Subject: Make "black" characters visible. X-Git-Tag: MOVE2GIT~1435 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5d72e0be52fb7680bf89af9bc7098a74d1989859;p=nethack Make "black" characters visible. Stop RIP window maximizing (C syntax!). Make Cancel button more sensible. --- diff --git a/win/Qt/Install.Qt b/win/Qt/Install.Qt index 7b6ef148d..bb204568d 100644 --- a/win/Qt/Install.Qt +++ b/win/Qt/Install.Qt @@ -5,11 +5,10 @@ This document describes the installation of NetHack with a Qt interface 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. @@ -27,7 +26,7 @@ To use this code: 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, @@ -36,8 +35,8 @@ To use this code: 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 @@ -50,7 +49,6 @@ To use this code: 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: @@ -67,7 +65,6 @@ 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: @@ -89,4 +86,25 @@ 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 diff --git a/win/Qt/qpe-nethack.control b/win/Qt/qpe-nethack.control index 46ad8c3a4..c8b73f5f7 100644 --- a/win/Qt/qpe-nethack.control +++ b/win/Qt/qpe-nethack.control @@ -1,9 +1,9 @@ -Files: bin/nethack apps/Games/nethack.desktop games/lib/nethackdir/[a-r]* games/lib/nethackdir/[t-z]* games/lib/nethackdir/save games/lib/nethackdir/s*.* games/lib/nethackdir/[A-Z0-9]* +Files: bin/nethack pics/NetHack.png apps/Games/nethack.desktop games/lib/nethackdir/[a-r]* games/lib/nethackdir/[t-z]* games/lib/nethackdir/save games/lib/nethackdir/s*.* games/lib/nethackdir/[A-Z0-9]* Priority: optional Section: qpe/games Maintainer: Warwick Allison Architecture: arm -Version: 3.4.0-1 +Version: 3.5.0-1 Depends: qpe-base ($QPE_VERSION) Description: NetHack - The Dungeon Game Graphical version of NetHack for Qtopia diff --git a/win/Qt/qt_win.cpp b/win/Qt/qt_win.cpp index 02bce25eb..670019e88 100644 --- a/win/Qt/qt_win.cpp +++ b/win/Qt/qt_win.cpp @@ -1606,7 +1606,7 @@ const QPen& nhcolor_to_pen(int c) 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); @@ -1622,7 +1622,7 @@ const QPen& nhcolor_to_pen(int c) 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]; @@ -2859,7 +2859,7 @@ int NetHackQtMenuWindow::SelectMenu(int h, MENU_ITEM_P **menu_list) 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); @@ -2922,7 +2922,10 @@ int NetHackQtMenuWindow::SelectMenu(int h, MENU_ITEM_P **menu_list) 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; iheight()*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 {