Add Michael's fix for control+x.
The enum name of the argument suggests that option+x should have
been sending control characters but that wasn't the case for me.
Before this fix, both control+x and option+x behaved like dead
keys, not transmitting anything for nethack to use. After this
fix, control+x sends ^X as desired but option+x is still dead.
The presence of longer lines has made the 'about' box become wider
so combine the first two short lines into one longer one.
Switching to the longer nethack version string resulted in "This
is NetHack MacOSX Nethack ..." so remove the initial "NetHack"
from the 'about' box's format string. That version string also
includes a final period; strip that off since "with Qt 5.x.y."
follows it to end the sentence.
Still some issues:
The application menu has first entry "nethack" which ought to be
capitalized but I haven't been able to figure out how to accomplish
that.
Some code in qt_main.cpp tries to add an extra instance of "about
NetHack" to the game window's "Help" menu but it doesn't show up.
When there was only one supported interface included in the program,
feedback of
|Supported windowing system:
|"tty" (traditional text with optional line-drawing)
was missing the intended final period. When there were more than
one, the clause describing the default could be preceded by a
spurious space.
|Supported windowing systems:
|"tty" (traditional text with optional line-drawing) and "Qt" , with a
|default of "tty".
There was a fixup for " , " but it only worked as intended when
that was on the last line, not when the default's text spanned lines.
This adds description of "Windows GUI" to the mswin entry. X11 could
have its formal name "The X Windows System" as the description but I
didn't add that since it just seems like extra verbosity. Apparently
Qt doesn't stand for anything else so still has no extra description.
options.c gave some unused variable warnings in the 'msg_window'
parsing if compiled without having tty enabled.
The 'msg_window' option should be available if either tty or curses
is the interface in use, hidden otherwise. The code to parse it
was included if TTY_GRAPHICS is enabled, so it worked in curses for
a tty+curses binary but not curses without tty one. This fixes that.
It is still displayed by 'O' when X11 or Qt is in use if the binary
also supports tty or curses. I've left that as is.
Started out removing some trailing spaces and ended up making various
substantive changes.
Don't include tty by default since the sample make command shows how
to enable it and there isn't any easy way to disable it other than
not requesting it to begin with. (Due to using defined/not-defined
rather than values in the 'if' directives, WANT_WIN_TTY=0 is the same
as WANT_WIN_TTY=1 rather than it's inverse.)
That resulted in all the interfaces starting commented out, so add
some make code to make sure that at least one is enabled. If none,
it silently enables tty.
The sequence
|CXX=compilerA
|LINK=$(CXX)
|#CXX=compilerB
wouldn't work if 'make' substitutes immediately (I can't recall
offhand whether it does) and the first CXX was commented out in
order to uncomment the second one. The default CXX value would be
used instead of the #CXX=foo one even if it was uncommented. Just
move LINK= after it.
Build logic has been tested. Final install and packaging for
distribution have not (but weren't touched so shouldn't be affected).
Testing some hints revisions resulted in some bafflement which
turned out to be caused by 'make spotless' in the dat subdirectory
not removing 'options'. It wasn't removing several other generated
files either. That used to work but got clobbered when the lua
special levels replaced levcomp and dgncomp.
Assuming you have the prerequisite packages, You can specify the
window ports to include on the make command line:
make WANT_WIN_QT=1 WANT_WIN_X11=1 WANT_WIN_CURSES=1 WANT_WIN_TTY=1 all
Prequisites for window ports beyond tty:
(some sample homebrew commands to obtain them shown but that is not the
only way):
xquartz for x11 support
brew install xquartz
Qt for Qt support
brew install Qt
The change to use fixed-width fonts for menus wasn't working
optimally because the font got changed after menu construction
had measured the necessary width and height amounts. ^X output,
which uses a menu instead of a text window for tty's benefit
(probably curses too; I don't remember), had a couple of lines
which were wrapping unnecessarily.
This fix avoids that, but the extra '+20' shouldn't be needed.
Unfortunately lines in menus are effectively double-spaced, which
looks bad, and I've no idea how to fix that.
Make the same change to outdated/win/Qt3/qt3_win.cpp for the
"about nethack" popup that was just made to win/Qt/qt_main.cpp so
that the out of date URLs won't be overlooked if the Qt 3 interface
ever gets resurrected.
Not tested and most likely will never matter.
When chatting to the quest leader to try to gain access to the
rest of the quest, if your experience level is good enough but
your alignment strength isn't, in wizard mode you'll get prompted
about whether to have piety boosted. Normally you would answer
'y' and be able to go to lower quest levels. But if you answer
'n' you'll immediately be prompted a second time. Not because
the no response didn't register but because the if/else-if/else
logic checks twice for whether your alignment is inadequate and
if you answered no the first time it will still be too low the
second, with the first answer not carrying over.
Fixes#376
Update the 'about' popup to reflect current information.
When I start Qt nethack on OSX 10.11, the horizontal application
menu for nethack that's rendered across the top of the desktop won't
respond to mouse clicks, not even if I click on nethack's title bar
or inside its game window first. But if I give another application
focus (which swaps top-edge menu to one for that other application)
and then click on nethack's title bar to give focus back to nethack
(which also swaps back to the top menu for it), clicking on that menu
begins working. I have no idea what's going on there.
Picking "nethack" in the application menu gives a pull down menu with
"about nethack" as the first entry. When choosing that, the revised
popup looks like
| Qt NetHack is a version of NetHack
| built using the Qt 5 GUI toolkit.
|
| This is NetHack 3.7.0-22 with Qt 5.11.3.
|
| NetHack's Qt interface originally developed by
| Warwick Allison.
|
| Qt:
| https://qt.io/
| NetHack:
| https://www.nethack.org/
The line with Warwick's name is wrapping and I don't know how to
make the popup wide enough to avoid that. The old edition had a
"Homepage" URL for him instead of that sentence but the URL was out
of date. It also had an obsolete URL for Qt and none at all for
NetHack itself.
This was changed in the Guidebook and dat/history some time back but
the value in the code was overlooked. Switch protocol from http to
https and add trailing slash.
When hunger state is "not hungry" (so omitted from the status line),
say so in the status section of ^X output. Mainly so that wizard
mode can append the internal nutrition value without inserting an
entire line that [previously] wouldn't be present in regular play.
Show an internal value for encumbrance too, although that would be
better if it also included some indication of the amount where the
encumbrance state changes. Encumbrance is confusing and I didn't
pursue that.
I noticed that Qt status showed both Lev and Fly at the same time
when they should be mutually exclusive (Levitation overrides Flying).
I wasted a bunch of time trying to track down a Qt problem but it
turned out to be a core issue. If Flying is set first (which won't
happen if both are set in the same #wizinstrinsic operation), setting
Levitation via #wizintrinsic was attempting to update the flag that
indicates that Flying is blocked, but doing so too soon and failing.
Setting Lev via other means while Fly was already set didn't have
this problem so it wouldn't occur during normal play.
Also, #timeout lists timed properties which can have a timeout value
in normal play, then a separator, followed by properties that can
only become timed due to #wizintrinsic. Move Displacement from the
second group to the first now that it can be obtained as a timed
value by eating a displacer beast corpse.
The check for mon's max HP being at least as high as its level
turns out to be wishful thinking. Just disable it. Maybe we'll
flag critters who got or gave up HP during cloning and let them be
exceptions, then turn it back on, but not now. Or maybe reduce
mon->m_lev when cloning. That would weaken them though.
Keep the 1 extra HP that an earlier fix for this check gave to
monsters who rolled the minimum possible value while being created
(Nd8 that yielded N boosted to N+1, 1d4 for 1 boosted to 2).
The status lines are out of date. This brings status conditions
up to 3.6.0 level: adding Stoned, Slimed, Strangled, Deaf,
Levitating, Flying, Riding. It also reorders a few things:
put encumbrance after hunger, put Confused after Stunned, and
Blind after Hallucinating. Also renames Sick to FoodPois and
Ill to TermIll.
So, the portion of status devoted to conditions is now (left to
right on one line):
Satiated/[omitted]/Hungry/Weak/Fainting/Fainted,
[omitted]/Burdened/Stressed/Strained/Overtaxed/Overloaded,
Stone, Slime, Strngl, FoodPois, TermIll,
Stun, Conf, Hallu, Blind, Deaf,
Lev, Fly, Ride.
It's actually two lines. The upper line has a 40x40 or so icon
(aka tile, defined in qt_xpms.h rather than a data file) above
the corresponding text on the lower line. I created a blank icon
and used it for all the added conditions. At some point someone
with artistic talent will need to draw a bunch of things.
Using hints/macosx10.10-qt,
| make QTDIR={path} WANT_WIN_X11=1 USE_XPM=1
now builds a combined tty+Qt+X11 binary. Linking the X11 code
works a lot better when the Makefile tells the linker where the
X11 libraries are....
This reconciles some of the differences between macosx10.10 and
macosx10.10-qt but there are still lots more (including lack of
WANT_WIN_CURSES in the latter). And now 10.10 has differences
with the half dozen or so other macosx10.* hints.
Tin handling code used tin->cknown to indicate that the variety
(soup, deep fried, pureed, &c) was known, but neither object
identification nor end of game disclosure was setting cknown for
that type of object.
^I behaves as if cknown is set, so the problem was hidden during
times when anyone was likely to be paying attention.
It doesn't mention anywhere that newmextra() is responsible for
initializing struct mextra with null pointers to the various
sub-structs. So, when one follows the instructions and doesn't know or
remember to do this, they'll get segfaults when something tries to read
the uninitialized pointer to their new struct.
Adopt the suggestion that candy bar stacks which get split should
keep the same wrapper text for both halves of the stack. The patch
stuck with using obj->o_id to manage the wrapper which prior to the
patch wasn't a factor in merging and splitting. Switch to obj->spe
instead, comparable to tin varities, so mergability is already
taken care of.
End of game disclosure tacks on T-shirt text to formatted items.
Do the same for candy bar wrappers.
Qt menus have [ok][cancel][all][none][other stuff] buttons across
the top but it was disabling [cancel] for inventory viewing and
other pick-none menus. Enable that so that [cancel] is a viable
alternative to typing ESC or clicking on [ok] for dismissing the
menu without picking anything.
This greatly improves the '?' choice when using the '#' prefix
to select an extended command. It isn't perfect, because the
<text><spaces><more text> layout (using spaces to pad the first
column so that the second one lines up) produces at least one
line where <more text> is so long that it wraps, and instead of
| <text><spaces><start of more text>
| <blank><spaces><rest of more text>
that selectable menu entries have, the continuation is
| <text><spaces><start of more text>
|<rest of more text>
(made slightly worse by the fact that <text> is indented a little
and <rest...> isn't.
This affects the aesthetics of all NHW_MENU windows, not just the
one that desparately needed help. Maybe the core should send some
hint on a menu or text window by menu or text window basis about
whether or not fixed-width font is preferable to variable one.
This lets combined X11 and Qt compile cleanly (when set up with
hints/macosx10.10-qt and built with 'make WANT_WIN_X11=1 USE_XPM=1')
but linking fails at present. (It can't find X11 library routines
despite specifying the same -L/opt/X11/lib that X11 without Qt uses.
The C++ linker is being used but the code that calls those routines
is compiled as C, not C++ so name mangling shouldn't be an issue.)
Recently combat between monster mind flayer and headless monster was
changed to skip extra tentable-for-drain_intelligence attacks after
hitting with one for no effect. Do the same for monster mind flayer
against headless poly'd hero and for hero poly'd into mind flayer
versus headless monster. As before, it only applies to additional
actions during the current attack. As soon as the attack is over,
the ineffectiveness of intelligence drain upon target is forgotten.
Qt's implementation of '#' puts up a rectangular grid of buttons
containing command names from the alphabetized extcmdlist[]:
| # ? adjust annotate
| apply attributes autopickup call
| cast ...
When 3.6 put all commands into that list, the hardcoded 4 columns
resulted in so many rows that the grid wouldn't fit on the screen
(at least not on my smallish laptop screen). There's no scrollbar
so the commands beyond "takeoff" were inaccessible off the bottom.
Warning messages from within Qt were issued to stderr complaining
about trying to render something off the screen (once each time the
'#' command grid was generated).
It was also including wizard mode commands when not in wizard mode.
Suppress those when they're not applicable, and change the grid to
use 6 columns then and 8 for wizard mode. The appropriate amount
ought to be calculated on the fly but these values work ok with the
current command list. (On my screen; if something smaller is used,
the original problem could come back, just not as severe as before.)
Having an alphabetized list go across rows instead of down columns
feels counter-intuitive so transpose the grid.
| # autopickup ...
| ? call
| adjust cast
| annotate ...
| apply
[Having another button next to <cancel> that lets the user switch
back and forth between the two orientations could be worthwhile.
A full-fledged wc/wc2 option for that doesn't seem warranted.]
The commands can be selected by typing their names as an alternative
to mouse click. The input widget supports <backspace> but lacked
handling for <delete> so add that.
When typing a command by its name, a new grid showing only matching
candidates gets displayed so that you can switch back to mouse input.
It looks pretty bad but does work as intended. I didn't touch that;
however, it looks different now due to the columns-vs-rows change.
The menu after picking "?" looks worse. It assumes a fixed width
font and tries to align things in two columns with spaces, but the
result when using a variable width font is ugly. This makes no
attempt to address that.
After installing qt511-qtbase and qt511-qtmultimedia from macports
on my OSX 10.11 system (there is a qt513 but it requires OSX 10.12),
I can build the Qt interface with hints/macosx10.10-qt by overriding
QTDIR. It doesn't actually need the extra CFLAGS, and without those
I wonder whether the multimedia package is needed either, but I've
left them in. I have changed them to not be passed to the C sources
though, just the C++ ones.
I haven't tried combining with X11 or adding curses.
Give better feedback if reading a scroll of identify when it is the
only item in inventory (making that empty when scroll is used up).
Reading a cursed scroll of identify used to always ID 1 item besides
itself. Change it to behave like confused identify--only identifying
itself--if read when the scroll hasn't been discovered yet. Same as
before when scroll has already been discovered: identify 1 item.
I looked for places where changing "{blinding,acid} venom" into
"splash of {blinding,acid} venom" might make messages become too
verbose. Turns out to have been unnecessary work because the full
name won't be used unless you get a venom object in inventory and
formally identify it. Wizard mode, or bones from wizard mode, is
necessary for that to happen so the possibility can be ignored.
[The name change is still useful for wizard mode wishing though.]
Many messages use hard-coded "venom" instead of xname() so won't
be affected even if such identification takes place. However,
thitmon() was producing
|The <mon> is hit by the splash of venom.
|The splash of venom blinds the <mon>.
which seems rather redundant even without the longer full object
name. So change the second message to be generated as
|The venom blinds the <mon>.
It also shortens "cream pie" in first line to "pie" in second one.