Commit Graph

11182 Commits

Author SHA1 Message Date
Bart House
dde11630e8 Modified nhassert_failed to call impossoible. 2020-10-19 15:36:34 -07:00
Bart House
783efd3524 Remove the remapping of snprintf to _snprintf when compiling with MSC.
_snprintf and snprintf have one very important semantic difference.
_snprintf does NOT add terminating null character when the buffer limit
is reached while snprintf guarantees a terminating null character.  It
was a mistake to make this naming change hiding the fact that the
semantics don't match what the developer might expect.
2020-10-19 15:32:58 -07:00
Bart House
7795d82be6 Improved readability of topline state management. 2020-10-19 15:19:09 -07:00
Pasi Kallinen
3a31587ca9 Prevent ghosts from being renamed
(via xNetHack)
2020-10-18 20:28:32 +03:00
Pasi Kallinen
f38cb63714 Spitting monsters try to stay away from melee range 2020-10-18 19:18:38 +03:00
PatR
9a6bc0fd8f Qt status window icon alignment
When the game windows were initialized, the anhk icon for alignment
was centered relative to Lawful/Neutral/Chaotic label but during
the first status update it noticeably shifted left.  Non-blank
hunger or encumbrance states could change from centered to left
justified when they were present and the icon was replaced.  Oddly,
resetting the 'centered' attribute for the widget wasn't sufficient
to fix this.  Running the resize code for that widget did.  Another
case of trial and error to make things work the way they ought.

Also, don't highlight a change in alignment or dungeon location as
"got worse" if the internal numeric value went down instead of up;
always highlight as "got better" for those two fields.  There ought
to be a third choice for just "changed" but that would have been
more complicated.
2020-10-17 11:10:00 -07:00
Pasi Kallinen
fc6b491303 Fix thinko in reset travel dest condition 2020-10-17 16:48:07 +03:00
Pasi Kallinen
5ddafa5c81 Only reset if we actually went to travel destination 2020-10-17 12:13:17 +03:00
Pasi Kallinen
a9e4904131 Reset travel destination if reached via teleport 2020-10-17 12:08:51 +03:00
Pasi Kallinen
b6125b8f78 Pre-populate teleport destination prompt with travel destination
This has been implemented in multiple variants, and seems like
a small but useful quality of life improvement.
2020-10-16 19:14:01 +03:00
PatR
9d3dfd59f9 Qt paperdoll - slight reorganization
Three-way swap:  move blindfold to alt-weapon slot, alt-weapon to
quiver slot, and quiver to former blindfold slot.  Affects first
and third rows of the 6x3 grid.

Before  |After
 x H b  | b H q
 S a w  | S a w
 G C q  | G C x

[x=alt-weapon, H=helmet, b=blindfold, S=shield, a=amulet, w=weapon,
 G=gloves, C=cloak, q=quiver; bottom three rows not changed so not
 shown.]
2020-10-15 18:22:26 -07:00
nhmall
4c933fbf3c recognize visual studio 2019 16.7.6 in sys/winnt/Makefile.msc 2020-10-15 09:38:52 -04:00
PatR
a0c6118c97 Qt paperdoll - tool tips used to describe items
New for Qt, moving the mouse over one of the slots in the paperdoll
inventory subset and letting it pause there will use Qt's tool tip
mechanism to give a description of the item under the pointer, if
there is one, or of what the slot would contain when there isn't.

So "e - uncursed leather gloves (being worn)" or "no gloves" when
the pointer is over the glove slot.  If you do something with the
keyboard to make the paperdoll change while the mouse is still
hovering, you'll need to move the pointer slightly to have Qt
recheck for tool tip at that spot.  It may be feasible to force
an immediate update, but I'm satisfied with how it's working.

