Commit Graph

15861 Commits

Author SHA1 Message Date
nhmall
a92c1b7163 Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2023-11-17 14:21:42 -05:00
nhmall
d7ed474fa7 2nd follow-up to alternative fix for menu search (':') 2023-11-17 14:13:58 -05:00
nhmall
4803022e90 Revert "follow-up for alternative fix for menu search (':')"
This reverts commit 569955ccac.
2023-11-17 13:54:41 -05:00
nhmall
b3024c3c6c Revert "follow-up for alternative fix for menu search (':')"
This reverts commit 569955ccac.
2023-11-17 13:46:13 -05:00
nhmall
569955ccac follow-up for alternative fix for menu search (':') 2023-11-17 13:40:38 -05:00
nhmall
0a13d759a3 more bot() tinkering 2023-11-17 09:47:39 -05:00
nhmall
a46c71f4c5 replace useful descriptive comment in tty getline 2023-11-17 09:04:27 -05:00
nhmall
7903849939 follow-up: program_state variables are int 2023-11-17 08:42:43 -05:00
nhmall
8d1001842d alternative fix for menu search (':')
This avoids clearing core context variables within a window port.
2023-11-17 08:37:54 -05:00
PatR
a49c872f47 another 'm #overview' fix
Once in the endgame, suppress non-endgame levels from the 'm #overview'
annotation menu like is already done for normal #overview.
2023-11-17 00:43:06 -08:00
PatR
387cef9899 'm #overview' enhancement
When using the 'm' prefix with #overview to get a menu of visited
levels and then picking one to annotate, replace the generic prompt
"what do you want to call this dungeon level?" with more specific
location information.  Location details are visible while within the
menu but as soon as you choose something that goes away.
2023-11-17 00:36:43 -08:00
PatR
3accaf9c53 PR #1142 - show level annotation when restoring
Pull request from entrez:  when issuing the "welcome back" message
when restoring, print the current level's player-suppliedannotation
if there is one.  Doesn't show automatically generated annotations
like "Oralce of Delphi" or "a sink" or "stairs to the Gnomish Mines".

Closes #1142
2023-11-16 23:16:54 -08:00
Michael Meyer
f5a22ff5f8 Print current level annotation when restoring
Sometimes I annotate a level with a note like "watch out, chameleon
below", which is useful to remind myself of some danger or thing to
remember when returning to the level -- but if saving and restoring on
the level itself there's no reminder of that annotation.  If you restore
on a level with an annotation, print it as part of the "welcome back"
message.
2023-11-16 23:15:04 -08:00
PatR
73fed3d5d8 tty: menu search (':') fix
'm O' is a prime candidate for using ':' to select a menu item since
you can use that to avoid scrolling through many pages, but typing ':'
would immediately overwrite two or three lines of the menu with a
status refresh.  curses doesn't suffer from this problem.  X11 and Qt
show menus in separate windows do don't either.  Not sure about WinGUI.

I think that this may have been reported in the past, but if so I don't
recall by whom, or why it wasn't addressed.
2023-11-16 23:11:54 -08:00
nhmall
a82a897da3 avoid ctrl_nhwindow-related impossible
Remove the impossible(), so that new functionality can be added
incrementally without requiring every window-port to be visited up front.
2023-11-16 21:00:59 -05:00
nhmall
ce587ac3b0 menu heading tweaking Take 2
Apparently, color option is meant to apply only to the map, so doesn't
need to appear here, and the reference on the previous commit was wrong.

    <curses guicolor>
    on: map, menu items, menu headings, menu prompt/title can all feature color, as can
    menu borders, menu-selector letters.
    off: map, menu headings, menu prompt and menu items (menucolors on) can still feature color,
    but all other non-map features such as menu borders, menu-selector
    letters will not have color.

    <menucolors>
    on: menu items can have colors if they match one of the regex in config
    file; menu headings, menu prompt can also be in color (based on menu_headings option).
    off: menu items won't have colors, but menu headings, menu prompt still
    will feature colors (based on menu_headings option); those are not impacted by turning
    off menucolors.
2023-11-16 17:57:22 -05:00
nhmall
bb10f9a5d0 more menu header tweaking re options
<color>
off: map, menu items, menu headings, menu prompt/title all, everything should have color suppressed.

<curses guicolor>
on: map, menu items, menu headings, menu prompt/title can all feature color, as can
menu borders, menu-selector letters.
off: map, menu headings, menu prompt and menu items (menucolors on) can still feature color,
but all other non-map features such as menu borders, menu-selector
letters will not have color.

