Commit Graph

11001 Commits

Author SHA1 Message Date
Adam Powers
d2fdc6f582 add new exports, cleaner debugging options 2020-09-12 12:40:04 -07:00
Adam Powers
6fcb7c3db3 fix ignored files 2020-09-12 12:35:01 -07:00
Adam Powers
34e4b1fae9 js test code 2020-09-12 12:34:45 -07:00
Adam Powers
c602ecc5a2 default is a permenant inventory window 2020-09-12 12:27:29 -07:00
Adam Powers
4e38d8f329 fix reentry and types, enhance debugging, delinting 2020-09-12 12:27:04 -07:00
Adam Powers
233c683912 add keywords 2020-09-12 12:24:12 -07:00
Adam Powers
fc2e6b0b6d initial commit 2020-09-12 12:24:06 -07:00
Adam Powers
c36b948b21 add helpers and constants 2020-09-12 12:23:13 -07:00
Adam Powers
2e7e0c2325 change package name 2020-09-06 23:19:22 -07:00
Adam Powers
7b46e3d12c update lib tests 2020-09-06 17:35:03 -07:00
Adam Powers
96cf11ad71 fix JS event loop blocking 2020-09-06 17:32:08 -07:00
Adam Powers
045a5879f1 npm doesn't allow 'hack' in package names 2020-09-02 07:42:29 -07:00
Adam Powers
a8373f2224 move package to npm organization 2020-09-02 07:28:01 -07:00
Adam Powers
caaa9b0588 remove stray printfs 2020-09-02 07:27:29 -07:00
Adam Powers
490b260454 remove stray console.log 2020-09-01 13:11:09 -07:00
Adam Powers
0c8e4e555e complete API documentation 2020-08-30 12:09:42 -07:00
Adam Powers
b0e77f7729 initial npm package 2020-08-30 12:00:39 -07:00
Adam Powers
356e7432e7 ignore libnethack build files 2020-08-30 12:00:12 -07:00
Adam Powers
ffa5e319af ignore libnethack dev files 2020-08-30 11:59:23 -07:00
Adam Powers
efae5590e5 completed shim graphics callbacks 2020-08-30 11:01:34 -07:00
Adam Powers
4ffb8c9ce3 fix naming 2020-08-30 10:46:55 -07:00
Adam Powers
85108bf7ef add build section, fix naming 2020-08-30 10:45:54 -07:00
Adam Powers
42f948018d initial helpers 2020-08-30 10:31:17 -07:00
Adam Powers
ca9d1c5b97 update build notes 2020-08-30 10:30:03 -07:00
Adam Powers
863f914337 added void functions 2020-08-29 15:50:42 -07:00
Adam Powers
14084dc50c fix arg order 2020-08-29 14:48:22 -07:00
Adam Powers
4ef48ca49a fix syntax errors for libnethack.a 2020-08-29 14:48:02 -07:00
Adam Powers
22bc4ecfc0 initial docs 2020-08-29 11:10:52 -07:00
Adam Powers
1a70f77b2a more sensible arg order for callback 2020-08-29 11:10:09 -07:00
Adam Powers
e04b17911a delinting 2020-08-29 10:27:51 -07:00
Adam Powers
97a14eebbe functional shim graphics 2020-08-29 10:26:58 -07:00
Adam Powers
c9f5bb9ac4 replace -DWASM with compiler internal __EMSCRIPTEN__ 2020-08-27 22:15:12 -07:00
Adam Powers
18254eb291 make system cleanup 2020-08-27 21:38:21 -07:00
Adam Powers
e5604d575f fix undefined symbol in nhlib 2020-08-27 21:37:16 -07:00
Adam Powers
d3bbf02d2e fix 'spotless' bug noticed during cross-compile 2020-08-27 21:12:51 -07:00
Adam Powers
1aa053d1d8 initial libnethack 2020-08-26 19:22:00 -07:00
Adam Powers
5939773971 initial shim graphics 2020-08-26 19:17:40 -07:00
PatR
c062822a7c Qt tombstone bugs
Infrastructure bits:  Qt tombstone uses a short buffer; make sure that
the plname value fits instead of relying on snprintf() to truncate it.
A warning about gold, if any, was iffy but this should guarantee no
reason for future complaint.  Year was safe but a compiler sensitive
to buffer overflows wouldn't know that.

Actual bugs:  Qt used money in inventory for gold amount on tombstone;
that overlooks gold in containers and will be 0 by tombstone stage if
bones get saved.  Year was recalculated from current date+time instead
of using the value that gets passed in--blindly flagging that variable
as UNUSED was a mistake.
2020-08-20 16:56:50 -07:00
nhmall
61b86b8838 Merge branch 'NetHack-3.7' 2020-08-20 11:20:26 -04:00
nhmall
e191e6bc8f build warning fix on g++ >= 9 and Qt
../win/Qt/qt_menu.cpp: In member function ‘virtual void nethack_qt_::NetHackQtTextWindow::UseRIP(int, time_t)’:
../win/Qt/qt_menu.cpp:680:54: warning: ‘%s’ directive output may be truncated writing up to 31 bytes into a region of size 17 [-Wformat-truncation=]
  680 |     snprintf(rip_line[NAME_LINE], STONE_LINE_LEN+1, "%s", g.plname);
      |                                                      ^~   ~~~~~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from ../win/Qt/qt_menu.cpp:8:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:35: note: ‘__builtin_snprintf’ output between 1 and 32 bytes into a destination of size 17
   67 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   68 |        __bos (__s), __fmt, __va_arg_pack ());
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~../win/Qt/qt_menu.cpp: In member function ‘virtual void nethack_qt_::NetHackQtTextWindow::UseRIP(int, time_t)’:
../win/Qt/qt_menu.cpp:680:54: warning: ‘%s’ directive output may be truncated writing up to 31 bytes into a region of size 17 [-Wformat-truncation=]
  680 |     snprintf(rip_line[NAME_LINE], STONE_LINE_LEN+1, "%s", g.plname);
      |                                                      ^~   ~~~~~~~~
