PatR [Thu, 10 Dec 2020 09:07:07 +0000 (01:07 -0800)]
yet more key bindings - lack of same...
When ?i shows key bindings, at the end of each group (movement,
prefixes, general, game, debug) report any commands for that
group which don't have any key assigned. Movement and prefixes
all have keys; they'd be pretty useless without and key bindings
won't override movement commands. For general, the "keyless" are
|#exploremode
|#herecmdmenu
|#therecmdmenu
after this adds the relevant flag to their command definitions;
for game, "#terrain" is the only one; the debug section has 20.
There is a known problem that I've going to pretend that I didn't
notice: if I use BIND=D:takeoffall then 'A' becomes unassigned,
'D' invokes #takeoffall, "#droptype" becomes keyless, and ?i
reports those correctly. But if I use BIND=M:takeoffall, 'A'
becomes unassigned, 'M' continues to be its usual prefix, and
the "#takeoffall" command is nowhere to be seen. The code that
tracks assignments is letting that case fall through the cracks.
'M' ends up assigned to both and the ?i code deliberately only
shows the first.
PatR [Thu, 10 Dec 2020 09:01:04 +0000 (01:01 -0800)]
Guidebook catchup
The command rename "#seegold" to "#showgold" that also revised
a few of the short command desctipions didn't include a Guidebook
update. So here one is.
PatR [Thu, 10 Dec 2020 00:52:54 +0000 (16:52 -0800)]
txt2key() - parsing key binding specifications
While testing some addtional ?i (list of key assignments)
changes, I wanted to give every key a binding. When I tried
BIND=M-^A:exploremode
the text to key conversion didn't like that. This adds support
for M-^x and M-C-x plus variations where dashes are omitted.
This adds support for ^? even though that isn't really a
control character. I bound #terrain to it and surprising--to
me at least--the <delete> key worked to invoke that command.
Also changes 'char txt2key(...)' to be 'uchar txt2key(...)'.
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.