Commit Graph

854 Commits

Author SHA1 Message Date
keni
09502df9f1 force expand unexpanded substitution variables 2018-04-25 15:36:11 -04:00
keni
d8c49ec9d1 Add updated copyright lines, part 1. 2018-04-25 15:00:13 -04:00
keni
11f1983253 update .gitattributes files for substitution and copyright headers 2018-04-25 14:52:43 -04:00
nhmall
93e0cb5235 nethackw clear after getlin
Alex wrote: in nethackw, getlin clears message
window, so any unread messages are scrolled off the screen without
"--more--" prompt. If vary_msgcount is set to 1 and "potion shatters", it
is not easy to see the effect to name the potion correctly.
2018-04-24 08:15:36 -04:00
PatR
77da2fdc65 tty EDIT_GETLIN fix for wrapped prompt
When a getlin() response is being typed, it wraps to second line if
the cursor tries to go past COLNO-1, but if a previous response is
treated as part of the prompt, using pline() to write prompt+space+text
wraps at a whole word boundary.  tty's getlin() assumes that the screen
position can be derived from that prompt+space+text_so_far but that
doesn't match if wrapping at a word boundary leaves blank space at end
of the top line.

When a prompt is accompanied by default answer, output the answer
separately instead of pretending it is part of the prompt.  Line-wrap
should occur at same point as when it was originally typed and avoid
the confusion about how far to back up when deleting characters.

This hasn't been exhaustively tested but it seems to work correctly
for ordinary input, input erased one character at a time, and input
killed all at once.  One thing which definitely hasn't been tested is
having the prompt itself be so long that it needs to wrap.
2018-04-13 04:32:05 -07:00
PatR
ac2634b603 EDIT_GETLIN fix for tty
After about the third time typing '#' and getting a prompt of "# K", I
decided that it wasn't clumsy typing.  The call chain for get_ext_cmd()
was passing an uninitialized output buffer to [hooked_tty_]getlin()
which treated random junk as the previous result to be used as current
default.  Other interfaces may need a similar fix.
2018-04-03 16:05:08 -07:00
Pasi Kallinen
2548d68dd3 Fix some warnings
Remove an unused variable, add missing FALLTHRUs, and use the same
FALLTHRU wording where it wasn't recognized by gcc
2018-03-30 19:42:50 +03:00
Pasi Kallinen
a2f6a7bec9 Support EDIT_GETLIN for win32
... but only without popup_dialog
2018-03-27 20:24:05 +03:00
Pasi Kallinen
94ad7512a6 Compile-time option to allow some prompts remember the input
Define EDIT_GETLIN to make the tty, X11, and Qt4 windowports to
remember the input strings for wishing and annotation.
2018-03-26 23:04:53 +03:00
Alex Kompel
d6e43a32ec win32-gui: fix truncated status fields call to get dimensions of the text bounding rectangle needs to be made after the font is set in order to get the accurate reading 2018-03-18 23:00:23 -07:00
Alex Kompel
60454b4f92 win32-gui: Do not auto-assign non-alphabet accelerator characters to menu items. Picking up pile that contains gold forces accelerators to start with $ so the next one becomes %, ... 2018-03-18 23:00:16 -07:00
nhmall
4e086caceb ensure tty_curs() behaves the same whether DEBUG defined or not
ensure tty_curs() behaves the same whether DEBUG defined or not
when it comes to positioning the cursor.

The return statement, in the debug case only, was preventing
the cursor from being moved following a range check, so the
next output was written whereever the cursor happened to be
previously.

The messaging that detects the failed range check will get
written in the DEBUG defined case hopefully allowing resolution
to the range check failure, but now the cmov will still
be attempted just as it is in the case where DEBUG is not
defined.
2018-03-11 23:29:06 -04:00
Pasi Kallinen
4f459a9532 Fix WINCHAIN compilation 2018-03-10 21:48:22 +02:00
nhmall
a120d99005 msc makefiles update timestamp on copied files 2018-03-04 10:30:17 -05:00
nhmall
dee2fea82d msc Makefile 2018-03-04 10:25:11 -05:00
nhmall
939bd356a4 more msc makefile tweaks 2018-03-04 09:54:29 -05:00
nhmall
eddfcc4422 windows cmdline Makefile 2018-03-04 09:07:16 -05:00
nhmall
5370c0d337 resolve part of H4422 related to .exe versions
I also saw
 that looking at the details of both windows .exes that they indicate file
 version 3.5.0.0. Shouldn't it be 3.6.0.0 for the NH version 3.6.0
