Commit Graph

692 Commits

Author SHA1 Message Date
PatR
a34d327159 bit of X11 reformating
Cleanup up the copyright notice in dialogs.c, and replace some tabs.
2016-01-12 02:20:43 -08:00
PatR
c5db7f57a3 X11 extended command menu
Restore the ability to select extended commands by keystroke.
The key translation stuff had gotten attached to the wrong widget.

When using keys to highlight an entry in the extended command menu,
don't reset the key-by-key handling so quickly.  (On second and
subsequent keystrokes, if you waited more than 0.5 second, the new
key started picking an extended command from scratch rather than
continuing the current one, making it pretty hard to disambiguate
commands which have the same initial letter.  Now the delay
threshold is 2.5 seconds.  In theory that should become a user-
preference resource but I don't think it's worth the effort.)

Display the help choice in response to '?'.

Clean up the formatting of the top two buttons (dismiss + help).

Start with a scroll bar if the menu is too big to fit on the screen.
Prior to this, on OSX, the full menu would be constructed but any
of it that was 'displayed' beneath the bottom of the screen was
inaccessible because it couldn't be dragged higher and couldn't be
resized to get a scroll bar (since the way to resize on OSX is by
dragging the bottom right corner--which was off the screen).

The problems I mentioned recently are still present:  when scroll
bar is present, I can click beneath it and it moves down, but
neither dragging it up nor clicking above it will move it back up.
Fortunately the recently implemented up and down arrows both work,
even after clicking/dragging starts failing.

There was a lot of trial and error involved here.  Most of it
eventually got phased out, but the mystery of 'defaultDistance'
(which is reported to be 0 but is actually 4) remains.  The screen
height stuff at the end ought to be fixed up if someone can figure
out how to get the width of a horizontal scroll bar or the height
of a title bar.  (I'm sure I used to know how to do the latter,
but that was 25 or so years ago, and in Fortran with Xlib rather
than Xt or Xaw....)
2016-01-12 02:15:35 -08:00
Pasi Kallinen
a8172e1208 Fix unreferenced variable 2016-01-10 18:24:38 +02:00
Pasi Kallinen
e7d65a44cd TTY: Add compile-time option for tile data hinting
Several people have asked if 3.6.0 supports playing with tiles on
a public server. Because there's no way for the user's end to know
what that white @ is, this adds special console escape codes for
tile hinting.

The idea was originally a patch called TelnetTiles by Justin Hiltscher,
but this expanded version comes via NAO, where it's been in use for years.

This is basically an interim hack, which should go away when/if
we support actual client-server model.
2016-01-10 10:53:15 +02:00
Pasi Kallinen
befc6a65b5 TTY: Add menu_overlay option
This was a request from a blind player.  It's hard to find
the left edge of the menu when it's drawn on the map, so
clear the screen and align menus to the left edge of the screen
when this option is turned off.

Originally this was called the window edge patch.
2016-01-08 22:17:40 +02:00
PatR
e6fa0ce809 provisional fix for bz239 - '[tty] Enter key...'
'... inconsistency in character creation menus'.

During role selection, the final 'is this ok?' menu has 'yes'
preselected so accepted <return> or <enter> to answer yes.  The
pick-role, pick-race, &c menus prior to getting to that stage didn't
have a default, so using <enter> meant nothing was chosen, and choosing
nothing was treated as a request to quit.  This changes that so it's a
request for 'random' instead.

'Provisional fix' because it ought to do this by making 'random' be a
pre-selected menu entry so that the default choice is visible.  But
that takes more effort than I'm inclined to expend on this.
2016-01-06 00:07:54 -08:00
nhmall
14ce76a159 windows visual studio 2013 build updates 2016-01-01 22:01:25 -05:00
Pasi Kallinen
8b0ada1d31 Allow scrolling X11 extended cmd menu with cursors 2016-01-02 00:47:10 +02:00
Pasi Kallinen
8e7e79448e Enable scroll bar in X11 menu windows 2016-01-01 21:24:55 +02:00
nhmall
9a5340a3bf windows: fix undefined reference in release build
Changes to be committed:
	modified:   win/win32/mswproc.c
2015-12-31 20:26:47 -05:00
nhmall
5964438e8f use explicit int sizes in win/share/tile2bin.c
64-bit longs caused tile2bin to write an invalid bmp file.
2015-12-29 21:21:05 -05:00
PatR
c5e2604cca still more while-helpless 2015-12-18 07:42:23 -08:00
PatR
8f2a408ef3 fix #H4065 - unnecessary role select confirmation
If player specified all four facets of role:  role, race, gender, and
alignment, via command line or option settings, the tty interface still
asked the player to confirm whether the character's role/&c was ok?
Skip that confirmation when all four things have already been chosen.
2015-12-17 06:37:08 -08:00
PatR
92858c3e3c more menu <space> screwup
Like the just fixed naming for discoveries list, there are several
other add_menu() calls which specify <space> instead of 0 as a useless
selector on separator lines.  These others are all for role selection,
where menus don't get big enough to need next-page.

