Commit Graph

10908 Commits

Author SHA1 Message Date
PatR
f4cee951ca ^X on MacOSX Qt
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.
2020-08-05 11:26:25 -07:00
PatR
be3edcd097 some qt_main.cpp formatting cleanup 2020-08-05 11:10:57 -07:00
PatR
b8b4fc70da more Qt "about nethack"
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.
2020-08-05 10:55:10 -07:00
nhmall
e426f99d25 Use the more detailed version info on Qt 2020-08-05 08:49:58 -04:00
nhmall
a6fc14a2cc Merge branch 'NetHack-3.7' of into NetHack-3.7 2020-08-04 16:10:28 -04:00
nhmall
5bd3c15ebc macOS.2020 tweak
Eliminate the use of WINLIB0 and the use of sort for clearing of
duplicate strings within it.
2020-08-04 16:07:04 -04:00
PatR
ef5aeba167 interface feedback by #version
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.
2020-08-04 12:00:17 -07:00
nhw_cron
ac8bc414bc This is cron-daily v1-Jan-20-2020. files updated: Files 2020-08-03 22:46:22 -04:00
nhmall
7a1952eadd more file header "NetHack 3.6" to "NetHack 3.7" 2020-08-03 22:41:35 -04:00
nhmall
ac9ba38449 file header bump from "NetHack 3.6" to "NetHack 3.7" 2020-08-03 22:07:36 -04:00
PatR
2b8763c9fe partial fix for 'msg_window' option processing
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.
2020-08-03 15:42:09 -07:00
PatR
a968acb242 hints/macOS.2020
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).
2020-08-03 14:10:35 -07:00
PatR
02d616d8bc dat/Makefile spotless
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.
2020-08-03 13:36:40 -07:00
nhw_cron
375c9c880e This is cron-daily v1-Jan-20-2020. files updated: Files 2020-08-03 00:03:24 -04:00
nhmall
8cd4d99948 Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2020-08-02 23:04:56 -04:00
nhmall
d39ae5ce79 Support a build with tty,Qt,x11,curses on macOS Catalina 10.15
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
2020-08-02 23:03:13 -04:00
PatR
08249963b2 Qt menu fix
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.
2020-08-02 15:03:27 -07:00
PatR
357cb198ee Qt 3 'about'
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.
2020-08-02 14:45:00 -07:00
PatR
d3e77393ab fix github issue #376 - duplicate prompt
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
2020-08-02 12:18:11 -07:00
PatR
09d9d002c7 Qt's "about nethack"
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.
2020-08-02 11:49:41 -07:00
PatR
30da367b80 udpate nethack's URL
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.
2020-08-02 10:59:50 -07:00
PatR
427f8e42d8 ^X vs hunger, encumbrance
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.
2020-08-01 19:17:56 -07:00
PatR
22b4ed0be5 Lev vs Fly via #wizintrinsic
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.
2020-08-01 06:11:20 -07:00
PatR
9cb3fa9cf2 mon->mhpmax sanity check
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).
2020-08-01 05:11:20 -07:00
PatR
308e7ededd Qt status conditions
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.
2020-07-31 16:05:35 -07:00
PatR
dcf5d7d68e Qt+X11 on OSX
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.
2020-07-31 14:30:55 -07:00
nhmall
1d2a5aed37 adjust note wording in mkobj.c and makemon.c 2020-07-31 16:59:34 -04:00
PatR
97cc689553 tin identification
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.
2020-07-31 13:14:09 -07:00
PatR
3388fd5887 Qt comment tidbit
A recenly added comment used "its" where "it's" was intended.
Instead of just adding an apostrophe, rewrite the clause.
2020-07-31 12:53:34 -07:00
nhmall
e524fc4fc8 clarify what was meant by "special" in a comment 2020-07-31 10:57:20 -04:00
nhmall
6357505948 makemon and mkobj follow-up initialization bit 2020-07-31 10:00:14 -04:00
nhmall
8b2750ab60 lower the code upkeep for mextra and oextra pointer additions 2020-07-31 09:42:17 -04:00
nhmall
f153c1f0d1 typo fix in include/obj.h comment 2020-07-31 08:42:40 -04:00
nhmall
33acf59ee7 merge and evolve PR #375
Closes #375
2020-07-31 08:37:51 -04:00
nhmall
e99a6076df Merge branch 'copperwater-mextra-note' into NetHack-3.7 2020-07-31 08:33:27 -04:00
nhmall
6b7979fa72 add note to zero out new mextra and oextra fields
Closes #375
2020-07-31 08:31:09 -04:00
nhmall
67bc0a78ce Merge branch 'mextra-note' of https://github.com/copperwater/NetHack into copperwater-mextra-note 2020-07-31 08:25:42 -04:00
copperwater
922321b251 Add instructions to zero mextra struct pointer in mextra documentation
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.
2020-07-30 23:07:30 -04:00
PatR
c64049306d candy bar wrappers
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.
2020-07-30 19:25:57 -07:00
PatR
8ca0834eb2 Qt pick-none menu vs [cancel]
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.
2020-07-30 08:58:57 -07:00
PatR
c96a9ff389 Qt menus font
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.
2020-07-30 08:19:06 -07:00
PatR
7f1420558a lua on Unix tinkering
The base Makefile hasn't been using the '+=' construct, so take
out the one used for lua (post 3.6.6).

Only the 'Sysunix' target has been tested.
2020-07-30 06:25:43 -07:00
PatR
5a072c4202 hints tinkering
For macosx10.10-qt, move the linker specification to one spot.
Should be no change in behavior.
2020-07-30 06:20:11 -07:00
PatR
827e40705d X11+Qt vs config.h
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.)
2020-07-29 18:23:54 -07:00
PatR
00d1e729da more mind flayer vs headless target
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.
2020-07-29 11:10:01 -07:00
PatR
5ce74c7bd5 Qt extended command selection
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.
2020-07-29 09:17:45 -07:00
PatR
79275629fc Qt tinkering
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.
2020-07-28 19:31:14 -07:00
PatR
0a575befcc identify tweaks
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.
2020-07-28 13:10:11 -07:00
nhmall
c8ad99fcdf add fixes37.7 entry for f664e83 gone portal 2020-07-28 08:18:39 -04:00
PatR
3cc82cbbe7 venom bit
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.
2020-07-27 09:20:12 -07:00