Interestingly, you can move pointer and hover while yn_function()
has asked you to pick an inventory item and is waiting for an
answer.  Mostly useful for Take-off/Remove or #adjust.
2020-10-14 16:06:25 -07:00
PatR
42b466e87b artifact.h formatting
The automated reformatting way back when left artifact.h in need
of manual fixup, particularly SPFX_HPHDAM.
2020-10-14 09:25:45 -07:00
PatR
6a443226d1 Qt toolbar: add button for 'search'
The toolbar contains do-Again, Pick up, Drop, Kick, Throw, Fire,
Eat, and Rest.  Insert Search in front of Rest since it's useful
in its own right and some players prefer it even when resting.
Includes a new 12x13 icon; a tiny magnifying glass shown straight
on is something I can manage.
2020-10-14 03:02:55 -07:00
PatR
7011b10f64 Qt "Get" -> "Pick up"
Both the toolbar button for pick up and the action menu entry for
pick up were labeled "Get".  That's confusing for an experienced
player who is looking for "Pick up".  Rename both of them.

Also, consolidate repetitive code used to set up toolbar buttons.
2020-10-13 14:05:52 -07:00
PatR
267228d0dd Qt toolbar 'rest' button
An issue in the core made the "Zz" button in the Qt toolbar only
work if rest_on_space was enabled.  cmd_from_func() was returning
' ' instead of '.' for the keystroke to run the rest command.
2020-10-13 13:41:57 -07:00
nhmall
060bfe6f5d Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2020-10-11 14:30:30 -04:00
nhmall
e4473de586 cron daily Files update 2020-10-11 14:29:16 -04:00
nhmall
d9395dcd23 more integration suggestion adoption 2020-10-11 13:42:12 -04:00
nhmall
6806c30a59 adopt some integration suggestions
sys/lib -> sys/libnh
sys/lib/libnethackmain.c -> sys/libnh/libnhmain.c
libnethack.a -> libnh.a
2020-10-11 13:33:51 -04:00
nhmall
0adb64e384 get this working: "make wasm" 2020-10-11 10:51:46 -04:00
nhmall
d4e97cc650 libnethackmain.c includes date.h 2020-10-11 09:43:15 -04:00
nhmall
eaa8b99eea follow-up bit
remove an unnecessary dependency for top Makefile wasm
2020-10-11 09:16:23 -04:00
nhmall
efdf4f8979 Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2020-10-11 09:12:02 -04:00
nhmall
75f852f277 cross-compiles need not build host native lua library
Because some Makefile.top dependencies triggered the build
of the host native lua library, the cross-compiles were
building it needlessly.

Make it a make variable so that it can be overridden by
cross-compile recipes in sys/unix/hints/include/cross-*.2020
2020-10-11 09:08:27 -04:00
nhmall
d6719ea0db cron daily Files update 2020-10-10 19:36:36 -04:00
Bart House
c36a823cab Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2020-10-10 16:28:54 -07:00
Bart House
cc50aa036d Update files heading to reflect that we support VS 2017 and 2019. 2020-10-10 16:28:41 -07:00
nhmall
9599fa27df update win/win32/vs/.gitattributes text 2020-10-10 18:38:25 -04:00
nhw_cron
c5c43ad00a This is cron-daily v1-Jan-20-2020. files updated: Files 2020-10-10 18:31:30 -04:00
Bart House
bb04a9b041 Support both VS 2017 and VS 2019 without making changes to project files.
Renamed 'vs2017' folder to 'vs'.
2020-10-10 15:15:59 -07:00
Bart House
75f3ccd770 Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2020-10-10 14:18:18 -07:00
Bart House
848f37207d Add text mentioning that LUA sources must be copied into tree. 2020-10-10 14:17:58 -07:00
nhmall
3e66cbd781 more warnings 2020-10-10 16:41:09 -04:00
nhmall
48fa4fa5dd more warning bits 2020-10-10 16:28:17 -04:00
PatR
062152d62e fix github issue #399 - [not] fixing chest lock
Use ansimpleoname() instead of doname() to describe the key or
lock pick or credit card when reporting "You can't fix a chest's
broken lock with a <foo>."  doname() includes BUC status when
known and feedback mentioning a particular bless/curse state on
the tool that can't be used to fix the lock suggests that some
other bless/curse state might be viable.
2020-10-10 11:46:02 -07:00
nhmall
55d1d547a6 silence some util/makdefs.c src/mdlib warnings
In file included from makedefs.c:213:0:
../src/mdlib.c: In function ‘runtime_info_init’:
../src/mdlib.c:808:12: warning: variable ‘timeresult’ set but not used [-Wunused-but-set-variable]
     time_t timeresult;
            ^~~~~~~~~~
