Commit Graph

961 Commits

Author SHA1 Message Date
Bart House
20e8482e6e Fix crash that can occur when panic is called early. 2018-11-10 20:26:20 -05:00
Bart House
0a3f6d17df Removed the defining of WIN32CONNDEBUG for NethackW.
Defined NOTTYGRAPHICS for NethackW.
2018-11-10 20:25:49 -05:00
Pasi Kallinen
0bb6754998 Fuzz testing debug tool
Add code to run a fuzz tester, simulating (more-or-less) random
keyboard mashing. There's no option to turn it on, you need to
set iflags.debug_fuzzer on via a debugger or something along
those lines.
2018-11-08 15:55:49 +02:00
PatR
50259daa72 tty/topl.c comment tidbit 2018-10-30 14:26:40 -07:00
Pasi Kallinen
312f7ccc10 X11: Fix msghistory restore segfault 2018-10-30 17:40:22 +02:00
PatR
d77ecd4ae5 X11 menu tweaks
Restore handling for keystrokes on PICK_NONE menus so that scrolling
via keys works for them.  (That handling was disabled as part of the
patch to support MENUCOLORS.)

Enable [cancel] button for all menus.  (That had apparently been
grayed out for PICK_NONE menus since day 1 for X11 windowing.)
2018-10-27 19:26:56 -07:00
Pasi Kallinen
fd60e11d8d X11: Remove leftover file display stuff 2018-10-27 20:47:27 +03:00
Pasi Kallinen
6d70997869 X11: Reuse menu code to display files
Previously the code used the ASCII Text Athena widgets for displaying
file contents. Unfortunately, the widget made it impossible to control
scrolling or pretty much anything else.

Use the menu code instead, making the file display window behave properly.
2018-10-27 13:58:59 +03:00
Pasi Kallinen
742ec3dd49 X11: Don't hilite the help ext menu entry
Both the "help" button at top and the "help" extended menu command
were hilighted by the X resources. Make the top buttons have
"btn_" prefix, so they're easily distinguished in the resources.
2018-10-25 15:58:22 +03:00
Pasi Kallinen
ef4f56242c X11: Make TTY status obey hilite_status 2018-10-24 20:04:28 +03:00
Pasi Kallinen
45ecbb84d6 X11: Move color and font structs
... so that other window types can also use them.
2018-10-23 20:30:48 +03:00
Pasi Kallinen
6381c32a39 X11: Adjust some colors to differentiate them 2018-10-23 17:48:54 +03:00
PatR
a6ab5c8a49 X11 status display
Flag some unused parameters and remove some unused variables.
Fix compile for !defined(TEXTCOLOR).
2018-10-22 15:28:19 -07:00
Pasi Kallinen
0470065b47 X11: TTY-style status lines
Set X resource NetHack*fancy_status: False to enable the TTY-style
status lines. Default is the fancy status.

This patch is somewhat unfinished - even though the TTY-style status
allow for status hilites, the colors don't work correctly yet.
Also changes the fancy status to use the windowport notification code.
2018-10-22 21:26:56 +03:00
Pasi Kallinen
b653d0d137 X11: Mouse wheel scrolling for message window 2018-10-21 19:30:05 +03:00
Pasi Kallinen
d648f4c371 X11: save and load message history 2018-10-21 17:26:24 +03:00
nhmall
77376fc979 two more windows supporting bits 2018-10-20 23:14:34 -04:00
nhmall
270c228b60 windows build mods to support branch change
Changes to be committed:
	modified:   sys/winnt/Makefile.gcc
	modified:   sys/winnt/Makefile.msc
	modified:   win/win32/vs2015/NetHack.vcxproj
	modified:   win/win32/vs2015/NetHackW.vcxproj
	modified:   win/win32/vs2015/files.props
	modified:   win/win32/vs2017/NetHack.vcxproj
	modified:   win/win32/vs2017/NetHackW.vcxproj
	modified:   win/win32/vs2017/files.props
2018-10-20 23:14:33 -04:00
PatR
f211953b43 WINCHAIN cleanup
This started out as some formatting cleanup for src/windows.c but
ended up removing calloc() from the WINCHAIN code, plus fixing a
couple of compiler complaints for win/chain/wc_trace.c.

