This isn't really a bug, but I find it does make the map scrolling in
the generic X11 version a lot less distracting. The original behavior
produces certain boundaries where, when the cursor moves back and forth
across that boundary, the map scrolls with each crossing. This is
particularly annoying in places like Sokoban where the player makes that
kind of movement frequently causing large jumps of the map each time.
Changing the border and delta constants in winmap.c as below eliminates
that behavior, as well as making the cursor easier to track by tending
to recenter it whenever the map shifts.
It appears that the Athena text widget in recent XFree86 distributions
does not properly honor the XawtextScrollWhenNeeded flag, so the text
widget created by X11_display_file() does not have a vertical scroll bar
when the text does not entirely fit in the window. I have seen this bug
in XFree86 versions from 4.0.2 through 4.3.0. Using XawtextScrollAlways
for the vertical scrollbar ensures it will always appear.
This provides the core support needed for status field highlighting.
This patch doesn't actually perform status field highlighting for any port,
but provides the core hooks for doing so.
The syntax is:
OPTIONS=hilite_status:{fieldname}/{threshold}/{below}/{above}
where {fieldname} is the name of a status field.
{threshold} is the value used as the threshold to trigger a display
change. It can also be set to "updown" to trigger
a display change whenever it rises or whenever it falls.
If you end the threshold value with %, then it signifies
that you want to trigger the display change based on the
percentage of maximum.
{below}, {above}
are the color or display attribute that you want to use when
the field value is underneath the threshold. Supported display
fields are: normal, inverse, bold, black, red, green,
brown, blue, magenta, cyan, gray, orange,
bright-green, yellow, bright-blue, bright-magenta,
bright-cyan, or white.
Valid field names are:
alignment, armor-class, carrying-capacity,
charisma, condition, constitution, dexterity,
dungeon-level, experience-level, experience,
gold, HD, hitpoints-max, hitpoints, hunger,
intelligence, power-max, power, score,
strength, time, title, wisdom
Refer to window.doc for details. Guidebook updates to come later.
Introduction of a new set of window port status display
routines. The new routines are conditional on
STATUS_VIA_WINDOWPORT
being defined in config.h. See the experimental section,
where the #define resides for the time being.
<Someone> discovered that it is possible to
have wins[WIN_MESSAGE] be null during
a hangup, not sure why yet.
Put a guard in to prevent de-referencing a null pointer.
This brings things much closer to correct operation (I hope).
- The shift to only moving the cursor on input (<Someone>'s
changes) had a lot of complications, among them was
that sometimes, there is no more input. When the program was
exiting, or bombing the cursor synch never got done, so the
final messages could end up strewn any place the cursor
happened to be dwelling.
- There were two competing output systems in use: the
wintty stuff for the game, and the msmsg and error stuff
used by the sys/share/pcsys, sys/share/pctty, and
sys/share/pcunix routines. Those were meant to mimic
output to stdout, where stuff just got sent to a sequential
display. Over time, there were calls mixed in that depended
on the cursor tracked stuff from the core game, so you
really couldn't be sure where things were going to display.
It wasn't as much of an issue before, because the cursor
really did get moved around as expected. Everything
now ends up in the same output system.
- I even found a use of the real putchar() because
sys/share/pcunix didn't #include wintty.h the same
as the other files, and the macro never got defined.
Who knows where that character was being put -
the game certainly couldn't track it.
While everything I knew to be wrong yesterday is
now working, there may be some other glitches
lurking that I haven't discovered yet.
Please: test, test, test.
<Someone> wrote:
> Using the MCVS IDE I couldn't compile NetHack any longer, due to a
> misplaced #endif and a library not included in the DSP file.
> Here's a patch for both problems for 3.5.0.
> The 3.4.x verison only suffered from the first problem. Patch also
> attached.
There were still some significant startup message problems
with win32tty.
I've spent a lot of time in the debugger tracing through them all.
I think I've got them all worked out now, certainly the ones that
I was aware of. There may be some I haven't discovered.
Testing welcomed of course!
This patch also attempts to diagnose the error where someone tries
to execute NetHack directly out of a zip file, and provide
them with a (hopefully) helpful message similar to what we
might end up telling them if they wrote in. If you want
to test that part, you can comment out the line in the
Makefile that adds "dungeon" to nhdat, and delete the nhdat
in your binary and src directories, and "make install".
Then add the value of your TEMP environment variable as a
DATADIR statement in defaults.nh (here's mine):
DATADIR=C:\DOCUME~1\ALLISO~1\LOCALS~1\Temp
The diagnostic code engages if the game fails to open
dungeon. It then checks to see if it the game dir is the
TEMP directory for your system, and if so it prints the
message.
the win32 cursor restriction stuff messed up any
messages displayed during abnormal start conditions
where the window system never got initialized properly.
among them:
- messages relating to lock files or games in progress
- dungeon errors
- early panic messages
I noticed a few panic messages contained newlines, and one included a naked
carriage return. panic() adds a newline itself, and also generally ensures
the message will be on a new line (the initial "oops" ensures the message
itself will be on a new lines). This patch removes the unneeded characters.
This hack simply causes ^C to be ignored completely by the gnome interface.
Gnome really cannot handle interrupts, and the window port interface does
not currently provide a way for the gnome interface to just quit. Allowing
the gnome interface to prompt would require a complete overhall to the the
way window ports work.
Not all of the extended commands worked in the gnome interface because
'#' just caused the next character to be treated as a meta character (this
was a hack I added a while back when none of the extended commands worked).
Resolved by finally adding an extended command menu to the gnome interface.
- updated some formatting so I could read the code
- fixed startup player selection menus so accelerators work
- added necessary calls to make sure selected menu item is visible
- also removed some dead code
The tty menu code wasn't totally reentrant, causing it to free memory
that wasn't on the heap if you had your inventory displayed, ^C then
ask to see the inventory again. Solved this by converting the buffer used
by process_menu_window to be heap-allocated. If the Quit code could return at
this point, this would still be very bad, but since it doesn't, this is OK.
Internals of gnome_yn_function should treat key inputs as 'int' until
returning them, to avoid truncating and not sign extending as needed on
platforms where char is unsigned.
Add a menu item for Quiver. While testing this, found the Quit menu
item still said that you quit using shift-q, so I updated that too.
Trunk change includes some other exit related fixes that don't apply to
the 3.4.3 branch.
cosmetic changes to allow qt_win.cpp to compile cleanly using gcc -Wall.
This corresponds to a debian report that doesn't mention a debian bug ID.
The changes are not identical to the suggested debian patch.
Too much code was being shared between the extended command window
and the popup dialogs for player selection, causing an uninitialized
variable to be referenced, often resulting in a core dump.
Add support for hilite_pet to X11 text map mode (hilite_pet was already
supported when tiles were enabled). While testing this, I found a missing
newsym() in the code implementing the creation of a "tame" monster.
1. Switch to low-level console routines for performance improvements.
2. Instead of moving the cursor around like a real tty, just track the
destination coordinates of where the cursor should be, and
defer the movement until user input is expected.
Credit to <Someone> for #2.
On September 11, 2003 "<Someone>" wrote:
> When we're going to have a different save file format, could
> the last messages in the message history be saved as well, so
> ^P would work the same before and after saving (possibly
> including a few less messages to make room for the startup
> messages?).
This seemed like a reasonable request. This patch:
- adds the core support required.
- adds the tty supporting routines.
Prompted by a question from Pat a long time back, this change finally allows
tiles or text map mode to be chosen dynamically at runtime (using the
"tiled_map" option) rather than having to pick it via an X resource and
keep your selection until you exit. This brings map mode selection up to a
level similar to most other graphical window ports.
In addition, the map mode automatically switches to text on the Rogue
level, also like other graphical window ports.
The default mode for the X11 binary is now tiles, once again, like most (all?)
other graphical window ports.
The patch also removes some dead X11 code that is unlikely to be useful again.
Introduce a new set of functions to manage delayed killers in the trunk, used
in addressing the various reports of delayed killer confusion. Since existing
delayed killers are related to player properties, the delayed killers are
keyed by uprop indexes. I did this to avoid adding yet another set of
similar identifiers.
- the new delayed_killer() is used for stoning, sliming, sickness, and
delayed self-genocide while polymorphed. Some other timed events don't
use it (and didn't use the old delayed_killer variable) because they
use a fixed message when the timeout occurs.
- A new data structure, struct kinfo, is used to track both delayed and
immediate killers. This encapsulates all the info involved with
identifying a killer. The structure contains a buffer, which subsumes the
old killer_buf and several other buffers that didn't/couldn't use killer_buf.
- the killer list is saved and restored as part of the game state.
- the special case of usick_cause was removed and a delayed killer list
entry is now used in its place
- common code dealing with (un)sliming is moved to a new make_slimed function
- attempted to update all make dependencies for new end.c -> lev.h
dependency, sorry if I messed any up
trunk and branch:
Do not limit role selection list by race/gender/alignment. The default.nh
selection will still be honored but the list itself will include every
possible role.
Some interface tweaks for main trunk:
- improved calculation of the size of the menu window
- made auto-arrange windows on/off option (it was reset automatically
which was unintuitive and in some cases annoying, IMO)
Pat Rankin wrote:
> collect them all into some new struct and
> save that separately rather than jamming more non-option stuff
> into struct flags.
This patch:
- collects all context/tracking related fields from flags
into a new structure called "context."
It also adds the following to the new structure:
- stethoscope turn support
- victual support
- tin support
This is an initial round of SAFERHANGUP hangup changes. It introduces
SAFERHANGUP, provides the core framework, and enables it for UNIX.
Window-port changes are provided for win/tty, win/X11 and win/gnome. Qt
changes should be forthcoming after having Warwick look at them.
window.doc is updated so windowport maintainers have an clue what needs to
be done to support SAFERHANGUP.
> The bug involved using the initalign (and related) indexes into
> the array of alignments as indexes into the respective combo box,
> and these are (apparently) not equivalent. To fix, the combo box
> is queried one by one for the item with the index that produces
> that proper alignment value, and then uses that index found. I
> did not find an API that does this in one step, but this only
> happens once, at dialog initialization.
The Info.plist file contains vital information about a given
application package. Rename the file from .pli to .plist (note
that other files in this directory use long extensions).
Also correct and add to some of the information in this file.
Changes are: Complete copyright notice, Versions using dot format instead of comma format, and nulls at the end of strings (required, at least for Windows 2000).
Build and install the NetHack.ad file, and change the nethack.sh to append
the HACKDIR to the XUSERFILESEARCHPATH. This means users do not have to
do anything special to use the NetHack X11 resources, nor does it require
teaching nethack where the X11 app-defaults directory is. The change also
updates the X11 and linux doc files in a corresponding way.
- set correct checkmark on "Lock Windows" menu item on startup
- redraw message window on resizing (it does not update properly otherwise)
- fixed copy/paste error in read registry settings function