Commit Graph

43 Commits

Author SHA1 Message Date
Pasi Kallinen
69f7a78dba Hilite Status: Improved
Allow defining multiple stops per field. Add hitpointbar.
2017-09-26 10:04:25 +03:00
nhmall
b9ab9aae2a use NO_GLYPH as an indicator to ignore background glyph
Changes to be committed:
	modified:   doc/window.doc
	modified:   src/display.c
2015-06-09 21:56:28 -04:00
Pasi Kallinen
e15f7be909 Add the mapglyph special flags to window doc 2015-06-09 17:46:30 +03:00
nhmall
c3a77914a9 Modify the window interface for print_glyph
Changes to be committed:
	modified:   doc/window.doc
	modified:   include/qt_win.h
	modified:   include/trampoli.h
	modified:   include/winX.h
	modified:   include/wingem.h
	modified:   include/winprocs.h
	modified:   include/wintty.h
	modified:   src/display.c
	modified:   src/windows.c
	modified:   sys/amiga/winami.p
	modified:   sys/amiga/winfuncs.c
	modified:   sys/amiga/winproto.h
	modified:   sys/wince/mswproc.c
	modified:   sys/wince/winMS.h
	modified:   win/Qt/qt_win.cpp
	modified:   win/X11/winmap.c
	modified:   win/chain/wc_chainin.c
	modified:   win/chain/wc_chainout.c
	modified:   win/chain/wc_trace.c
	modified:   win/gem/wingem.c
	modified:   win/gem/wingem1.c
	modified:   win/gnome/gnbind.c
	modified:   win/tty/wintty.c
	modified:   win/win32/mswproc.c
	modified:   win/win32/winMS.h

print_glyph now takes a second parameter.

Tiles on tiled ports always looked odd on places like the plane of air
where the background color of the tile didn't match the general background
of the surrounding area.

3.6 made that even worse and more glaringly noticeable with the introduction
of darkened room tiles.

The code to actually send something useful through the new parameter
for window ports to take advantage if they want will follow.
2015-06-08 19:37:26 -04:00
Sean Hunt
1c081b1647 Remove stale version control lines. 2015-05-25 09:21:31 +09:00
karnov
2a907f894e Version number increment 2015-05-06 22:04:27 -04:00
keni
03140969ee Bulk recovery of file CVS headers and addition of NHDT- headers. 2015-02-26 09:19:03 -05:00
nethack.rankin
b88c51deae bones tracking (trunk only)
Quite a long time ago, the developer/administrator of the 'hearse'
bones respository asked to have bones files augmented so that they could
be correlated with logfile entries.  He was forced to approximate it by
comparing file date+time with logfile date, which won't work well if there
are multiple deaths at roughly the same time, or perhaps even on the same
day.  This adds character name plus role, race, gender, alignment, the
cause of death, and date plus time of death to the bones file when it is
saved, and reads that data in when a bones file is loaded, then retains
it as part of that level for the remainder of the game.  Dying on a level
that was loaded from bones will chain the new dead hero info to whatever
was there from the previous one(s).  It's written as fixed length strings
padded with spaces before writing the map and its messy details, making
it easy to spot with a simple file browsing tool rather than requiring
something which can interpret nethack level files.  This may need to be
tweaked if players start shelling out of nethack to see whether the
checkpoint file for a newly entered level contains bones info, but at the
moment I'm not going to worry about that.

     TODO:  I wanted the bones and topten date to match, so am obtaining