I tried to actually run with +trace enabled and never managed to
get anything to happen.  trace_procs_init() was never called.  I've
never tried to use it before so don't know whether something which
used to work has gotten broken or I'm just doing it wrong.
2018-10-20 02:23:45 -07:00
Pasi Kallinen
7ed01793b4 X11: Fix couple issues from recent changes
Segfault due to arg array overflow, and a theoretical fix for
a hang on a Mac during player selection if -@ parameter was given
on the command line.
2018-10-20 11:17:41 +03:00
PatR
622b77476b X11 compile bit 2018-10-18 12:57:07 -07:00
Pasi Kallinen
3f94cee340 X11: Add key and mouse scrolling to extended command menu 2018-10-18 21:33:17 +03:00
Pasi Kallinen
d454855c54 X11: Handle the -@ parameter 2018-10-18 19:29:42 +03:00
Pasi Kallinen
fa5e5ac4b4 X11: Obey menu movement keys 2018-10-18 18:39:27 +03:00
Pasi Kallinen
c687bb7cd8 X11: Revert finding scrollbars in same window
Apparently this doesn't work, for some reason every widget reports
a different window, even when they are in the same window ...
Maybe widgets inside and outside a viewport are technically
in different windows?
2018-10-18 17:19:42 +03:00
PatR
f051ecb388 X11 winmenu.c housekeeping
Fix a couple of compiler complaints, and move some new local functions
out of the region of the file labeled `global functions'.
2018-10-17 14:43:44 -07:00
Pasi Kallinen
4db9a06c6c X11: Find scrollbars in same window
Adding scroll() translations to a window with no scrollbars
scrolled the main window message area.
2018-10-16 20:44:56 +03:00
Pasi Kallinen
24674e10e5 X11: Add geometry handler on perm_invent win only 2018-10-16 19:21:46 +03:00
Pasi Kallinen
8c17825afd X11: Remember perm_invent window geometry
Instead of remembering the geometry at window closing time,
remember it immediately when it changes.
2018-10-16 19:08:49 +03:00
Pasi Kallinen
b3c8acfeeb X11: Allow toggling mouse_support off
Prevents accidental mouse clicks on the map.
2018-10-16 18:09:54 +03:00
Pasi Kallinen
ddf6d13fd1 X11: Don't reuse perm_invent window for picking an object
The core wants to reuse the permanent inventory window for choosing
an object from inventory, but the perm_invent window could be
hard to focus - it could even be on another display!

Instead, create a temporary new window from which the user can
pick an inventory item.
2018-10-16 17:39:45 +03:00
Pasi Kallinen
011dfee945 X11: Allocate menu translation tables only once
Also force free the menu entry widgets when non-perm-invent
window is popped down.
2018-10-15 18:38:41 +03:00
Pasi Kallinen
b2d2521289 X11: Handle X errors via panic
This leaves a usable backtrace for debugging.
2018-10-13 15:07:27 +03:00
PatR
df1d413118 X11 build fix
Replace a C99ism.
2018-10-12 18:10:06 -07:00
nhmall
e25c7be719 keyhelp missed during Windows build steps
BUG REPORT:

    comments:
    1. I start a new character.
    2. The first command I type is '&'
    3. I type "?" and "<enter key>" at the prompt.
    4. Cannot open "keyhelp" data file!--More--
       ?    give a help message.

1559
2018-10-12 20:57:26 -04:00
Pasi Kallinen
d19a4ac590 Fix segfault in X11 perm_invent if it was partially obscured 2018-10-13 00:37:15 +03:00
Pasi Kallinen
9f2f232d99 X11: Allow bold attribute for menucolors 2018-10-12 20:46:19 +03:00
Pasi Kallinen
62234b871f X11: Remember perm_invent window geometry 2018-10-11 20:18:07 +03:00
Pasi Kallinen
c09260d8f7 X11: Handle paged menu control keys
X11 doesn't do menu paging, so handle the select page, invert page,
and unselect page like selecting, inverting or unselecting all.
2018-10-11 18:07:56 +03:00
Pasi Kallinen
bf81a981e3 X11: Mouse wheel scrolling in menus 2018-10-11 17:59:20 +03:00
PatR
7348d93763 X11 menus
Fix some compiler warnings and some formatting.

Builds cleanly but is otherwise untested.
2018-10-10 17:04:11 -07:00
Pasi Kallinen
e48c61c06f X11: Menucolors
Replace the XawList with our own lists of labels and command widgets
to allow for menucolors. Supports only inverse line attribute for now.

Allow key translations to work with menus on Linux.
2018-10-10 21:50:23 +03:00
Patric Mueller
ae61fe6f27 Fix Qt compilation 2018-10-10 03:08:15 +02:00
PatR
317f0b56fa tile.c formatting
Modify win/share/tilemap.c so that generated source file src/tile.c
uses similar formatting to the other sources.  Mainly, avoid tabs and
use 4 columns indentation instead of 8 columns in the short routine
near the end.

tilemap.c still treats STATUES_LOOK_LIKE_MONSTERS as conditional.
The main sources made that unconditional prior to release of 3.6.0.
2018-09-30 02:11:32 -07:00
nhmall
00dfed5b3a move assignment outside inner loop 2018-09-29 23:38:20 -04:00
nhmall
ef199f3763 one more update for the right of the status line
This tracks the last character written on each row and clears
the previous content from the end independently of which field
is actually involved.
2018-09-29 23:21:11 -04:00
nhmall
d1c5649890 revisit display artifact appearing to the right of status line
The prior fix for this was a bit flawed. It was only considering
the length of the last field, but what it really needed to do was
consider the placement of the last character of the last field
on the row relative to the placement of the last character of
the last field on the row previously.

If the new placement of that last character of the last field
is left of the previous placement, some clearing must be done.
2018-09-29 22:28:10 -04:00
nhmall
394c72d366 display cleanup only targets the right-most field where it's needed 2018-09-28 12:55:30 -04:00
nhmall
bdc9a6b98e follow-up bit 2018-09-28 02:28:54 -04:00
nhmall
5639539568 tty: fix leftover display artifact when last field on the row got smaller 2018-09-28 02:09:07 -04:00