<menucolors>
on: menu items can have colors if they match one of the regex in config
file; menu headings, menu prompt can also be in color (based on menu_headings option).
off: menu items won't have colors, but menu headings, menu prompt still
will feature colors (based on menu_headings option); those are not impacted by turning
off menucolors.
2023-11-16 13:41:07 -05:00
nhmall
7beef848c4 fix a strange bug with option menu
It was impossible to select entry 62 in the allopt[] array
from the 'm O' menu, apparently because of a collision with
the ascii value of a question mark.

Entry 62 was currently the guicolor option.
2023-11-16 07:56:01 -05:00
nhmall
d76176c41b pass menu_headings not test value for title 2023-11-16 06:01:07 -05:00
nhmall
bc2c2f5138 follow-up to correct syntax error in Windows build 2023-11-16 00:12:41 -05:00
nhmall
86067dcffd use ctrl_nhwindow() for menu prompt style
This implements the mechanics to use the ctrl_nhwindow() interface
capability to pass down a setting change from the core to the active
window port, without resorting to accessing a core global variable
from within the window port, and without altering the interface..

The passed setting is honored in the tty and curses window ports.

X11 and mswin receive and store the values, but no implementation
to change the menu prompt style is there yet.

Qt does not store the values or have an implementation.

The setting change is done in allmain.c immediately after
creating the WIN_INVEN window.
2023-11-16 00:10:06 -05:00
nhmall
657d0f6105 fix an incorrect ESC sequence (cut and paste err) 2023-11-15 21:19:02 -05:00
nhmall
a08b2e254a get rid of a warning during our pdcursesmod build
../lib/pdcursesmod/dos/../common/dosutil.c:36:15: warning: comparison of integer expressions of different signedness: 'long int' and 'long unsigned int' [-Wsign-compare]
   36 |     while( ms > MAX_NAP_SPAN)
      |               ^

It isn't something that we can actually resolve within NetHack,
so just suppress the submodule build warning.

This commit will trigger the CI to carry out a test of the build.
There could be some follow-up after the results.
2023-11-15 13:28:50 -05:00
nhmall
c85900320c fetch dos extender from a different location
CI was having difficulty connecting
2023-11-15 12:33:07 -05:00
nhmall
97ddfd9355 curses menu_heading repairs 2023-11-15 11:11:55 -05:00
PatR
fc52f0ef42 'menu_headings' option
If the value is "no color&none" report it as "no-color&none" in 'm O'
and for #saveoptions.

Allow "OPTIONS=menu_headings" without any color or attribute value to
mean "no-color&inverse" as it once did before the player could choose
which attribute or color was supported, and matching the default used
when 'menu_headings' hasn't been specified at all.

Accept "OPTIONS=!menu_headings", meaning "no-color&none".

Explicitly reject "OPTIONS=!menu_headings:anything".  It was rejecting
that due to blanket rejection of negated option, but reporting "can't
both have a value and be negated" whether there was any value present
or not.

For preselected menu entries when interactively choosing a new value
via the submenu of 'm O', use the current color and attribute rather
than NO_COLOR and ATR_NONE.
2023-11-14 21:33:09 -08:00
Pasi Kallinen
830168f26e Update comment 2023-11-15 07:26:21 +02:00
PatR
d748dbaa12 more menu headings
Simplify suppression of highlighting for menu header lines during end
of game disclosure.  Didn't actually affect as many things as I was
expecting.

Plus a bit left out of the optfn_dogname() parsing commit.
2023-11-14 17:51:27 -08:00
PatR
b8063ee07c option parsing
Get rid of all the unnecessary 'if (!opts)' checks if the optfn_xx()
routines.

Replace the replicated contents of optfn_catname(), optfn_dogname(),
and optfn_horsename() with a common routine.  optfn_dogname() was
different from the other two for no discernable reason.  Player can
no longer assign the name "none" to an initial pet via RC file,
although there's nothing preventing doing so with C/#name command.
2023-11-14 12:59:30 -08:00
PatR
c36d614c3a pull request #1132 - unnecessary options test
Pull request from argrath:  optfn_pickup_types checks 'opts' for
whether it is Null after having already used it without checking.
Remove the unnecessary test.

Closes #1132
2023-11-14 11:43:43 -08:00
SHIRAKATA Kentaro
51042bb0df remove unnecessary condition on optfn_pickup_types()
`opts` here is always non-null, otherwise it leads segv at earlier code.
2023-11-14 11:40:34 -08:00
PatR
88e2ee192d perminv_mode: fix menu coloring
The submenu of 'm O' for recently added option 'perminv_mode' didn't
have color 0 changed to NO_COLOR.  On tty the entries came out blue,
on X11 they were nearly invisible.  Qt and curses didn't seem to care.