the current date+time in done() and passing it to both of those and also
to outrip().  Hence the latter now has an additional argument.  So far only
genl_outrip() and hup_outrip() in src and the three outrips in win/chain
have been taught about that; interfaces that supply their own outrip()
need to be updated and probably won't compile right now.  Also, code for
formatting the cause of death has been moved from topten() into a separate
routine so that the new bones code can share it.  genl_outrip() now calls
it too; the various other outrip() routines should be changed to call it
instead of continuing to duplicate that core code.  (I probably should
have made topten.c's killed_by_prefix[] be static in order to force that,
but haven't done so.)

     TODO too:  there ought to be some way of viewing the data for a loaded
bones file from within nethack.  I'll probably add something to the dungeon
overview code to treat it as an implicit annotation, as least in wizard mode.
Showing it in normal play once a level is sufficiently discovered would be
useful, but I'm not sure what criteria should control that.  Neither ghost
nor grave is guaranteed to be present, particularly for levels that were
saved as bones, loaded into a subsequent game, then became new bones when
the second hero died there, which can occur an arbitrary number of times.
2012-01-23 10:41:57 +00:00
keni
7f6ee2f759 WINCHAIN - a framework allowing multiple processors between core and winport
This is the code I built trying to figure out the large window size issue.
It completely compiles out if not needed (see -DWINCHAIN in hints/macos10.7)
and except for one call during setup has zero overhead if compiled in and
not used.  See window.doc for more info.

Defs for UNUSED parms.  I know this has been controversial, so use is isolated
to the chain code and windows.c (where it shouldn't be intrusive and saves about
50 warnings).

Hints file for 10.7, but the build process still needs to be migrated from
the branch.
2012-01-11 18:23:35 +00:00
keni
c119e8c3d9 add param to ini winsys routines
Provide a mechanism for cleanly moving between tentative window system
selections during startup.  Now, before a second (or later) system is selected,
the first will be notified that it is losing control.  See window.doc.
2012-01-10 01:39:31 +00:00
keni
4e5e720334 display version and build info at startup (trunk only)
Tested on the unix port; I've updated as many other ports as I can figure
out but they're not tested.  See window.doc for info on the changed banner
lines.  Also adds the ability to override the generic "Unix" port - used now to get
"MacOSX" into the version line instead of "Unix" (so we don't scare people who don't
know what's going on).
2011-10-11 02:37:31 +00:00
keni
f6e40b8bf8 have core ask windowport if suspend is ok
PORTS: Please make sure I've done the right thing for/to your code.
This patch adds a new winproc that lets the window port approve or cancel
the suspend request - this should take care of the Mac Qt lockup issue.
In addition, Unix suspend is restricted to accounts that can use the shell
if SYSCF is defined.
2010-01-15 17:51:28 +00:00
keni
df20791e59 Add RCS version lines 2009-05-06 10:45:32 +00:00
nethack.rankin
3dc9791685 yn_function (trunk only)
Explicitly truncate the query prompt string to QBUFSZ-1 characters.
For tty and Amiga, no longer include the choices and default within that
length limit; use a bigger buffer to hold them along with the prompt.
-----

     While trying to eliminate the "Query truncated" entries present in
nethack.alt.org's paniclog, I seem to keep going backwards.  Allowing
<win>_yn_function() to accept a full QBUFSZ worth of characters will
simplify the existing yn_function() in the core and greatly simplify the
revised safe_qbuf() I've been working on.

     Some interfaces don't seem to care how long the prompt string is; I've
left those along.  Several of the others already copied the prompt string
into a BUFSZ sized buffer instead of a QBUFSZ sized one, making them
unlikely to suffer from buffer overflows.  This changes the rest (just tty
and Amiga, I think) to do the same.  Also for all that have any size
constraint, it now truncates the prompt query to QBUFSZ-1 chars as it is
used rather than continue to rely on the caller doing so.  This assumes
that appending the set of acceptable choices and the default response won't
overflow, which is a safe assumption unless/until QBUFSZ gets enlarged til
it's too close to BUFSZ.

     Only tty's topl.c has been tested.  The others should work ok, but
might possibly be bitten by a typo or two.  Qt's implementation of the X11
"slow" method (reusing a persistant one-line window for prompts) has been
handled, but its C++ class-based variant is untouched; NetHackQtYnDialog::
Exec() is completely baffling to me but doesn't appear to have any length
issues.
2006-10-22 05:58:17 +00:00
nethack.allison
8fc01eb6b1 window port change - putmixed() (trunk only)
Add putmixed() to the window port. It allows map symbols to
be included in the string by encoding them in a unique fashion.
This was done because Unicode symbols, for instance, could be
longer than the size of a char.

The encoding of the map symbols in this patch is done by
prefixing a glyph value with \GXXXX, where XXXX is a
random value for the current game. The reason for the random
prefix is to minimize the possibility that a player can trigger
the escape sequence processing within text under their control
(dog names, etc.) the way they could if the sequence was fixed
in the source code. The random prefix remains the same throughout
the lifetime of a game because message window strings are
saved in the save file.

(There was actually a bug present because of the embedded
character even before the recent symbol changes, because if
someone was using a  different set of characters between games,
the saved messages would reflect the original characters, rather
than the current. That bug was introduced with the ability to
save messages to the savefile.)

A window port does not have to supply an XXX_putmixed() routine,
it can use genl_putmixed() which uses the old behavior of
embedding the sequence as a character within the string
and calling putstr(). genl_putmixed() takes care of the decoding
of the escape sequence.

This also #ifdef's out code in pager.c for converting a glyph
to a character, and uses mapglyph() to do that instead. Does
anyone see a problem with doing that through mapglyph instead
of repeating similar code within pager.c?
2006-10-17 23:06:31 +00:00
nethack.allison
374e9fbbb4 more symbol stuff (trunk only)
- reduce the number of symbol tables for each graphics
set {PRIMARY, ROGUESET} from three {map, oc, mon}
tables for each of the display symbols, the loadable symbols,
and the rogue symbols, to one continguous table for
each:
showsyms: the current display symbols
l_syms: the loaded, alterable symbols
r_syms: the rogue symbols

- Modify mapglyph so that the index into the symbolt table is
available as a return value (it was a void function), rather than
just the char converted from the glyph.
- That makes it possible for a window port to use the same
index value to extract from another table (perhaps a unicode
table) for a different set of display symbols. The  index
is much more useful than trying to convert the character
into another type of symbol, as some contributed patches
have done.
- It is much easier to load a single alternative flat table to
make substitutions, since the corresponding value just
has to get placed into the same index offset in the
alternative table.

This also fixes a bug I found in botl.c, where you could
go to the rogue level, and the bottom line gold symbol
was not being updated with the new character as it should.
The reason was because the gold value had not changed,
only the field symbol used had changed.

This updates multiple ports to place a (void) cast on
the mapglyph call, now that it returns a value, so this
is going to generate a lot of diff e-mails.
2006-10-01 19:30:08 +00:00
nethack.allison
253bf359af drawing overhaul (trunk only)
This is an overhaul to the NetHack drawing mechanism.

- eliminates the need to have separate lists in drawing.c
for the things and their associated explanations by grouping
those thing together on the same inializer in a struct.

- replaces all of these options: IBMgraphics, DECgraphics, MACgraphics,
graphics, monsters, objects, boulder, traps, effects

- drawing.c contains only the set of NetHack standard symbols for
the main game and a set of NetHack standard symbols for the
roguelevel.

- introduces a symbols file that contains named sets of
symbols that can be loaded at run time making it extensible
for situations like multinational code pages like those reported
by <Someone>, without hardcoding additional sets into the game code.

- symbols file uses names for the symbols, so offsets will not break
when new things are introduced into the game, the way the older
config file uchar load routines did.

- symbols file only contains exceptions to the standard NetHack
set, not entire sets so they are much less verbose than all of
the g_FILLER() entries that were previously in drawing.c

- 'symset' and 'roguesymset' config file options for
preselecting a symbol set from the file called 'symbols'
at startup time. The name of the symbols file is not under the
users control, only the symbol set name desired from within the
symbols file is.

- 'symset' config file option loads a desired symbol set for
everything but the rogue level.

- 'roguesymset' config file option loads a desired symbol set
for the rogue level.

- 'SYMBOLS' config file option allows the user to specify replacement
symbols on a per symbol basis. You can specify as many or as few symbols
as you wish. The symbols are identified by a name:value pair, and line
continuation is supported. Multiple symbol assignments can be made on
the same line if each name:value pair is separated by a comma.
For example:
SYMBOLS = S_bars:\xf0, S_tree: \xf1, S_room:\xfa \
	  S_fountain:\xf4 \
	  S_boulder:0

- 'symbols' file has the following structure:
start: DECgraphics
	Handling: DEC
	S_vwall: \xf8			# meta-x, vertical rule
	S_hwall: \xf1			# meta-q, horizontal rule
finish
start: IBMgraphics
	Handling: IBM
	S_vwall: \xb3			# meta-3, vertical rule
	S_hwall: \xc4			# meta-D, horizontal rule
finish

- 'symbols' file added to the source tree in the dat directory

- Port Makefiles/scripts will need to be adjusted to move them into
HACKDIR destination
2006-09-21 01:46:15 +00:00
cohrs
546add5359 missing copyright
<Someone>, I think, noticed there was no copyright on the window.doc.
Add one.  I don't recall when I originally wrote it, but I last changed
it in 2003, so that's the year I'm putting in.  Anyone else that wants to
share the blame, please add your name and update the year as needed.
2005-01-13 00:34:35 +00:00
nethack.allison
055781aaf2 selectsaved follow-up bit (trunk only) 2005-01-09 21:58:43 +00:00
nethack.allison
15ae774a78 selectsaved option (trunk only)
- always write plname into save file, no longer conditional
- add 'selectsaved' wincap option to control the display of
  a menu of save files for ports/platforms that support it.
- add support for win32 tty using normal nethack menus.
- the win/tty/wintty code is generalized enough that any
  tty port could support the option if the appropriate port-specific
  code hooks for wildcard file lookups are added to src/file.c
  specifically in the get_saved_games() routine. There is posix
  code in there from Warwick already, and there is findfirst/findnext
  code in there from win32. Warwick has the posix code only
  enabled for Qt at present, but with wintty support, that could be expanded
  to other Unix environments quite easily I would think.

Here is what the tty support looks like:

    NetHack, Copyright 1985-2005
         By Stichting Mathematisch Centrum and M. Stephenson.
         See license for details.

    Select one of your saved games
    a - Bob
    b - Fred
    c - June
    d - mine3
    e - Sirius
    f - Start a new character
    (end)

The following files existed in the NetHack SAVEDIR directory
at the time:
    ALLISONMI-Bob.NetHack-saved-game
    ALLISONMI-Fred.NetHack-saved-game
    ALLISONMI-June.NetHack-saved-game
    ALLISONMI-mine3.NetHack-saved-game
    ALLISONMI-Sirius.NetHack-saved-game
Note that despite the file names, the actual character name
is drawn from the savefile.

The WIN32CON support passes
    USER-*.NetHack-saved-game
to findfirst/findnext where USER is your login name of course.
2005-01-09 21:40: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
nethack.allison
ac9b871dc3 status change followup (trunk only)
- Get the HD display working right when Upolyd.
- add a couple of comments.
2003-11-24 03:35:33 +00:00
nethack.allison
5ed547995d status display - core 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:43:17 +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
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
5e94d4478b wraptext port option (from <Someone>)
WC2_WRAPTEXT option was added but core changes
were not included  in the previous wince patch.
2003-08-14 11:04:33 +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
ba5640ce9a window.doc update
Nethack doesn't like zero,
or zero with the meta bit set.
2002-08-23 18:30:01 +00:00
nethack.allison
2ce6152d63 B08021 scroll_amount wincap option
> - I'd like to see another option added: scroll_amount. In
>   combination with scroll_margin, this would control the amount
>   of squares the screen is scrolled when the scroll_margin is
>   reached (currently, this amount is 1, but if I recall
>   correctly, it used to be more). For example, if both were 5,
>   when you came within 5 spaces of the left screen border, the
>   screen would shift 5 spaces to the right).
2002-08-23 01:03:59 +00:00
nethack.allison
411195c75f suggestions from <Someone> 2002-08-21 11:02:56 +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
1b898867c5 document set_option_mod_status in window.doc 2002-03-12 14:10:24 +00:00
nethack.allison
ec892c14d9 a statement in window.doc didn't reflect code 2002-03-12 11:59:10 +00:00
nethack.allison
2baa20217f beta feedback - add more wc options
- splash_screen (boolean for whether to display splash screen at startup)
- player_selection:dialog|prompts

Also moves the font and window manipulation stuff in defaults.nh
further down the file, so that a tty users doesn't have to wade
through it all to find the character adjustment samples.
2002-03-12 05:15:40 +00:00
nethack.allison
3c0e37d9c9 add windowcolors option
Add option windowcolors to control foreground/background
color of menu, message, status, and text windows.
(foreground color is the text color).

The value of the colors is window port specific, the
core code handles the storing of the strings only.
2002-03-05 05:03:48 +00:00
nethack.allison
4b364d6927 modifying 'O' command behavour
I was asked how a window-port controls which options are
set to SET_IN_FILE, DISP_IN_GAME, or SET_IN_GAME.

This provides a run-time way to change an option's SET_IN_FILE,
DISP_IN_GAME, or SET_IN_GAME status through code, rather
than clog up options.c with a lot of compile-time #ifdefs
for different ports to offer different default option settings.
Update the documentation to reflect this.
2002-02-07 03:23:55 +00:00
nethack.allison
86a5808030 Documentation updates
Document the change to the window options and
correct a typo that Yitzhak pointed out in window.doc
2002-02-04 17:03:08 +00:00
nethack.allison
06528d1002 3.3.2 to 3.4.0 2002-02-04 16:06:00 +00:00
nethack.allison
bd44ec4f65 wincap field updates
As Warwick suggested, instead of having fixed tile
sizes as options, allow specification of the size
explicitly.

Also, at Yitzhak's suggestion, provide a hook for
overriding the port's tile file name.  That name,
and the contents of the file it points to, will
be window-port specific of course.
2002-02-04 12:50:46 +00:00
nethack.allison
d554a8fcdc update window.doc document. 2002-02-03 16:29:41 +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
04ecb2e1a2 window.doc getlin clarification
Clarify the getlin interface, which is used with the implicit assumption
that an input buffer of size BUFSZ (including the nul) is sufficient.
2002-01-24 03:13:56 +00:00
jwalz
758f4c409d *** empty log message *** 2002-01-05 21:05:47 +00:00