Commit Graph

41 Commits

Author SHA1 Message Date
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
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
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
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
nethack.allison
416412f92b Remove vestiges of old overlay source split
[trunk only]
2003-09-05 02:45:18 +00:00
nethack.allison
b750eee32a fix display problem with tabs on win32tty 2003-07-27 03:22:15 +00:00
nethack.allison
99bcdf6a4e expand wincap options to second field
<Someone> wishes to add a couple of new options to the wince port ("run fullscreen" and "do not use CE software keyboard").

The wincap field was full, so this adds a second field for
additional options.
2003-07-17 01:35:31 +00:00
nethack.allison
03456ea341 MSDOS autocompletion fix 2002-12-24 02:20:50 +00:00
nethack.allison
5127800475 autocomplete fix for win32
The problem with the new autocomplete was tracked down to
be the result of differences between different implementations
of backsp().  The differences go all the way back to the
early MSDOS port by the look of it, and the win32,
and Mac tty ports all seemed to pattern themselves after the
MSDOS port for that routine.  Apparently, it didn't cause any
harm until now.

The problem is that backsp() sends a character sequence
of 0x08, 0x20, 0x08 on at least those ports, where the Unix
tty code only sends 0x08.  So the characters in the new
autocomplete were all being erased from the screen.

This patch only fixes the win32 tty port, so I've left the
conditional code in getline.c for DOS and Mac. I
2002-12-23 12:49:56 +00:00
nethack.allison
f48ee27d5e make recent autocomplete changes conditional
- there are problems with the changes on
at least the win32 tty port.
2002-12-22 02:46:08 +00:00
cohrs
ed39497b21 tty autocomplete
Change tty extended command autocomplete, based loosely on <Someone>'s
patch, to allow you to type autocompleted characters.  That is, you can type
characters the autocompleter inserted without invalidating the command.
I haven't looked closely, but at least some other windowport extended
command readers seem to already behave similarly.
2002-12-12 06:16:39 +00:00
nethack.rankin
329ce86056 different extended command bit (tty)
I've found myself adding a trailing space to various extend
commands from time to time, and the program fails to recognize then
when that happens.  It might be less likely once none of them has
any embedded spaces, but this wouldn't hurt anything if that becomes
the case.
2002-10-10 23:16:02 +00:00
nethack.rankin
737294a517 build fix 2002-09-28 09:35:22 +00:00
nethack.allison
6bebdbb135 win32 USER_SOUNDS
This uses pmatch() as a default pattern matcher,
and #defines USER_SOUNDS_REGEX for Qt
to enable the code for regular expressions.

This is enabled for win32tty and win32gui.
2002-09-02 23:28:54 +00:00
cohrs
a78e08d0c5 B08020 - partial fix for D<count>$ behavior
When GOLDOBJ is defined, dropping partial amounts of gold using the D
command would not work because gold currently has the same inventory letter
as the coin group accelerator.  In this case, the group accelerator should
not be used, since it confuses counts.  tty and X11 ports are fixed.  The
tty change should fix the Windows console version as well (untested).
2002-08-21 16:57:21 +00:00
nethack.allison
4bdcf771b2 win32tty: allow ^C to abort game
at the "Who are you?" prompt.
2002-08-05 02:06:32 +00:00
warwick
fb4f19662b Honour more WINCAP flags. 2002-07-29 05:19:49 +00:00
cohrs
d79e5a8917 R812 - tty color/inverse video interaction
With some TERMs, disabling inverse video also disables color.
Work around: explicitly turn off color when turning off inverse video.
2002-04-21 19:01:57 +00:00
nethack.allison
5d3448fc16 Message recall window extensions
by <Someone>

