Commit Graph

11142 Commits

Author SHA1 Message Date
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
nhmall
b0e71f68bc small monsters seeping through their shirt
The code is slightly different than in the PR which left out the noncorporeal case.

Closes #397
2020-10-07 09:09:51 -04:00
PatR
eb4288e608 Qt click-to-command
Consolidate some recently added duplicated code.
2020-10-07 04:19:55 -07:00
PatR
da8558e262 Qt status panel as command button
Clicking on the status panel runs ^X to show character and status
information without abbreviations.  The code needed is identical
to what's now used for clicking on the paper doll inventory panel
except for the command to execute.
2020-10-06 15:20:25 -07:00
PatR
e2e9bca3f7 Qt "paperdoll" as command button
Clicking on the paper doll inventory subset window will cause
the '*' command (#seeall) to execute.  They convey the same
information (unless multiple leashes or multiple light sources
are in use; seeall lists all of them instead of just the first
of each) but the doll shows the info with a small grid of map
tiles and seeall shows it with an inventory display of worn and
wielded items plus tools in active use.

Ideally it should show information about a specific item as a
"tool tip" when the mouse hovers over one of the doll slots.
I don't know whether I'll ever attempt to tackle that or even
if that's feasible with Qt.  Perhaps use right click instead.
2020-10-06 09:42:59 -07:00
PatR
52672e8f25 left out of "Qt menus, mostly item counts" 2020-10-06 09:15:32 -07:00
PatR
7277b4a415 Qt menus, mostly item counts
Don't allow the user to construct a count value when operating on
a pick-none menu where counts aren't meaningful.  Unfortunately
that can still be done on pick-one or pick-any menus which don't
happen to have any entries where a count is applicable.

Allow a count to be optionally started with '#'.  Note that if
there is an entry using '#' for the selector letter (probably
inventory that has something in the overflow slot), typing '#'
will select the entry instead of initiating a count.

Flail about a bit trying to get menu size correct--failed on this
front.
2020-10-06 09:09:09 -07:00
nhmall
cb2b710b22 update Cross-compiling document for PR385 Web Assemply and libnethack
Credit: The initial Web Assembly cross compile was found in a pull request:
            https://github.com/NetHack/NetHack/pull/385
        by apowers313. The pull request was merged with some accompanying
        NetHack source tree integration changes in early October 2020.

Cross-compiler used: emscripten
Cross-compiler url: https://emscripten.org/docs/getting_started/downloads.html

    Here's a brief guide to obtaining the cross-compiler sources via git and
    building it on your system.

    For Ubuntu, the build prerequisite packages for building the compiler can
    be easily obtained:

        sudo apt-get install python3 cmake default-jre

    For macOS, you will need to install Xcode, git, cmake, Python 3.5 or new
    (at time of this writing).

    After installing the prerequite packages above, obtain the cross-compiler
    via git and build it from the directory of your choice using steps similar
    to these:

            git clone https://github.com/emscripten-core/emsdk.git
            cd emsdk
            git pull
            ./emsdk install latest
            ./emsdk activate latest
            source ./emsdk_env.sh

    The steps above reflect what was outlined at this url at the time
    of writing:

            https://emscripten.org/docs/getting_started/downloads.html

    That is the definitive source and trumps anything documented here.

    On your linux host, prepare to cross-compile NetHack as follows:

        cd sys/unix ; sh setup.sh hints/linux.2020 ; cd ../..
        make fetch-lua

    On your macOS host, prepare to cross-compile NetHack as follows:

        cd sys/unix ; sh setup.sh hints/macOS.2020 ; cd ../..
        make fetch-lua

    Then, cross-compile to targets/wasm as follows:

        make CROSS_TO_WASM=1

    You can build src/nethacklib.a from pull request 385 as follows:

        make WANT_LIBNH=1

    Do not add any additional windowport interfaces to your build
    (such as WANT_WIN_TTY=1 WANT_WIN_CURSES=1 WANT_WIN_X11=1 or
    WANT_WIN_QT=1) as those aren't applicable to the Web Assembly
    or nethacklib builds. A "shim" pseudo-windowport is included
    from pull request 385.

    Result: As mentioned, the wasm cross-compile will end up in
            targets/wasm and the nethacklib.a will end up
            src.

    The cross-compiler hints additions are enclosed inside ifdef sections
    and shouldn't interfere with the non-cross-compile builds using
    hints/linux.2020 or hints/macOS.2020.
2020-10-06 11:00:33 -04:00
nhmall
724e5fba25 adding ; was inappropriate for BUILDMORE list of dependencies 2020-10-06 02:26:40 -04:00
nhmall
b68f960c59 temporarily turn off the msdos cross-compile on travis 2020-10-06 02:15:25 -04:00
nhmall
a8d31910ec target lua build was missing -c on cross-compile 2020-10-06 02:01:30 -04:00
nhmall
dc47c46314 more wasm cross-compiling follow-up 2020-10-06 01:47:19 -04:00
PatR
d7a52cf0c4 Qt menu search
Remove a 'TODO' for once.  Have the popup that's used to accept the
target string--after clicking on [search] or typing ':' to initiate
menu search+select operation--force keyboard focus to itself.  Menu
searching worked without this, but only if you manually clicked on
the search popup prior to typing the target string.  Failure to do
so resulted in typed characters being used to select menu entries.
2020-10-05 16:26:27 -07:00
Pasi Kallinen
37339abebd Fix dropping const from params 2020-10-05 17:17:07 +03:00
nhmall
43112cec01 clear a -Wshadow warning in options.c
options.c
options.c: In function ‘match_optname’:
options.c:5734:27: warning: declaration of ‘opt_name’ shadows a global declaration [-Wshadow]
 const char *user_string, *opt_name;
                           ^~~~~~~~
In file included from options.c:52:0:
../include/optlist.h:56:1: note: shadowed declaration is here
 opt_##a,
 ^
../include/optlist.h:307:5: note: in expansion of macro ‘NHOPTC’
     NHOPTC(name, PL_NSIZ, opt_in, set_gameview, No, Yes, No, No, NoAlias,
     ^~~~~~
2020-10-05 09:24:42 -04:00
nhmall
ab5c8dff05 cron daily Files update 2020-10-04 21:14:59 -04:00
nhmall
ac493aa455 placement of libnethack targets required adjusting
From -PRE to -POST section
2020-10-04 21:12:03 -04:00
nhmall
d8961b0067 updates for LIBNH build 2020-10-04 20:48:09 -04:00
nhmall
7bf5172f2e unixmain and libnethackmain diverged in the updated PR
put unixmain back the way it was, now that libnethackmain is in the tree after all.
2020-10-04 20:14:45 -04:00
nhmall
c3683eaa9b Merge branch 'libnethack2' into NetHack-3.7 2020-10-04 20:13:35 -04:00
nhmall
60dbb4c12f the .gitignore doesn't match the target locations on the merged code
Leave it be for now.
2020-10-04 20:09:28 -04:00
nhmall
11b5f29e07 merging conflict fixup 2020-10-04 20:07:57 -04:00
nhmall
15c1cb648d integrate updates made to PR earlier on Oct 4 2020-10-04 20:05:29 -04:00
nhmall
751d5ef76c Merge branch 'libnethack' of https://github.com/apowers313/NetHack into libnethack2 2020-10-04 19:51:37 -04:00
PatR
49ef50fc54 Makefile.src: avoid extra feedback while linking
Recently added cross-compile stuff had resulted in an extra line
of feedback when linking:  'true;'.  Suppress that.

Also, I think 'AWK=nawk' was needed for Solaris or maybe even
SunOS.  Switch 'make depend' to use ordinary awk by default since
most systems have Posix-compliant awk these days and OSX doesn't
have nawk.
2020-10-04 16:34:59 -07:00
Adam Powers
dc1c85faa4 more friendly javascript arguments 2020-10-04 14:04:56 -07:00
Adam Powers
ac4649e63f add globals, constants, and helpers 2020-10-04 14:03:04 -07:00
nhmall
61185f3405 cron daily Files update 2020-10-04 15:26:50 -04:00
nhmall
de0195191b update original documentation for pr385
Changes to be committed:
	modified:   sys/lib/README.md
2020-10-04 15:19:58 -04:00
nhmall
f6b0d86ce6 Merge branch 'NetHack-3.7' 2020-10-04 14:54:41 -04:00
nhmall
b41b897565 remove two unneeded files 2020-10-04 14:51:10 -04:00
Adam Powers
dc2d757399 libnethack pr385
roll parts of pr385 into source tree

This does not take the PR as is.

Unlike the PR, this streamlines and minimizes the integration somewhat:

- use hints/include mechanism instead of creating alternative
  Makefile.dat, Makefile.src, Makefile.top, Makefile.utl in sys/lib;
  those would have been a maintenance nightmare.

- don't have alternative mkmkfile.sh and setup.sh in sys/lib.

- sys/lib/libnethackmain.c differed from sys/unix/unixmain.c by
  very little, so just place a small bit of conditional code at the
  top of sys/unix/unixmain.c instead.

- changed the conditional code bits from __EMSCRIPTEN__ to
  CROSS_TO_WASM.

- You should be able to build the wasm result by:
    cd sys/unix ; sh setup.sh hints/linux.2020 ; cd ../..
    make fetch-lua    (<-one time)
    make WANT_LIBNH all

- You should be able to build LIBNBH by:
    cd sys/unix ; sh setup.sh hints/linux.2020 ; cd ../..
    make fetch-lua    (<-one time)
    make CROSS_TO_WASM=1 all

As it is currently coded, winshim.c requires C99.
2020-10-04 14:46:32 -04:00
Adam Powers
741e6fd5b7 initial shim graphics 2020-10-04 14:46:31 -04:00
PatR
9bad6840f4 Qt ynaq/yn#aq dialogs
When 'popup_dialog' is set, the Qt interface uses a popup window
for yn_function() calls and the dialog has a list of buttons, one
per potential choice.  It has been handling "yn?" and "ynq?"
questions differently from general request-one-char prompts, using
buttons "Yes", "No, and "Cancel" instead of showing individual
letters.  This extends that to "ynaq" and "yn#aq" questions and
labels 'q' reply as "Stop" instead of "Cancel" for those.  Also,
when player uses keyboard instead of mouse to answer, allow 'c'
as well as 'q' for cancel ones, 's' as well as 'q' for stop ones.

Prompt  Buttons
yn      [Yes ][ No ]
ynq     [ Yes  ][  No  ][Cancel]
ynaq    [Yes ][ No ][All ][Stop]
yn#aq   [Yes ]Count:______[ No ][All ][Stop]
rl      [ Left ][Right ]    //unchanged; included for completeness

(For contrast, when something specifies "ny" as the acceptable
choices, the buttons will just be [n][y].  Prompts for choosing
from a list of inventory letters can't accidentally match these
special cases as long as they're specified in alphabetical order.)
2020-10-04 07:36:12 -07:00
nhmall
ef6978ec51 update sys/winnt/console.rc 2020-10-02 16:01:04 -04:00
nhmall
ee08122771 Guidebook.txt update 2020-10-02 12:32:11 -04:00
nhmall
af739196cf bump Guidebook date to reflect most recent changes 2020-10-02 12:29:26 -04:00
Pasi Kallinen
40648503b2 Increment EDITLEVEL due to safe_wait 2020-10-02 19:11:15 +03:00
Pasi Kallinen
fac154d364 Fix some Guidebook.tex errors 2020-10-02 19:00:40 +03:00
Pasi Kallinen
396b819988 Add safe_wait to toggle search and wait prevention 2020-10-02 19:00:40 +03:00
PatR
aaf88f9662 Qt build fix
The failing Travis build issued about 500 lines of diagnostics
when complaining about one line of the source.  It compiled ok
for me but I use older versions of Qt library and C++ compiler.
2020-10-02 04:51:15 -07:00