I don't know what I was thinking at the time, although it must have
seemed like a good idea for some reason....
2015-12-16 18:42:45 -08:00
nhmall
fa092f5fe9 housekeeping for 3.6.1
Changes to be committed:
	modified:   Files
	modified:   README
	modified:   dat/history
	modified:   doc/Guidebook.mn
	modified:   doc/Guidebook.tex
	modified:   include/global.h
	modified:   include/obj.h
	modified:   include/patchlevel.h
	modified:   src/invent.c
	modified:   src/objnam.c
	modified:   src/shknam.c
	modified:   src/sounds.c
	modified:   src/spell.c
	modified:   sys/winnt/Install.nt
	modified:   sys/winnt/nethack.def
	modified:   win/macosx/NetHackGuidebook.applescript
	modified:   win/macosx/NetHackTerm.applescript
	modified:   win/win32/mswproc.c
2015-12-16 17:52:34 -05:00
nhmall
375a2c28f1 fixes updates for win32gui
Changes to be committed:
	modified:   doc/fixes36.0
	modified:   doc/fixes36.1
	modified:   win/win32/mhsplash.c
	modified:   win/win32/mswproc.c
2015-12-10 07:51:33 -05:00
nhmall
585e9f1b35 fix a 'program in disorder' in tt_oname
Changes to be committed:
	modified:   win/win32/winhack.c

sys_early_init was never called for win32 GUI. That was causing "rnd(0) -
program in disorder" in tt_oname.
2015-12-07 06:48:05 -05:00
nhmall
d267cb1b0f more windows DEBUG 2015-12-02 23:24:34 -05:00
nhmall
8bd70be165 windows build without DEBUG defined in global.h
Changes to be committed:
	modified:   include/global.h
	modified:   sys/share/pcmain.c
	modified:   win/win32/mswproc.c
2015-12-02 23:19:04 -05:00
PatR
e78e393a81 lint cleanup
A couple of things 'gcc -g' didn't care about 'gcc -O2' mistakenly
thinks 'may be used uninitialized'.
2015-12-02 02:36:29 -08:00
Haoyang Wang
70aa7fe818 Merge branch 'master' into mac-build-tty-pkg 2015-11-18 13:23:35 -08:00
PatR
5e5a78fdb2 X11 pilemark.xbm
Update the unix Makefiles and the older OSX hints files to handle the
pile marker tile overlay.  I didn't touch hints/macosx10.10 and .11
since I think there's still a merge for them pending.

A couple of formatting tweaks for bemain.c are included, for no
compelling reason.  What are the odds that anyone will every build
that again?
2015-11-18 03:04:35 -08:00
PatR
0072daa952 tty_exit_nhwindows
Keep window bookkeeping up to date when tty interface is shuting down.