(the following text accompanies the patch at <Someone>'s web page)

add more configurability to the new msg_window option of [..]3.4.0.
It allows the configuration option to take an optional parameter to
specify the style of message history display to use.

allows the following configuration options:

msg_window:s - single message (as was the default in 3.3.0)
msg_window:c - combination; two messages in 'single', then as 'full'
msg_window:f - full window; oldest message first
msg_window:r - full window reversed; newest message first

In the event of no parameter being provided,
the patch is compatible with the current 3.4.0 behaviour:
msg_window = 'full'
!msg_window = 'single'
msg_window can be configured for these options in the
Options menu (Shift-O)
msg_window stores the current window type in the non-persistent
iflags structure, which means that savefile/bones files should be
100% compatible with Vanilla, but at the disadvantage that your
customisations to msg_window will be replaced with your
defaults.nh (or ~/.nethackrc) value every time you restart a saved game.
Credits:

The patch draws inspiration (and code snippets) extensively
from <Someone>'s original msg_window patch, [...] as well as <Someone>'s code for reverse ordering implemented until recently in
Slash'em.
2002-04-20 14:16:23 +00:00
cohrs
1ca03c750d tty message loss
- typing ESC would lose messages if msg_window was not displayed
- incorporate <Someone>'s fix, which causes them to be tracked, just not
displayed, and thus still available for ^P viewing later on
2002-04-14 21:45:33 +00:00
nethack.allison
69ee06a9bc Two new options
Add "travel" boolean option to enable/disable travel command.
Add "mouse_support" wincap option to enable/disable mouse.

- When running the win32 tty version full-screen, some people
complained about the square mouse cursor.

Newsgroups: rec.games.roguelike.nethack
Subject: Re: Getting rid of the cursor?
<email deleted> <email deleted>
Followup-To:

On Thu, 04 Apr 2002 00:20:06 <email deleted> wrote:
> Ok, let me be more specific: when playing the windows non-GUI version, is
> there a way to get rid of the large rectangular white cursor?
>
> <email deleted> wrote in message
> <email deleted>
>> Can you get rid of the cursor in the windows version?  I really hate that
>> thing.
>>

<email deleted>
>Newsgroups: rec.games.roguelike.nethack
>Subject: Disabling Mouse Input
>
>I purchased an older P120 laptop to be able to play Nethack at the hotel.
>I find that I rest my thumbs on the mouse touch pad all too often and my
>@ moves unexpectedly at times. I took a peruse through defaults.nh, but
>came up empty.
>
>Anyone know if mouse input can be disabled?
>
>MRSisson
2002-04-04 03:45:03 +00:00
nethack.allison
b64b2a8b05 more win32 de-MICRO 2002-03-31 05:29:03 +00:00
cohrs
bbb9ded22f R691 - bad cursor positioning debug message
- remove the "#define DEBUG" from wintty.c that caused this message to
be displayed when not in a debugging mode
2002-03-26 21:56:03 +00:00
jwalz
931e38a6d7 <Someone>'s gem changes. 2002-03-20 03:45:07 +00:00
nethack.allison
e787bda52a wintty debug bit 2002-02-25 00:15:56 +00:00
cohrs
a5edf5d01e fix tty crashes for empty news file
- menu-window code could access a null pointer when there was no data
- menu-window code can't handle empty contents, because there's no place
  to position the cursor, so force text mode
- still looked ugly, so added a check to avoid displaying anything if
  the file was empty
2002-02-21 07:10:30 +00:00
nethack.rankin
54d0b2edfd code synch 2002-02-12 02:33:14 +00:00
cohrs
f0829e5a32 tty: msg_window and long messages
the code that puts long messages into the top line inserts newlines into
the message, but the msg_window code wasn't looking for them.
2002-02-10 20:48:01 +00:00
nethack.allison
61bf4b3371 msdos build would still be broken. 2002-02-06 01:56:34 +00:00
nethack.rankin
fec866a08c options fixes
Several boolean options were mis-categorized and became
unsettable during play.  Also, the eight_bit_tty option got
dropped into limbo.  Fixing that revealed a typo which would
have broken compilation for MSDOS.

     `eight_bit_tty' has been renamed `wc_eight_bit_input',
but its only use anywhere in the code is for output.
2002-02-06 01:36:31 +00:00
nethack.allison
742e1e8c90 3.3.2 to 3.4.0 2002-02-04 16:11:00 +00:00
cohrs
f255e2bedd tty: ^C while prompted re-displays last message
- attempt to determine if tty_wait_synch() is called during the ending
 dialogs due to an interrupt, and not re-display the previous message
 at the wrong time
- also, "msg_window display anomaly" fix was missing code to still treat ^P
 properly while in a prompt
2002-02-04 05:57:35 +00:00
cohrs
bdf25aff97 tty: msg_window display anomaly
If you interrupt nethack (^C) in tty windowport mode while a pompt is
displayed and and msg_window=true, it can display the full message history
at an unexpected time.  Detect this and display only the topl, as expected.
2002-02-03 07:46:05 +00:00
nethack.allison
cb6a93641b Adjust window-port related option processing
to allow common parsing in the core, and direct access to the
results by the window port.

Notes:

o Adds a new field, wincap, to the window_procs
structure for setting bits related to the preference
features that the window port supports.  This allows
run-time determination of whether a particular option
setting is applicable to the running window port.  A
window-port is free to support as many, or as few,
of the available options as it wants.  Ensure that
only the ones supported have their corresponding bit
set in window_proc.wincap. [see chart in
doc/window.doc for help with that.]

o The settings I stuck into wincap for each window
port are almost certainly not accurate, so each port
team should review them.  You should only include
the ones that you will actually react to and make
adjustments for if the user changes that option.
Without the setting in wincap, the option won't even
show up in the 'O'ptions menu.

o preference_update() added to the window-port
interface, so that the window-port can be notified
if an option of interest (an option with its
corresponding bit set in wincap field) is
changed.

o provided a genl_preference_update() routine in
windows.c and used it for all the existing
window ports since they don't have a functional
one of their own yet.

o this messes around heavily with iflags and the options
arrays in options.c

o I hope I didn't break any port's existing code. I
tried not to.  The Mac however, in particular, should
be looked at because it suffered a namespace collision
with what I was working on around fontname.  It had
Mac specific font stuff in options.c. Please test
the Mac.
2002-02-03 05:31:47 +00:00
cohrs
dc6392f77f tty pet hiliting may turn off on color changes
check to turn on hilite must come after check to change color, since
changing color uses term_end_color which may turn off inverse video too
2002-01-31 03:21:39 +00:00
cohrs
c77073be31 sync changes since last snapshot 2002-01-07 02:12:04 +00:00
jwalz
4ea8692373 *** empty log message *** 2002-01-05 21:06:02 +00:00
jwalz
1c4b42dd03 *** empty log message *** 2002-01-05 21:06:02 +00:00
jwalz
f4ed144a00 *** empty log message *** 2002-01-05 21:06:02 +00:00
jwalz
4e009433ed *** empty log message *** 2002-01-05 21:06:02 +00:00