Commit Graph

971 Commits

Author SHA1 Message Date
PatR
d438bf07c8 X11 resource defaults
Some of the items in NetHack.ad were separated from others by "!"
comment line rather than plain blank line and that tended to make it
look like the two items were directly related.  For the ones which
aren't, remove '!'.

I also expanded some comments and reordered a couple of resources,
moving 'slow' closer to top and advanced 'translations' farther down.
2018-11-14 17:18:12 -08:00
Bart House
489abb45f5 Added monitor dpi awareness to NetHackW splash dialog. 2018-11-13 20:48:56 -08:00
Bart House
8069659912 Adjust menu item rendering based on monitor dpi. 2018-11-12 22:40:36 -08:00
Bart House
4912149ff2 Implemented back buffer rendering to improve fit to screen rendering
quality.
2018-11-12 21:38:32 -08:00
Bart House
0bbc7cb6db Adjust tile size to bounds of text meterics when in ascii mode. 2018-11-12 19:36:08 -08:00
Bart House
3bb759a9ab Started work to support per monitor DPI. Using DPI to scale tiles
appropriately.

Renamed ntassert to nhassert.  (Naming mistake caused by using ntassert
at work).

Re-ordered a few more includes to get window headers included before
nethack headers.
2018-11-12 17:45:22 -08:00
Bart House
f3bc4af242 Removing support for Visual Studio 2015 solution. 2018-11-12 09:13:51 -08:00
Bart House
8944235282 Enforced the inclusion of windows headers before nethack headers.
Moved the code page 437 mapping table to winnt.c so that it could be
used in window and console clients.
Added check that fonts support unicode values we use from code page 437.
Use unicode to draw text if font supports it otherwise use ASCII.
2018-11-12 01:58:56 -08:00
nhmall
e87496b897 merge fluff 2018-11-11 10:48:08 -05:00
nhmall
a0b53ee391 merge 2018-11-11 10:29:52 -05:00
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