Commit Graph

394 Commits

Author SHA1 Message Date
nethack.allison
e9b022d579 housekeeping: mark trunk sources 3.5 (misc) 2005-01-02 17:21:18 +00:00
cohrs
a6bff50803 X11 map scrolling behavior [from Steve VanDevender]
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.
2004-10-03 22:04:20 +00:00
cohrs
4c9d161953 missing scrollbar in X11_display_file [from Steve VanDevender]
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.
2004-10-03 21:59:18 +00:00
warwick
5d72e0be52 Make "black" characters visible.
Stop RIP window maximizing (C syntax!).
Make Cancel button more sensible.
2004-07-01 18:21:51 +00:00
nethack.allison
85924518ec win32gui temporary build fix (from <Someone>)
> The trunk did not compile when STATUS_VIA_WINDOWPORT was set. > This patch fixes that (for the time being).
2004-06-02 11:10:24 +00:00
nethack.allison
10480f4397 core support for status field highlighting (trunk only)
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.
2003-11-30 05:51:53 +00:00
cohrs
43664aa310 interim status support for X11 and gnome
so these window ports can compile with STATUS_VIA_WINDOWPORT defined
2003-11-26 23:42:10 +00:00
nethack.allison
586a805c8f status display - port modules (trunk only)
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.
2003-11-23 06:47:13 +00:00
cohrs
800baf8771 B01001 - bold menu_heading support
Not really a bug, but when TEXTCOLOR is defined, wintty can display menu
headings is bold upon request, but didn't.
2003-11-10 00:15:47 +00:00
nethack.allison
dbb1d0f230 saving msg history glitch (trunk only)
<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.
2003-10-27 00:23:22 +00:00
nethack.allison
211666434c more win32tty clean-up
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.
2003-10-26 15:56:50 +00:00
nethack.allison
fa8956dbb9 win32gui build fix (from <Someone>)
<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.
2003-10-25 14:45:51 +00:00
nethack.allison
58f322841d more win32tty fixes
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.
2003-10-25 04:02:24 +00:00
nethack.allison
45dd5ffe9f win32tty: startup msg cleanup
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
2003-10-24 15:15:44 +00:00
cohrs
cc52b2f533 extra control characters in 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.
2003-10-23 01:30:05 +00:00
cohrs
eab9e5f0a3 gnome does not like ^C
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.
2003-10-21 01:06:05 +00:00
cohrs
50450b7dd5 debian bug #154629 followup
further testing found a trivial bug
2003-10-15 06:47:22 +00:00
cohrs
dadeed21d2 debian bug #154629 - extended commands in gnome front end
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
2003-10-15 06:02:27 +00:00
cohrs
bf476cae6e additional gnome SAFERHANGUP changes
Found more places where gnome interface wasn't cleaning up.
2003-10-15 02:36:34 +00:00
nethack.allison
d7ae45997c newline 2003-10-14 10:31:11 +00:00
cohrs
9dc6ad96da additional X11 SAFERHANGUP changes
While messing around with window closure events, I found that some such
events during startup were being ignored as a result a SAFERHANGUP changes.
2003-10-14 07:55:36 +00:00
cohrs
cc2105b7b4 debian #184911 - quitting while tty mode inventory is displayed
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.
2003-10-14 07:35:01 +00:00
cohrs
0d533b7b39 debian #170531 - sign extension in gnome input
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.
2003-10-14 07:07:40 +00:00
cohrs
120d0b0295 debian #154627 - quiver menu item in gnome interface
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.
2003-10-14 07:00:13 +00:00
cohrs
bf98bc9fe8 qt gcc warnings
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.
2003-10-13 21:17:12 +00:00
cohrs
3480525053 debian bug 71234 - closing player selection window causes core dump
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.
2003-10-13 20:24:17 +00:00
nethack.allison
21eaf22be4 win32gui message history; also clipboard support (from <Someone>)
- added 2 menu options: Copy ASCII Screenshot To Clipboard, Save
  ASCII Screenshot To File
- implemented saving message history
2003-10-13 14:48:13 +00:00
cohrs
f6425ee3c5 X11 hilite_pet
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.
2003-10-12 03:55:17 +00:00
nethack.allison
bc70857749 win32tty changes
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.
2003-10-05 23:00:05 +00:00
nethack.allison
f6f6c1f0d5 saving message history (trunk only)
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.
2003-10-05 13:43:16 +00:00
cohrs
a5c8b517d2 X11 dynamic map mode selection
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.
2003-10-03 02:09:27 +00:00
nethack.allison
0594b9b621 win32gui: missing but for UI tweaks (from <Someone>)
"Count: XXXX" was getting cut-off in the menu
2003-09-30 03:44:34 +00:00
nethack.allison
1bdf37ec00 SAFERHANGUP win32gui (from <Someone>) 2003-09-30 03:42:01 +00:00
cohrs
559be58c21 conflicting delayed killers
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
2003-09-29 19:24:20 +00:00
nethack.allison
64e75e05e4 win32gui (from <Someone>)
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)
2003-09-27 12:30:28 +00:00
nethack.allison
c12d797531 trunk only: preserving context (remaining files)
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
2003-09-21 11:57:26 +00:00
jwalz
c3960b1d49 SAFERHANGUP followup
We've previously been supporting R4+ for X11, but signals weren't added
until R6.  This at least lets it compile under R5.
2003-09-19 16:32:41 +00:00
cohrs
22fe9838f3 SAFERHANGUP support for win/Qt.
Now all the current Unix window-ports support it.
2003-09-19 04:08:37 +00:00
cohrs
40b5b12673 SAFERHANGUP
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.
2003-09-19 03:15:49 +00:00
warwick
b6ff9d7d73 Use __BIG_ENDIAN__ rather than __ppc__ (more portable, more meaningful). 2003-09-16 00:20:18 +00:00
warwick
9d83d474f4 Solve a number of MacOSX problems. 2003-09-11 04:25:52 +00:00
warwick
4c2486026e Work on BigEndian systems too. Only __ppc__ detected for now (Mac OS X). 2003-09-11 04:00:21 +00:00
nethack.allison
416412f92b Remove vestiges of old overlay source split
[trunk only]
2003-09-05 02:45:18 +00:00
nethack.allison
e382e3b055 U613 specifying alignment in win32 and CE (from Yitzhak)
> 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.
2003-09-03 03:57:32 +00:00
kmhugo
1c17e4087a Qt/MacOS X tidbit
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.
2003-09-03 00:16:51 +00:00
nethack.allison
cea7c0399d (from <Someone>) 2003-08-28 05:52:02 +00:00
nethack.allison
ee8ae0ed8b version info (from Yitzhak)
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).
2003-08-28 05:46:50 +00:00
cohrs
648b1489a4 X11 install
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.
2003-08-26 15:11:58 +00:00
nethack.allison
1fd577124b win32 bits for main trunk (from <Someone>)
- 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
2003-08-20 11:39:57 +00:00
nethack.allison
31a2c8cefa #U567: lootiing counts (from <Someone>) 2003-07-31 11:11:17 +00:00