I checked all the add_menu() calls in src/*.c and managed to refrain
from the impulse to reformat, mostly.
2023-11-13 23:32:38 -08:00
nhmall
d064ac2cda more cast style consistency 2023-11-13 20:31:02 -05:00
nhmall
ee732d4054 leading tab to spaces 2023-11-13 19:40:49 -05:00
nhmall
a7242760f7 consistent cast syntax 2023-11-13 19:28:19 -05:00
nhmall
b4bb3b92a2 replace E with extern in the last file like that 2023-11-13 15:00:44 -05:00
nhmall
6e91482be0 hands_obj follow-up 2023-11-13 14:20:54 -05:00
nhmall
5b2ec5d6ee minor optomization - explicity avoid menucolors 2023-11-13 14:00:02 -05:00
Pasi Kallinen
d2ca1794df Move other add_menu routines to windows.c 2023-11-13 20:12:47 +02:00
nhmall
4b79baa55b add_menu follow-up, part 2 of interface adjustment
Remove menu_color support from the window port side of the interface.
The window port just has to honor the color parameter that was added
to the add_menu() interface definition in June 2022 commit
2770223d10, and let the core-side of
the interface handle things.

To that end, this does the following:

Removes the #define of add_menu() from include/winprocs.h and add a
real core-side add_menu() function to windows.c which acts as a
trampoline to the window port win_add_menu() function, while providing
a single location to adjust the parameters passed to the window port
function. get_menu_coloring() is now called in there.

Moves get_menu_coloring() from options.c into windows.c and makes it
static.

Removes all the calls to get_menu_coloring() from the tty, Qt, X11,
curses, and win32 interfaces and adjusts their code to simply honor
the color parameter in add_menu, similar to what the menu_headings
change from earlier today did.
2023-11-13 12:56:38 -05:00
PatR
59a74a00fd pull request #1131 - wand explosion
Pull request from argrath:  eliminate some 'goto's by splitting the
explosion portion of wand-breaking into a separate routine.

Closes #1131
2023-11-13 07:32:05 -08:00
SHIRAKATA Kentaro
4250dd91d8 split wand explosion into separate function 2023-11-13 07:24:15 -08:00
nhw_cron
86914f03f0 This is cron-daily v1-May-8-2022. 005guidebook updated: doc/Guidebook.txt 2023-11-13 08:26:36 -05:00
nhmall
31a46e72c0 Guidebook date stamp 2023-11-13 07:46:17 -05:00
nhw_cron
62d8d5858f This is cron-daily v1-May-8-2022. 005guidebook updated: doc/Guidebook.txt 2023-11-13 07:39:05 -05:00
nhmall
682ae10f51 missing prototype warning ifndef TEXTCOLOR
../win/tty/wintty.c: In function ‘set_item_state’:
../win/tty/wintty.c:1174:9: warning: implicit declaration of function
‘term_start_color’; did you mean ‘term_start_attr’?
[-Wimplicit-function-declaration]
 1174 |         term_start_color(item->color);
      |         ^~~~~~~~~~~~~~~~
      |         term_start_attr
 ../win/tty/wintty.c:1178:9: warning: implicit declaration
 of function ‘term_end_color’; did you mean ‘term_end_attr’?
 [-Wimplicit-function-declaration]
 1178 |         term_end_color();
      |         ^~~~~~~~~~~~~~
      |         term_end_attr
2023-11-13 07:26:04 -05:00
Pasi Kallinen
f74f7988ff MSDOS: implement valid location highlighting
... for VGA and VESA tiled map.
2023-11-13 12:40:10 +02:00
Pasi Kallinen
dd5ca5b058 Change menu_headings to accept color and attribute
Instead of just accepting an attribute, it's now possible to
use a color, or both color and attribute, for example:

OPTIONS=menu_headings:inverse
OPTIONS=menu_headings:red
OPTIONS=menu_headings:red&underline

Default is still just inverse.
This lets the player change the menu heading color without
needing to use menu colors for them.

Also makes it so the core uses NO_COLOR instead of 0, for all
the menu lines which don't have any prefedefined color.

Tested for tty, curses, x11, qt, and win32
2023-11-13 07:33:56 +02:00
PatR
dd6c249a8c remove obsolete comment 2023-11-12 10:26:59 -08:00
PatR
fcf1a42cac fix for two empty-handed hits
When using bare-handed combat or martial arts at better than 'basic'
skill, don't attempt a second hit if wearing a shield.
2023-11-12 10:21:51 -08:00