PatR [Tue, 8 Dec 2020 23:58:02 +0000 (15:58 -0800)]
keylist help (? i) fixes
I was implementing a routine to show all the key bindings
when I discovered that we already have one. This fixes a few
small problems: 'n' prefix for number entry was missing for
number_pad mode. Meta+<direction> for running in number_pad
mode was missing too. ^A was present but being suppressed by
lack of #define for obsolete #if REDO. And ^C was shown as ^c
while all other ^ characters appear in upper case. Once ^A
appeared as the line before it, the inconsistency stood out.
I also changed the slightly verbose "Shift-<direction>" and
"Ctrl-<direction>" entries below the direction grid to use plus
instead of minus signs. Plus emphasizes that two things are
combined so seems more intuitive. (I left "M-c" alone.)
PatR [Tue, 8 Dec 2020 20:58:36 +0000 (12:58 -0800)]
NOSUSPEND
Provide a hook to inhibit unixconf.h from defining SUSPEND
without the need to modify it: #define NOSUSPEND in config.h
or add -DNOSUSPEND to CFLAGS. Similar to long-standing NOSHELL
for inhibiting SHELL.
PatR [Mon, 7 Dec 2020 20:46:46 +0000 (12:46 -0800)]
fix #3120,#3122 - dwarf pass_wall without digging
I couldn't reproduce this so can't confirm that this fix works,
but inspection of the code reveals that something was missing
in the unified mon movement flags code. I think what has been
happening is that a dwarf without a pick-axe might not bother
wielding that but movement behaved as if it had, then digging
decided it wasn't.
PatR [Mon, 7 Dec 2020 11:08:32 +0000 (03:08 -0800)]
extended command help
The two or three (wizard mode) menu choices at the start of
the '# ?' help menu look enough like headers that it can be
confusing. They're asking about changing the view of commands
to what those entries describe, but if considered as headers
they're describing the opposite of what is currently displayed.
Make them more verbose to try to clarify the situation.
This also moves the 'm' flag in front of the 'A' in the middle
column (of name, flag(s), description) when they both apply.
PatR [Mon, 7 Dec 2020 09:05:37 +0000 (01:05 -0800)]
Qt extended commands: menu teardown and rebuild
Change qt_get_ext_cmd() to handle calling the extended command
selection menu again after player clicks on Filter/Layout/Reset
instead of relying on the core to do that. (In order to change
the menu, instead of attempting to reconfigure that on the fly
it returns to caller and then puts up a new menu with different
settings when called back. Initial checkin relied on the core
for the call back; this maintains full control for that within
the Qt interface code.)
PatR [Sun, 6 Dec 2020 10:58:05 +0000 (02:58 -0800)]
Qt extended commands enhancement
For Qt's pick-an-exetended-command dialog, allow a player to
toggle the grid layout from column-oriented to row-oriented
and vice versa and when in wizard mode to cycle the set of
shown (and typable) commands from 'all' to 'normal mode-only'
to 'wizard mode-only' back to 'all'. The most recent values
are saved by Qt along with tile size, font size, and some other
stuff. The extended command dialog has a Reset button to force
them (the two extended command values) back to their defaults.
The dialog layout has a slight change to conserve screen space
as well as three additional control buttons:
Was Now
| [ Cancel ] | [Cancel] [Filter][Layout][Reset ]
|# |# Grid Title
| Grid title | [cmd 1] [cmd R+1] [cmd 2*R+1] ...
| [cmd 1] [cmd R+1] [cmd 2*R+1] ... | [cmd 2] [cmd R+2]
| [cmd 2] [cmd R+2] |...
|... | [cmd R] [cmd 2*R]
| [cmd R] [cmd 2*R]
'#' is the prompt where typed text gets echoed and 'R' is the
number of rows in the grid and varies by the set of commands
from the current filter. Grid dimensions have been adjusted:
'all' is 13x9, 'normal' is 13x7, and 'wizard' is 7x4 or 4x7
depending on layout orientation.
The wizard mode-only filter setting probably isn't very useful
because you can only type--or click on--commands which are
visible. So when set to wizard mode-only, you can't #quit for
instance. (Via extended command; there are still menu choices
for that particular action. And it's trivial to change filter.)
PatR [Sun, 6 Dec 2020 03:37:03 +0000 (19:37 -0800)]
Qt's window menus
Qt on OSX is inserting "Search [_____]" as the first entry in
the Help dropdown menu (the one in the toolbar at the top of the
desttop). While trying--and failing--to figure out how to get
rid of that, I cleaned up a little bit of the old menu hackery
(that tries to workaround the fact that Qt on OSX insists that
some menu actions--based solely on their names--should go into
the appication menu rather than whichever menu the program is
trying to insert them into). The only observeable difference
is that 'About NetHack-Qt' will be at the top (actually second
because of that Search one) of the Help dropdown, where it is on
non-OSX builds, rather than last.
This tries to make the program name consistent too, changing
several instances of "Qt NetHack" to be "NetHack-Qt". The latter
is the name being set up as ApplicationName in qt_bind.cpp that
gets used when Qt stashes the Qt-specific settings wherever it
stashes them.
It also makes another tweak in formatting of 'About NetHack-Qt',
inserting one explicit line break to avoid some poor looking line
wrapping. I still haven't figured out how to control that popup's
size.
PatR [Sat, 5 Dec 2020 20:29:38 +0000 (12:29 -0800)]
readable conical hats
Let tourists read cornuthaum ("WIZZARD") and dunce cap ("DUNCE").
One out of three will have those words, the other two will yield
"you can't find anything to read on this ___" where ___ is either
"conical hat" or "cornuthaum" or "dunce cap" depending upon hat
type and discovery status.
Even when a dunce cap says "DUNCE" it won't become discovered,
just offer the player an opportunity to apply a name.
Other roles still fall through to the "That's a silly thing to
read" feedback.
PatR [Fri, 4 Dec 2020 10:58:03 +0000 (02:58 -0800)]
couple more command tweaks
Rename "seegold" to "showgold". The character to invoke it ('$')
is similar to those for the various "seeXYZ" commands ('[','=',&c)
but unlike them, it isn't part of "seeall" ('*').
Expand or replace the one-line description of several commands
(shell, showgold, showtrap, suspend, versionshort).
Pasi Kallinen [Thu, 3 Dec 2020 14:38:17 +0000 (16:38 +0200)]
Fix stairs on oracle level bones
Recent change to the stairs structure now lets each stair keep
the destination level number and dungeon where the stairs go to.
When a level that can be on different depth (such as the Oracle)
became a bones level, and it was loaded in another game at different
depth, the stairs were still pointing to the old level number.
Save it as relative to the current level instead of absolute.
PatR [Thu, 3 Dec 2020 00:11:53 +0000 (16:11 -0800)]
Qt fix for typing "#version"
The #version command is a leading substring of the #versionshort
command and for Qt, it couldn't be executed by typing, only via
mouse click or one of the Qt-specific menus. #version<return>
or #version<space> now works for that.
The #versionshort command ought to be renamed to something else.
PatR [Wed, 2 Dec 2020 22:49:09 +0000 (14:49 -0800)]
saving followup
If attempting to checkpoint when changing levels discovered that
the alock.0 or 123wizard.0 file was missing and the game was
running in wizard mode, play continued after reporting trickery
but screen updating was left disabled. An early return in
savegamestateinlock() wasn't resetting the program_state.saving
flag to revert to normal screen updates.
I added a few return statements at the ends of void routines,
where they're optional, because it makes searching for early
returns easier. (Without these then when no early return is
present between current point and end of routine, the search
would move past the routine looking for 'return' later in the
file.)
save_stairs() was placed in between saveobj() and saveobjchn()
so I've moved it. (Has no effect on the recently reported stair
anomalies.) It was also accumulating the total stairway data
size in 'len' and never using that for anything, so I got rid
of it. (Ditto about anomalies.)
PatR [Wed, 2 Dec 2020 14:29:58 +0000 (06:29 -0800)]
saving vs ball&chain
I started activating new program_state.saving and discovered that
saving of ball and chain could access freed memory. The change
for the former and fix for the latter are mixed together here (but
easily distinguishable).
The saving flag inhibits status updating and perm_invent updating,
also map updating that goes through flush_screen(). That should
fix the exception triggered after an impossible warning was issued
during a save operation. impossible() goes through pline() which
tries to bring the screen up to date before issuing a message.
During save, data for that update can be in an inconsistent state.
The code to save ball and/or chain when not on floor or in invent
(I think swallowed is the only expected case) was examining the
memory pointed to by uball and uchain even if saving the level had
just freed floor objects and saving invent had just freed carried
objects. So for the usual cases, stale pointer values for uball
and uchain would be present and checking their obj->where field
was not reliable.
PatR [Tue, 1 Dec 2020 00:16:14 +0000 (16:16 -0800)]
reduce the number of #seeXYZ commands
Noticed while working on Qt's extended command handling, there
are an awful lot of "seeXYZ" commands. Keep the inventory display
ones (named versions of ')' to show wielded weapon(s), '[' for
worn armor, '"' for worn amulet, &c) and rename the others:
| #seenv -> #wizseenv debugging command
| #seespells -> #showspells '+' command
| #seetrap -> #showtrap '^' command
Also, expand the descriptions of #shell and #suspend a bit in
the Guidebook. LaTeX version is untested.
PatR [Mon, 30 Nov 2020 19:40:21 +0000 (11:40 -0800)]
move 'g.restoring' to 'g.program_state.restoring'
Move the core's global restoring flag (not the same as main()'s
local resuming flag) to a more logical place. Add a saving flag
in the process, but it isn't being set or cleared anywhere yet.
(Once in use it will probably fix the exception during save that
was just reported, but before that it would be useful to figure
out what specifically caused the event.)
The program_state struct really ought to be standalone rather
than part of struct g but I haven't made that change.
Removing an unused variable for wishing and some reformatting
that whent along with it got mixed in. Removes some trailing
whitespace in sfstruct.c too.
PatR [Mon, 30 Nov 2020 11:18:45 +0000 (03:18 -0800)]
Qt extended commands
When responding to '#', the Qt interface puts up a grid of buttons
labelled with the names of commands. Then if the user types
instead of clicking on a button, buttons which can no longer match
are removed rather than grayed out. The remaining ones keep their
same relative positions. Once whole rows or whole columns were
gone, it looked awful. With rows gone, the size of the grid
shrank but the popup stayed the same size, so the one-line prompt
area expanded to fill up the vacated vertical space. That caused
the prompt and partial response to move as they stayed centered in
their growing area. With columns gone, the width of the buttons
in remaining columns expanded and they spread out to take up
vacated horizontal space. Once the candidate commands were all
in one column, the buttons spanned the width of the grid. (That's
mostly my fault due to changing the grid from being row-oriented
[a b c]
[d e ]
to column oriented
[a d]
[b e]
[c ]
which resulted in columns going away a lot faster and possibly down
to one when the old layout always had at least two. But old layout
could drop to one row; the current layout always has at least two.)
Also, accept ^[ as ESC. Typing ESC when partial input is present
kills that input but keeps prompting. Typing ESC when no input
is present (none entered yet or a second of two consecutive ESCs)
cancels the operation.
Allow ^U to kill partial input. If used when no input is present,
nothing happens, similar to backspace. Unlike tty and curses, it's
hardcoded here. That shouldn't be a problem because ESC can be
used as a substitute if ^U isn't what the player normally uses.
PatR [Mon, 30 Nov 2020 00:58:56 +0000 (16:58 -0800)]
Qt message window: horizontal scrolling
Multiple stints of flailing about without a clue finally led to
a breakthrough. When writing a new message to the multi-line
message window, force the view back to showing the starts of
lines if player has scrolled it to the side and left it that way.
Put another way, if it has been scrolled to the right, scroll it
as far as possible back to the left.
PatR [Sun, 29 Nov 2020 04:15:30 +0000 (20:15 -0800)]
-Wshadow fix
Not caused by a hidden macro this time...
|mon.c:1549:10: warning: declaration shadows a variable in the
| global scope [-Wshadow]
| long flags = 0L;
| ^
|../include/flag.h:392:29: note: previous declaration is here
|extern NEARDATA struct flag flags;
PatR [Sat, 28 Nov 2020 10:19:28 +0000 (02:19 -0800)]
more "golem rust in peace"
Be prepared for life-saving to contradict "<mon> falls to pieces".
Purely hypothetically at present (with no plans to change) since
golems don't benefit from amulets of life-saving.
PatR [Fri, 27 Nov 2020 19:10:44 +0000 (11:10 -0800)]
autodescribe vs MSGTYPE
I was baffled about why moving the cursor across a fire elemental
kept putting up --More-- until I remembered that I once used
MSGTYPE=stop "[Ff]ire"
to test Qt's handling for that. Turns out that I left it in my
config file. autodescribe feedback should not be honoring that;
honoring MSGTYPE=norepeat is not as clear-cut but this disables
it too.
User sounds were also kept enabled during autodescribe but I have
no way to test them. Like norepeat, disabling just falls into
place.
The pline.c change is unrelated. It just eliminates a wide line
(from adding 'g.') in the source by using a shorter variable name.
PatR [Fri, 27 Nov 2020 10:38:17 +0000 (02:38 -0800)]
fix github issue #401 - roast/rust/rot in peace
This tries to fix the problem of the extra message when a tame
golem is completely destroyed (paper or straw golem burned, iron
golem rusted, wood or leather golem rotted) being issued at odd
times. I basically punted on the visibility aspect since the
original logic was strange: you had to be able to see both the
attacker's and defender's spots and at least one of those two
monsters. Now mon-attacks-mon visibility requires that you be
able to see one of the two and if you don't see both, the unseen
one will be referred to as "it". The "may the iron golem rust
in peace" message is independent of that and may be displayed
after "you have a sad feeling", but now that's intentional and
will refer to an unseen pet by name or monster type, not "it".
This needs a lot of testing and hasn't attempted to address
issue #402: only some attacks that should compeletely destroy
a golem actually do so. (So a hit by fire elemental against a
paper golem does, but passive fire counterattack when a paper
golem hits a fire elemental doesn't, nor does a wand of fire
or being hit by Firebrand.)
PatR [Fri, 27 Nov 2020 02:47:45 +0000 (18:47 -0800)]
more options help
"Name of your starting pet when it is a kitten" could be
construed as meaning that it will no longer apply once the
kitten grows into a housecat. Use "if" instead of "when".
The 'other settings' were in alphabetical order except for
"status condition fields" which presumably started out as
"condition fields". Move it into proper place for current
description.