2018-02-25 12:20:50 -05:00
nhmall
2cfbd682a1 VS community editions are freely downloadable. Maintain only 2 most recent.
Changes to be committed:
	modified:   sys/winnt/Install.nt
	modified:   sys/winnt/Makefile.msc
	modified:   sys/winnt/nhsetup.bat
	deleted:    win/win32/vs2010/NetHack.sln
	deleted:    win/win32/vs2010/NetHackW.vcxproj
	deleted:    win/win32/vs2010/dgncomp.vcxproj
	deleted:    win/win32/vs2010/dgnstuff.vcxproj
	deleted:    win/win32/vs2010/dlb_main.vcxproj
	deleted:    win/win32/vs2010/levcomp.vcxproj
	deleted:    win/win32/vs2010/levstuff.vcxproj
	deleted:    win/win32/vs2010/makedefs.vcxproj
	deleted:    win/win32/vs2010/recover.vcxproj
	deleted:    win/win32/vs2010/tile2bmp.vcxproj
	deleted:    win/win32/vs2010/tilemap.vcxproj
	deleted:    win/win32/vs2010/tiles.vcxproj
	deleted:    win/win32/vs2010/uudecode.vcxproj
	deleted:    win/win32/vs2013/NetHack.sln
	deleted:    win/win32/vs2013/NetHack.vcxproj
	deleted:    win/win32/vs2013/NetHackW.vcxproj
	deleted:    win/win32/vs2013/dgncomp.vcxproj
	deleted:    win/win32/vs2013/dgnstuff.vcxproj
	deleted:    win/win32/vs2013/dlb_main.vcxproj
	deleted:    win/win32/vs2013/levcomp.vcxproj
	deleted:    win/win32/vs2013/levstuff.vcxproj
	deleted:    win/win32/vs2013/makedefs.vcxproj
	deleted:    win/win32/vs2013/nhdefkey.vcxproj
	deleted:    win/win32/vs2013/recover.vcxproj
	deleted:    win/win32/vs2013/tile2bmp.vcxproj
	deleted:    win/win32/vs2013/tilemap.vcxproj
	deleted:    win/win32/vs2013/tiles.vcxproj
	deleted:    win/win32/vs2013/uudecode.vcxproj
2017-12-03 08:42:38 -05:00
Pasi Kallinen
59d4ac02f7 TTY: Treat carriage return as newline
Before this change, more-prompts and input text -prompts could not
be accepted with carriage return. Now, just like in menus, carriage
return is treated the same as a newline.

To test, use 'stty -icrnl'
2017-11-14 16:14:06 +02:00
Pasi Kallinen
647ea55b1a Fix compile of tile2x11
I was too zealous changing fprintf to the Fprintf macro, which
ignores the return value.
2017-11-02 23:41:55 +02:00
Pasi Kallinen
fe9762d1cc X11: Fix renaming at player selection
Due to the new player selection dialog I did, it was possible
to rename your character - but this didn't rename the lock files
and tried to load a save from the wrong name.

This is a bit of a hack, but seems to work and didn't seem to
cause problems for the tty.
2017-10-31 21:18:24 +02:00
Bart House
3d2e59ecec Win32GUI: Changes to player selection dialog.
Significant changes to player selection dialog that attempt
to match recently made changes to the Qt and X11 window ports.
2017-10-25 10:49:14 +03:00
Bart House
a588541a27 Win32GUI: Gather raw_print text and display it all in single dialog
Defined strbuf_t and related routines to support dynamically sized
strings. Modified strip_newline() to strip the last newline in a string
instead of the first.

Simplified splash window code using new strbuf_t.