The other interfaces should do something similar when they make windows
known to the core become unavailable.
2015-11-15 15:35:48 -08:00
PatR
2e5818d803 tty build warning
Use casts to try to suppress a couple of assignments of long to short
that Michael's compiler warns about.  'cw->maxrow' might have a value
that's too big for 'short' (when dealing with really big menus), but
'cw->maxcol' never will (unless someone comes up with a terminal or
emulator that's wider that 32K-1 characters...).
2015-11-13 01:12:43 -08:00
nhmall
39a1667677 Repair recent tile mapping error when MAIL is undefined
Changes to be committed:
	modified:   src/objects.c
	modified:   win/share/tilemap.c

Warnings during tile builds (and incorrect tile mappings
at run time when MAIL wasn't defined):
	Creating 16x16 binary tile files (this may take some time)
	warning: for tile 325 (numbered 325) of objects.txt,
	        found 'ETAOIN SHRDLU' while expecting 'stamped / mail'
	warning: for tile 326 (numbered 326) of objects.txt,
	        found 'LOREM IPSUM' while expecting 'ETAOIN SHRDLU'

The recent addition of the first new extra scroll descriptions in a
very long time caused this problem to show up when MAIL was undefined.

There was a magic number in use that made an assumption that there
were only 4 such extra scroll descriptions, those being
"FOOBIE BLETCH", "TEMOV","GARVEN DEH","READ ME"
2015-11-12 00:42:52 -05:00
nhmall
ecd277cec2 unused parameter warning and an invalid index
Changes to be committed:
	modified:   win/tty/wintty.c
2015-11-11 09:57:05 -05:00
PatR
f97c3dec0a tty memory management at program termination
Release some dynamically allocated memory prior to exit.  These were
previously left alone due to assumed complexity (at least by me...),
but dealing with them turned out to be straightforward.

|#if FREE_ALL_MEMORY
 free BASE_WINDOW  -- tty-specific; other windows are drawn on top of it
 free ttyDisplay   -- tty's basic data structure
|#endif
 free nh_HI, nh_HE -- termcap values handled differently from the rest

These are the last things that 'heaputil' always reported as not freed
for the basic Unix+tty configuration.  (I've observed other things not
being freed; those are post-3.4.3 bugs that need to be found and fixed.)
2015-11-11 01:43:03 -08:00
Haoyang Wang
2894f1f873 fix make install; fix the package directory tree 2015-11-09 00:22:33 -08:00
Haoyang Wang
37b7229326 Change the root directory to /usr/local/games 2015-11-09 00:22:33 -08:00
Pasi Kallinen
8bfa1579e7 Remove stray character 2015-11-07 10:59:43 +02:00
PatR
a975287467 couple of string concatenations in win/tty/
Plus a modest amount (really!) of reformatting.

Also got rid of 'copy_of()' since dupstr() does the same thing [except
for the 'treat Null as ""' part; when needed, that can be done in the
call:  dupstr(!str ? "" : str)].
2015-11-06 16:39:29 -08:00
PatR
61319ef1ca force NHSUBST for X11 icons 2015-11-02 01:51:58 -08:00
Pasi Kallinen
e022486cdc Actually destroy the character selection window 2015-11-01 20:49:32 +02:00
PatR
07e2d6175f X11 icon version numbering
One of the steps in the pre-release checklist:  make sure the version
number in the X11 icons is up to date.  nh32icon and nh56icon both have
the version number (major and minor values only, not patchlevel).
Update it from 3.4 to 3.6 for both.  (nh72icon doesn't have any version
info in its design, so doesn't need any update.)

The X11 'bitmap' program strips out the header comments, so I modified
the image, saved it, used 'git diff --patch' to capture the changes,
'git checkout' to revert to the existing file, and edited in the diff
bands pertaining to the changed data.  No doubt this could have been
done in some easier fashion, but it was victory just to find the bitmap
utility and achieve results using a one-button mouse--worse, a clumsy
touchpad substituting for one--when it's designed for a three-button one.
2015-11-01 03:59:55 -08:00
Pasi Kallinen
af1c77808b Comment typofixes, pt 4 2015-10-17 18:47:31 +03:00
Pasi Kallinen
f056bdb429 Comment typofixes, pt 2 2015-10-17 13:15:46 +03:00
Pasi Kallinen
798b2e76f9 One more scroll name, a tongue twister 2015-09-17 19:32:28 +03:00
Pasi Kallinen
9a4d29b365 Add new scroll names
via UnNetHack, with some slight changes:

1) Folded the two Portal references into one
2) Removed "ACHAT SHTAYIM SHALOSH" ("One Two Three" in Hebrew and apparently
   Uri Geller's catchphrase) - I know nothing about Hebrew nor Geller, or
   whether this would be appropriate to add.
3) Added "XOR OTA" ("Atorox", reference to Finnish fandom and early scifi)
2015-08-30 21:29:08 +03:00
Pasi Kallinen
25ea071aaa Fix typo "promt" 2015-08-30 20:34:07 +03:00
Pasi Kallinen
9dc979d414 TTY: Separate hilite_pile option 2015-06-23 07:43:52 +03:00
nhmall
5df350d548 separate option to toggle hilite_pile
Beta tester report.

The use of use_inverse meant that you couldn't selectively
choose to hilite pets but not piles. Add its own option.
2015-06-22 15:51:43 -04:00
Derek S. Ray
7f669de286 tiles.bmp doesn't need to be in the binary folder 2015-06-21 14:12:10 -04:00
nhmall
fa00bb060e visual studio updates 2015-06-20 09:17:34 -04:00
nhmall
4a9953ae0d more pilemark and win32 changes
Changes to be committed:
	modified:   Files
	deleted:    sys/winnt/Makefile.bcc
	modified:   sys/winnt/Makefile.gcc
	modified:   win/win32/winMS.h

Since borland Makefile isn't operational, remove it for
this release as recommended.

Changes to install.nt pending.
2015-06-20 08:50:32 -04:00
nhmall
32200de64c more pilemark 2015-06-20 08:38:11 -04:00
nhmall
385d4c4293 Pilemark support for windows
Changes to be committed:
	modified:   win/win32/mhmap.c
	modified:   win/win32/winMS.h
	modified:   win/win32/winhack.c
2015-06-20 08:33:49 -04:00
Alex Kompel
598ee94628 win32_gui: load pile mark bitmap on startup 2015-06-17 11:32:07 -07:00
nhmall
b7b6431ad8 more pilemark tinkering 2015-06-14 19:27:28 -04:00
nhmall
a0228593e9 mistake in .uu file
Changes to be committed:
	modified:   win/win32/pilemark.uu
2015-06-14 18:41:05 -04:00
nhmall
07f6dec128 try to add pilemark support
Changes to be committed:
	modified:   Files
	modified:   sys/winnt/Makefile.msc
	modified:   win/win32/mhmap.c
	new file:   win/win32/pilemark.uu
	modified:   win/win32/resource.h
	modified:   win/win32/winMS.h
	modified:   win/win32/winhack.rc
2015-06-14 18:33:32 -04:00