In file included from /usr/include/stdio.h:867,
                 from ../include/global.h:9,
                 from ../include/config.h:608,
                 from ../include/hack.h:10,
                 from ../win/Qt/qt_menu.cpp:8:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:35: note: ‘__builtin_snprintf’ output between 1 and 32 bytes into a destination of size 17
   67 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   68 |        __bos (__s), __fmt, __va_arg_pack ());
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2020-08-20 11:18:32 -04:00
nhmall
4620bfccbf grammar bit 2020-08-20 09:50:07 -04:00
nhmall
d86dd4bb1b comment out what appears to be an obsolete bit in windows Makefile.gcc 2020-08-18 10:36:15 -04:00
nhmall
960f5d82b9 mirror recent make depends update in some other Makefiles 2020-08-18 10:26:24 -04:00
PatR
ae4c180cf6 Qt without tiles
Qt is capable of using an ascii map, and does so on the rogue level.
So failing to load tiles doesn't need to quit; it can continue in
text mode.

Not extensively tested.  This disables the paper doll when the ascii
map is forced (either via options settings or due to tiles loading
failure, but not when simply on the rogue level) rather than trying
to display it with object class characters.
2020-08-17 16:42:24 -07:00
PatR
0438dfe5a3 Qt install dependencies
Playground setup:  Qt does not use external files pet_mark.xbm and
pilemark.xbm, it has pixmaps for those compiled in via qt_xpms.h.
Presumably because the pet mark heart has two sizes there.
2020-08-17 15:53:18 -07:00
PatR
276477e953 win/Qt/* dependencies update
A couple of qt_*.h headers now include other qt_*.h headers,
adding a bunch of new dependencies for the qt_*.cpp sources.
This is from 'make depend'.
2020-08-17 15:44:16 -07:00
PatR
26060634f6 Qt: paper doll display of BUC status
When items in the paper doll inventory subset (primary worn and
wielded items) have known BUC state, indicate what that is.  It
now draws a one pixel wide white border around each doll tile,
and if BUC is known, that border gets its color changed (red for
known cursed, yellow for known uncursed, cyan for known blessed).
That isn't very visual so the first pixel inside the tile is
overwritten with the same color, and alternating pixels are also
overwritten for the second rectangle within.  The 2..3 pixel wide
border is visible without cluttering the tile for 'normal' sized
paper doll.  The tiles are allowed to be scrunched down to as
small as 6x6 so there won't be much left after 1 or 2 around the
edge are replaced.

Initially I was going to try to highlight welded items but the
more general BUC highlighting is simpler and usually more useful
to the player.

The qt_map.* bits are just reformatting.  I was looking at pet
and pile annotations as a way to do BUC annotations but decided
not to attempt that.
2020-08-17 15:41:33 -07:00
PatR
3a07880684 paper doll inventory display vs hallucination
During hallucination, actions which triggered update of persistent
inventory made Qt's display of map tiles for equipped objects have
those tiles switch randomly, but ordinary move-by-move fluctations
applied to floor objects left them alone.

Initially I took out hallucination of inventory items altogether,
but ended up putting that back and changing the floor hallucination
to affect Qt's paper doll too.  The display.h change isn't needed
but I've left it in.
2020-08-17 14:48:00 -07:00
PatR
9a866d3601 Qt "Paper Doll" inventory
Enhance the "Qt Settings" dialog box to provide control over the
paper doll subset of inventory displayed between the message and
status windows (above the map).  A ton of flailing about for a
fairly small but useful change in functionality.

Old dialog (no title):
| [ ] Zoomed            -- check box
| "Width:"  [      ]    -- number entry spinner
| "Height:" [      ]    -- ditto
| "Font:"   [      ]    -- Huge:18pt, Large:14, Medium:12, Small:10, Tiny:8
| [      Dismiss      ] -- button

New dialog:
|     "Qt NetHack Settings"
|
| "Map:"    [ ] "Zoomed"        -- check box
|           "Tile Width"   [  ] -- number entry spinner
|           "Tile Height"  [  ] -- ditto
| "Invent:" [ ] "Shown"         -- check box
|           "Doll Width"   [  ] -- number entry spinner
|           "Doll Height"  [  ] -- ditto
| "Font:"   [      ]    -- Huge:18pt, Large:14, Medium:12, Small:10, Tiny:8
| [          Dismiss          ] -- button

The inventory subset can now be suppressed.  When shown (the default),
its size can be set independently of the map tiles' size.  I've set
the default to be 32x32 tiles instead of 16x16 used for the map.

The settings are saved and restored automatically by Qt, and persist
not just across save/restore cycles but into new games.  (That's not
a change, just a reminder.)
2020-08-15 19:48:33 -07:00
nhmall
89fbe2162e remove duplicate line in .travis.yml 2020-08-15 16:52:19 -04:00