Prior to exiting game, re-enable getreturn and call wait_synch() in
case there is buffered raw prints that must be displayed to user.
2017-10-25 10:34:27 +03:00
PatR
da9c3f0ed4 X11 role selection: gender-specific role names
A wishlist/TODO item:  when "female" is highlighted, change "caveman"
to "cavewoman" and "priest" to "priestess".  If it gets toggled to
"male", change them back.
2017-10-16 22:19:35 -07:00
Pasi Kallinen
7e28cc64f6 X11: Capitalize the main window correctly 2017-10-16 17:34:29 +03:00
Pasi Kallinen
28061e98dc Qt4: Use pixel-perfect tile scaling
SmoothTransformation (bilinear filtering) causes artifacts
at tile edges, and the blurry tiles look even worse.
2017-10-16 10:35:36 +03:00
PatR
ab04d12ccb X11 player selection - wishlist and reformatting
Add a comment about potential changes to make the X11 player selection
dialog.  Also, a bunch of minor formatting tweaks.
2017-10-15 16:24:02 -07:00
Pasi Kallinen
f1618fe6dd X11: Put yn prompts into message history 2017-10-15 21:48:42 +03:00
Pasi Kallinen
1b42b1499b X11: player selection dialog tweaks 2017-10-14 18:07:09 +03:00
Pasi Kallinen
87b94230b5 X11: player selection enter should obey button active state 2017-10-14 17:38:06 +03:00
Pasi Kallinen
1caa212bd9 Fix warnings 2017-10-14 13:48:44 +03:00
Pasi Kallinen
04b08298a3 Use the same macro for output in tile2x11 2017-10-14 13:10:34 +03:00
Pasi Kallinen
8723742015 Don't output x11 tile compilation info into stderr 2017-10-14 09:15:07 +03:00
PatR
842c66750a X11 player selection compile warnings
This eliminates nearly 40 warnings, most by suppressing complaints of
used function arguments but a few for unused local variables.  There's
also some reformatting thrown in....

There are still 18 warnings about uses of XtSetArg(), about assigning
const to non-const.
2017-10-13 17:56:25 -07:00
Pasi Kallinen
1d8aea1ca3 Qt4: Don't use version string directly 2017-10-14 01:33:56 +03:00
Pasi Kallinen
9ec7e961d3 Fix copypaste error in Qt4 and X11 plsel dialogs 2017-10-13 23:34:44 +03:00
Pasi Kallinen
7b156bf704 X11: add new player selection dialog
The dialog shows the player's name, race, role, gender, and
alignment in a single window, similar to the Qt4 dialog.
Also allows randomizing the character selection.

Use the dialog by setting OPTIONS=player_selection:dialog
2017-10-13 22:41:43 +03:00
PatR
601bff5159 X11 WC_ flags
Add a few windowing capability flags that were omitted for X11.  There
may be others which ought to be set too; I don't understand a bunch of
them.
2017-10-12 15:18:26 -07:00
Pasi Kallinen
b340e783f5 Qt4: Remove extra empty space from player selection 2017-10-12 13:43:46 +03:00
Pasi Kallinen
11e50e8ca2 Qt4: Add Random button to player selection 2017-10-12 13:37:52 +03:00
Pasi Kallinen
b586d58dbb Qt4: Gender, not Sex. TOURIST is unconditional. 2017-10-12 12:42:32 +03:00
Pasi Kallinen
55143cd66e Qt4: Add NetHack version to player selection popup 2017-10-12 12:33:04 +03:00
PatR
ffeabfdf3b X11 default resources - macro expansion
The X11 interface reads file NetHack.ad (after cd'ing to the playground
directory, where 'make install' puts a copy) and feeds the contents to
X Windows for use as default resources to override the compiled in
defaults.  When use of #define was introduced into NetHack.ad (back in
September, 2016) this was severely hobbled and startup spit out a lot
complaints to stderr about invalid resource values.  This implements
rudimentary macro expansion for '#define name value' within the data
stream that's fed to X, getting back decent default values and
eliminating the invalid value complaints.
2017-10-11 17:29:55 -07:00
Pasi Kallinen
46217bbda2 Qt4: Put yn queries in message history
When using OPTIONS=popup_dialog, or compiling with USE_POPUPS,
the yes/no -questions weren't put into the message history.
2017-10-11 09:50:22 +03:00
Pasi Kallinen
76a47b5e34 Qt4: Save message history to dumplog 2017-10-11 01:06:07 +03:00
Pasi Kallinen
c6f0058e3d Qt4: Handle saving/loading message history 2017-10-11 00:32:39 +03:00
Pasi Kallinen
2fcf1ad139 Qt4: put and get message history 2017-10-10 22:55:30 +03:00
Pasi Kallinen
4dff3a707e Qt4: Pile mark 2017-10-10 21:47:35 +03:00
Pasi Kallinen
dbacc98a1d Qt4: Fix wrong condition in search blocking 2017-10-10 21:13:37 +03:00