makedefs.c: In function ‘do_date’:
makedefs.c:1140:16: warning: unused variable ‘ind’ [-Wunused-variable]
     const char ind[] = "    ";
                ^~~
makedefs.c:1139:9: warning: unused variable ‘steps’ [-Wunused-variable]
     int steps = 0;
         ^~~~~
makedefs.c: In function ‘do_monstr’:
makedefs.c:1934:12: warning: variable ‘j’ set but not used [-Wunused-but-set-variable]
     int i, j;
            ^
2020-10-10 08:55:43 -04:00
Pasi Kallinen
3d6551a70e Lua: Allow matching any wall
A 'w' in a map fragment will match any wall (IS_WALL macro):

   des.replace_terrain({ mapfragment = "w", toterrain = "F" });
2020-10-10 11:31:16 +03:00
PatR
c154dd2609 fix #K2393 - brass lantern hit by water
Don't extinguish a brass lantern when hit by water unless it is
being submerged.
2020-10-09 12:02:26 -07:00
PatR
d20394c4bc unix/Makefile.utl
Replace use of $(LINK) with $(CLINK) or $(CXXLINK) as warranted.
When the Qt interface is enabled, the utility programs were all
(except dlb) being linked with C++ support.  That didn't cause
any problems, just looked wrong.  Link them as C instead of C++.
Two actually do need C++ support (and still have it) but both
are dead:  'tile2beos' because the source file doesn't exist (not
even in 'outdated'), 'tileedit' because it won't build with Qt5.
I didn't bother with QUIETCC support for them.

There were still a couple of references to dgn_comp (for the lint
target; just in the name of a macro, not its value); remove those.
2020-10-09 08:45:03 -07:00
nhmall
017448addf re-enable the MSDOS cross-compile on travis-ci 2020-10-09 09:36:55 -04:00
nhmall
3e39984877 more wasm dependency order tinkering 2020-10-09 09:18:51 -04:00
nhmall
139b138b78 follow-up bit
make variable had changed in PRE but not in POST
2020-10-09 09:05:56 -04:00
nhmall
a09a41f9a3 more wasm build
This issue
https://github.com/NetHack/NetHack/issues/398
reported some issues with the wasm build. Attempt to resolve
some of those.
2020-10-09 08:54:36 -04:00
nhmall
de80dd2437 cross-compile fix-up 2020-10-09 08:52:46 -04:00
PatR
dde561810d Qt prompt highlighting
When qt_yn_function() or qt_more() is asking for a single character
response, typing anything will cause the prompt line in the message
window to stop being highlighted.  If they reject what's been typed,
they beep (--More-- doesn't start beeping until second rejection);
change both of them to also rehighlight the prompt line to give a
visual indication that the question/acknowledgement is still being
asked.
2020-10-08 11:24:11 -07:00
nhmall
5dcc328759 be more consistent with CROSS_TO_target macro names for cross-compiles
-DCROSS_TO_MSDOS	msdos cross-compile (djgpp cross-compiler)
-DCROSS_TO_AMIGA	Amiga cross-compile
-DCROSS_TO_WASM		wasm cross-compile (emscripten)
2020-10-08 13:49:24 -04:00
PatR
342323eb15 Qt menu hack
Prevent a small inventory menu as the first one shown from forcing
all subsequent ones from being the same short height by forcing it
to have room for at least 15 lines.  Temporary hack until someone
figures out why resizing the reused WIN_INVEN isn't working.

Does not affect non-inventory menus which get created on demand and
destroyed when done so don't need to change size to fit different
contents.
2020-10-08 10:18:44 -07:00
nhmall
1b0a9f8e31 follow-up to previous 2020-10-07 09:23:41 -04:00