diff --git a/Files b/Files index 2974df3bf..a2e10eb35 100644 --- a/Files +++ b/Files @@ -273,12 +273,12 @@ stat.h sys/winnt: (files for Windows 7/8.x/10 version) -Install.nt Makefile.gcc Makefile.msc console.rc -defaults.nh nethack.def nh340key.c nhdefkey.c -nhico.uu nhraykey.c nhsetup.bat ntsound.c -nttty.c porthelp stub-pdcscrn.c stubs.c -sysconf win10.c win10.h win32api.h -windmain.c winnt.c winos.h +Install.nt Makefile.gcc Makefile.msc console.rc +.nethackrc.template nethack.def nh340key.c nhdefkey.c +nhico.uu nhraykey.c nhsetup.bat ntsound.c +nttty.c porthelp stub-pdcscrn.c stubs.c +sysconf.template win10.c win10.h win32api.h +windmain.c winnt.c winos.h util: (files for all versions) diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index c10dad3d2..eedab0537 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -1,4 +1,4 @@ -.\" $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.324 $ $NHDT-Date: 1572690738 2019/11/02 10:32:18 $ +.\" $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.325 $ $NHDT-Date: 1572735924 2019/11/02 23:05:24 $ .\" .\" This is an excerpt from the 'roff' man page from the 'groff' package. .\" NetHack's Guidebook.mn currently does *not* adhere to these guidelines. @@ -2625,16 +2625,17 @@ and Mac OS X it is \(lq.nethackrc\(rq in the user's home directory. The file may not exist, but it is a normal ASCII text file and can be created with any text editor. .pg -On Windows, if you manually installed from the zip file, -it is \(lqdefaults.nh\(rq -in the same folder as nethack.exe or nethackW.exe. -If you installed using the Microsoft Store, it is -\(lqdefaults.nh\(rq in the following folder: -\(lq\\%USERPROFILE%\\NetHack\(rq. There, a starting template is -provided for you to use to create your \(lqdefaults.nh\(rq -configuration file. It is \(lqdefaults.tmp\(rq also in the following -folder: -\(lq\\%USERPROFILE%\\NetHack\(rq +On Windows, it is \(lq.nethackrc\(rq in +\(lq\\%USERPROFILE%\\NetHack\\3.6\(rq. The file may not exist, +but it is a normal ASCII text file can can be created with any +text editor. +.pg +After running NetHack for the first time, you should find a default +template for the configuration file named \(lq.nethackrc.template\(rq +in \(lq\\%USERPROFILE%\\NetHack\\3.6\(rq. +.pg +If you had not created the configuration file, NetHack will create +the configuration file for you using the default template file. .pg On MS-DOS, it is \(lqdefaults.nh\(rq in the same folder as nethack.exe. .pg @@ -4605,10 +4606,10 @@ z S_zruty (zruty) .\" don't hyphenate file name across lines .hw sysconf .pg -Notes: several symbols in this table appear to be blank. They are the -space character, except for S_pet_override and S_player_override which -don't have any default value and can only be used if enabled in the -\(lqsysconf\(rq file. +Notes: several symbols in this table appear to be blank. +They are the space character, except for S_pet_override +and S_player_override which don't have any default value +and can only be used if enabled in the \(lqsysconf\(rq file. .pg S_rock is misleadingly named; rocks and stones use S_gem. Statues and boulders are the rock being referred to, but since @@ -5158,7 +5159,7 @@ miscreants in this, the list of Dungeoneers: . .TS S center; -c c c. +c2 c2 c. .\"TABLE_START Adam Aronow J. Ali Harlow Mikko Juola Alex Kompel Janet Walz Nathan Eady diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex index 2de9d4399..ef6c26b8f 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -2875,16 +2875,19 @@ directory. The file may not exist, but it is a normal ASCII text file and can be created with any text editor.\\ %.lp "" -On Windows, if you manually installed from the zip file, -it is \mbox{``defaults.nh''} in the same folder as -\mbox{{\it nethack.exe\/}} or \mbox{{\it nethackW.exe\/}}. -If you installed using the Microsoft Store, it is \mbox{``defaults.nh''} in -the following folder: -\mbox{{``\%USERPROFILE\%\textbackslash NetHack''}}. -There, a starting template is provided for you to use to create your -\mbox{``defaults.nh''} configuration file. It is \mbox{``defaults.tmp''} -also in the following folder: -\mbox{{``\%USERPROFILE\%\textbackslash NetHack''}}.\\ +On Windows, it is \mbox{``.nethackrc''} in the foler +\mbox{{``\%USERPROFILE\%\textbackslash NetHack\textbackslash 3.6''}}. The +file may not exist, but it is a normal ASCII text file and can be created +with any text editor.\\ + +%.lp "" +After runing {\it NetHack\/} for the first time, you should find a default +template for ths configuration file named \mbox{``.nethackrc.template''} in +\mbox{{``\%USERPROFILE\%\textbackslash NetHack\textbackslash 3.6''}}. + +%.lp "" +If you had not created the configuration file, {\it NetHack\/} will create +the configuration file for you using the default template file. %.lp "" On MS-DOS it is \mbox{``defaults.nh''} in the same folder as @@ -5039,7 +5042,8 @@ Default & Symbol Name & Description\\ \verb+@+ & S\verb+_+ss3 & (magic shield 3 of 4)\\ \verb@*@ & S\verb+_+ss4 & (magic shield 4 of 4)\\ \verb@^@ & S\verb+_+statue\verb+_+trap & (statue trap)\\ -\verb@ @ & S\verb+_+stone & (dark part of a room)\\ +\verb@ @ & S\verb+_+stone & (solid rock or unexplored terrain\\ + & & \,or dark part of a room)\\ \verb@]@ & S\verb+_+strange\verb+_+obj & (strange object)\\ \verb@-@ & S\verb+_+sw\verb+_+bc & (swallow bottom center)\\ \verb@\@ & S\verb+_+sw\verb+_+bl & (swallow bottom left)\\ @@ -5054,7 +5058,7 @@ Default & Symbol Name & Description\\ \verb@\@ & S\verb+_+throne & (opulent throne)\\ \verb@-@ & S\verb+_+tlcorn & (top left corner)\\ \verb@|@ & S\verb+_+tlwall & (wall)\\ -\verb@(@ & S\verb+_+tool & (useful item (pick-axe\, key\, lamp...))\\ +\verb@(@ & S\verb+_+tool & (useful item (pick-axe, key, lamp...))\\ \verb@^@ & S\verb+_+trap\verb+_+door & (trap door)\\ \verb@t@ & S\verb+_+trapper & (trapper or lurker above)\\ \verb@-@ & S\verb+_+trcorn & (top right corner)\\ @@ -5083,16 +5087,30 @@ Default & Symbol Name & Description\\ \verb@w@ & S\verb+_+worm & (worm)\\ \verb@~@ & S\verb+_+worm\verb+_+tail & (long worm tail)\\ \verb@W@ & S\verb+_+wraith & (wraith)\\ -\verb@x@ & S\verb+_+xan & (xan or other mythical/fantastic insect)\\ +\verb@x@ & S\verb+_+xan & (xan or other extraordinary insect)\\ \verb@X@ & S\verb+_+xorn & (xorn)\\ \verb@Y@ & S\verb+_+yeti & (apelike creature)\\ \verb@Z@ & S\verb+_+zombie & (zombie)\\ \verb@z@ & S\verb+_+zruty & (zruty)\\ -\verb@ @ & S\verb+_+pet\verb+_+override & (any pet if sysconf accessibility is set)\\ -\verb@ @ & S\verb+_+player\verb+_+override & (hero if sysconf accessibility is set) +\verb@ @ & S\verb+_+pet\verb+_+override & (any pet if ACCESSIBILITY=1 is set)\\ +\verb@ @ & S\verb+_+player\verb+_+override & (hero if ACCESSIBILITY=1 is set) \end{longtable}% } +\hyphenation{sysconf} %no syllable breaks => don't hyphenate file name +%.pg +Notes: several symbols in this table appear to be blank. +They are the space character, except for S\verb+_+pet\verb+_+override +and S\verb+_+player\verb+_+override which don't have any default value +and can only be used if enabled in the ``sysconf'' file. + +%.pg +S\verb+_+rock is misleadingly named; rocks and stones use S\verb+_+gem. +Statues and boulders are the rock being referred to, but since +version 3.6.0, statues are displayed as the monster they depict. +So S\verb+_+rock is only used for boulders and not used at all if +overridden by the more specific S\verb+_+boulder. + %.pg %.hn 2 \subsection*{Configuring {\it NetHack\/} for Play by the Blind} @@ -5140,7 +5158,9 @@ See the previous section for the special symbols S\verb+_+pet\verb+_+override to force a consistent symbol for all pets and S\verb+_+player\verb+_+override to force a unique symbol for the player character if {\it accessibility\/} is enabled in the {\it sysconf\/} file. -The most crucial settings to make the game accessible are: + +%.pg +The most crucial settings to make the game more accessible are: %.pg \blist{} %.lp diff --git a/doc/fixes36.3 b/doc/fixes36.3 index df3a55a30..04a1e0685 100644 --- a/doc/fixes36.3 +++ b/doc/fixes36.3 @@ -350,6 +350,9 @@ unix: sysconf CHECK_PLNAME=1 wouldn't work if attempt to obtain unix username unix+curses: startup error only reset terminal for tty; one noticeable example was answering 'n' to "Destroy old game?" Windows: some startup error messages were not being delivered successfully +WindowsGUI: player selection dialog box layout was not being adjusted for DPI +Windows: signifiant changes to default directory choices. see documentation + for details. General New Features diff --git a/include/ntconf.h b/include/ntconf.h index ab97ea9b7..e4d0113b1 100644 --- a/include/ntconf.h +++ b/include/ntconf.h @@ -78,9 +78,8 @@ * objects being thrown when the hangup occurs. \ */ -#define MAIL -#define CONFIG_FILE "defaults.nh" -#define CONFIG_TEMPLATE "defaults.template" +#define CONFIG_FILE ".nethackrc" +#define CONFIG_TEMPLATE ".nethackrc.template" #define SYSCF_TEMPLATE "sysconf.template" #define SYMBOLS_TEMPLATE "symbols.template" #define GUIDEBOOK_FILE "Guidebook.txt" diff --git a/include/pcconf.h b/include/pcconf.h index f113c18b3..f1a1b7020 100644 --- a/include/pcconf.h +++ b/include/pcconf.h @@ -21,10 +21,8 @@ * Note: 3.6.x was not verified with Symantec C. */ -#if defined(MSDOS) #define CONFIG_FILE "defaults.nh" #define GUIDEBOOK_FILE "Guidebook.txt" -#endif /* * The following options are somewhat configurable depending on diff --git a/sys/winnt/defaults.nh b/sys/winnt/.nethackrc.template similarity index 100% rename from sys/winnt/defaults.nh rename to sys/winnt/.nethackrc.template diff --git a/sys/winnt/Makefile.gcc b/sys/winnt/Makefile.gcc index 54a14572e..9bb2f920e 100644 --- a/sys/winnt/Makefile.gcc +++ b/sys/winnt/Makefile.gcc @@ -1,4 +1,4 @@ -# NetHack 3.6 Makefile.gcc $NHDT-Date: 1546174698 2018/12/30 12:58:18 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.71 $ +# NetHack 3.6 Makefile.gcc $NHDT-Date: 1572748375 2019/11/03 02:32:55 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.80 $ # Copyright (c) 2010 by Michael Allison # NetHack may be freely redistributed. See license for details. # @@ -764,11 +764,11 @@ else $(subst /,\,copy $(DAT)/*.lev $(GAMEDIR)) $(subst /,\,if exist $(GAMEDIR)/makefile del $(GAMEDIR)/makefile) endif - $(subst /,\,if not exist $(GAMEDIR)/sysconf copy $(MSWSYS)/sysconf $(GAMEDIR)) - $(subst /,\,if exist $(DAT)/symbols copy $(DAT)/symbols $(GAMEDIR)) + $(subst /,\,if exist $(MSWSYS)/sysconf.template copy $(MSWSYS)/sysconf.template $(GAMEDIR)) + $(subst /,\,if exist $(DAT)/symbols copy $(DAT)/symbols $(GAMEDIR)/symbols.template) $(subst /,\,if exist $(DOC)/guidebook.txt copy $(DOC)/guidebook.txt $(GAMEDIR)/Guidebook.txt) $(subst /,\,if exist $(DOC)/nethack.txt copy $(DOC)/nethack.txt $(GAMEDIR)/NetHack.txt) - $(subst /,\,if not exist $(GAMEDIR)/defaults.nh copy $(MSWSYS)/defaults.nh $(GAMEDIR)/defaults.nh) + $(subst /,\,if exist $(MSWSYS)/.nethackrc.template copy $(MSWSYS)/.nethackrc.template $(GAMEDIR)) $(subst /,\,-if not exist $(GAMEDIR)/record. echo.>$(GAMEDIR)/record.) # # diff --git a/sys/winnt/Makefile.msc b/sys/winnt/Makefile.msc index 6eeb814bb..a652016d7 100644 --- a/sys/winnt/Makefile.msc +++ b/sys/winnt/Makefile.msc @@ -1,4 +1,4 @@ -# NetHack 3.7 Makefile.msc $NHDT-Date: 1554784482 2019/04/09 04:34:42 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.153 $ */ +# NetHack 3.6 Makefile.msc $NHDT-Date: 1572748386 2019/11/03 02:33:06 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.167 $ */ # Copyright (c) NetHack PC Development Team 1993-2019 # #============================================================================== @@ -702,13 +702,13 @@ $(O)install.tag: $(DAT)\data $(DAT)\rumors $(DAT)\dungeon \ copy $(DAT)\*.lev $(GAMEDIR) if exist $(GAMEDIR)\makefile del $(GAMEDIR)\makefile ! ENDIF - if not exist $(GAMEDIR)\sysconf copy $(MSWSYS)\sysconf $(GAMEDIR) - if exist $(DAT)\symbols copy $(DAT)\symbols $(GAMEDIR) + if exist $(MSWSYS)\sysconf.template copy $(MSWSYS)\sysconf.template $(GAMEDIR) + if exist $(DAT)\symbols copy $(DAT)\symbols $(GAMEDIR)\symbols.template if exist $(DOC)\guidebook.txt copy $(DOC)\guidebook.txt $(GAMEDIR)\Guidebook.txt if exist $(DOC)\nethack.txt copy $(DOC)\nethack.txt $(GAMEDIR)\NetHack.txt @if exist $(GAMEDIR)\NetHack.PDB echo NOTE: You may want to remove $(GAMEDIR:\=/)/NetHack.PDB to conserve space @if exist $(GAMEDIR)\NetHackW.PDB echo NOTE: You may want to remove $(GAMEDIR:\=/)/NetHackW.PDB to conserve space - -if not exist $(GAMEDIR)\defaults.nh copy $(MSWSYS)\defaults.nh $(GAMEDIR)\defaults.nh + if exist $(MSWSYS)\.nethackrc.template copy $(MSWSYS)\.nethackrc.template $(GAMEDIR) -if not exist $(GAMEDIR)\record. goto>$(GAMEDIR)\record. echo install done > $@ diff --git a/sys/winnt/sysconf b/sys/winnt/sysconf.template similarity index 100% rename from sys/winnt/sysconf rename to sys/winnt/sysconf.template diff --git a/sys/winnt/win10.c b/sys/winnt/win10.c index 07b898107..abf76d9eb 100644 --- a/sys/winnt/win10.c +++ b/sys/winnt/win10.c @@ -9,6 +9,21 @@ #include "hack.h" +typedef DPI_AWARENESS_CONTEXT(WINAPI *GetThreadDpiAwarenessContextProc)(VOID); +typedef BOOL(WINAPI *AreDpiAwarenessContextsEqualProc)( + DPI_AWARENESS_CONTEXT dpiContextA, DPI_AWARENESS_CONTEXT dpiContextB); +typedef UINT(WINAPI *GetDpiForWindowProc)(HWND hwnd); +typedef LONG (WINAPI *GetCurrentPackageFullNameProc)(UINT32 *packageFullNameLength, + PWSTR packageFullName); + +typedef struct { + BOOL Valid; + GetThreadDpiAwarenessContextProc GetThreadDpiAwarenessContext; + AreDpiAwarenessContextsEqualProc AreDpiAwarenessContextsEqual; + GetDpiForWindowProc GetDpiForWindow; + GetCurrentPackageFullNameProc GetCurrentPackageFullName; +} Win10; + Win10 gWin10 = { 0 }; void win10_init() @@ -37,7 +52,7 @@ void win10_init() HINSTANCE hKernel32 = LoadLibraryA("kernel32.dll"); if (hKernel32 == NULL) - panic("Unable to load user32.dll"); + panic("Unable to load kernel32.dll"); gWin10.GetCurrentPackageFullName = (GetCurrentPackageFullNameProc) GetProcAddress(hKernel32, "GetCurrentPackageFullName"); if (gWin10.GetCurrentPackageFullName == NULL) diff --git a/sys/winnt/win10.h b/sys/winnt/win10.h index 4ba834995..bbb0ca9a3 100644 --- a/sys/winnt/win10.h +++ b/sys/winnt/win10.h @@ -7,21 +7,6 @@ #include "win32api.h" -typedef DPI_AWARENESS_CONTEXT(WINAPI *GetThreadDpiAwarenessContextProc)(VOID); -typedef BOOL(WINAPI *AreDpiAwarenessContextsEqualProc)( - DPI_AWARENESS_CONTEXT dpiContextA, DPI_AWARENESS_CONTEXT dpiContextB); -typedef UINT(WINAPI *GetDpiForWindowProc)(HWND hwnd); -typedef LONG (WINAPI *GetCurrentPackageFullNameProc)(UINT32 *packageFullNameLength, - PWSTR packageFullName); - -typedef struct { - BOOL Valid; - GetThreadDpiAwarenessContextProc GetThreadDpiAwarenessContext; - AreDpiAwarenessContextsEqualProc AreDpiAwarenessContextsEqual; - GetDpiForWindowProc GetDpiForWindow; - GetCurrentPackageFullNameProc GetCurrentPackageFullName; -} Win10; - typedef struct { double scale; // dpi of monitor / 96 int width; // in pixels @@ -30,12 +15,9 @@ typedef struct { int left; // in desktop coordinate pixel space } MonitorInfo; -extern Win10 gWin10; - void win10_init(); int win10_monitor_dpi(HWND hWnd); double win10_monitor_scale(HWND hWnd); -void win10_monitor_size(HWND hWnd, int * width, int * height); void win10_monitor_info(HWND hWnd, MonitorInfo * monitorInfo); BOOL win10_is_desktop_bridge_application(void); diff --git a/sys/winnt/windmain.c b/sys/winnt/windmain.c index 0650a8af8..56c62240d 100644 --- a/sys/winnt/windmain.c +++ b/sys/winnt/windmain.c @@ -304,23 +304,23 @@ void copy_config_content() /* Keep templates up to date */ /* TODO: Update the package to store config file as .nethackrc */ update_file(g.fqn_prefix[CONFIGPREFIX], CONFIG_TEMPLATE, - g.fqn_prefix[DATAPREFIX], CONFIG_FILE, FALSE); + g.fqn_prefix[DATAPREFIX], CONFIG_TEMPLATE, FALSE); update_file(g.fqn_prefix[SYSCONFPREFIX], SYSCF_TEMPLATE, - g.fqn_prefix[DATAPREFIX], SYSCF_FILE, FALSE); + g.fqn_prefix[DATAPREFIX], SYSCF_TEMPLATE, FALSE); /* If the required early game file does not exist, copy it */ /* NOTE: We never replace .nethackrc or sysconf */ copy_file(g.fqn_prefix[CONFIGPREFIX], CONFIG_FILE, - g.fqn_prefix[DATAPREFIX], CONFIG_FILE); + g.fqn_prefix[DATAPREFIX], CONFIG_TEMPLATE); copy_file(g.fqn_prefix[SYSCONFPREFIX], SYSCF_FILE, - g.fqn_prefix[DATAPREFIX], SYSCF_FILE); + g.fqn_prefix[DATAPREFIX], SYSCF_TEMPLATE); /* Update symbols and save a copy if we are replacing */ /* TODO: Can't HACKDIR be changed during option parsing causing us to perhaps be checking options against the wrong symbols file? */ update_file(g.fqn_prefix[HACKPREFIX], SYMBOLS, - g.fqn_prefix[DATAPREFIX], SYMBOLS, TRUE); + g.fqn_prefix[DATAPREFIX], SYMBOLS_TEMPLATE, TRUE); } void @@ -334,7 +334,7 @@ copy_hack_content() /* Keep templates up to date */ update_file(g.fqn_prefix[HACKPREFIX], SYMBOLS_TEMPLATE, - g.fqn_prefix[DATAPREFIX], SYMBOLS, FALSE); + g.fqn_prefix[DATAPREFIX], SYMBOLS_TEMPLATE, FALSE); } diff --git a/win/win32/vs2017/NetHackPackage.wapproj b/win/win32/vs2017/NetHackPackage.wapproj index daf3091c8..514baa251 100644 --- a/win/win32/vs2017/NetHackPackage.wapproj +++ b/win/win32/vs2017/NetHackPackage.wapproj @@ -113,8 +113,8 @@ - - NetHackW\defaults.nh + + NetHackW\.nethackrc.template NetHackW\Guidebook.txt @@ -128,11 +128,11 @@ NetHackW\opthelp - - NetHackW\symbols + + NetHackW\symbols.template - - NetHackW\sysconf + + NetHackW\sysconf.template diff --git a/win/win32/vs2017/afternethack.proj b/win/win32/vs2017/afternethack.proj index 912d75e89..ca39fddfc 100644 --- a/win/win32/vs2017/afternethack.proj +++ b/win/win32/vs2017/afternethack.proj @@ -3,13 +3,12 @@ - - - - + Inputs="$(SysWinntDir).nethackrc.template;$(DocDir)Guidebook.txt;$(DatDir)license;$(SysWinntDir)sysconf.template;$(DocDir)nethack.txt;$(DatDir)symbols;$(WinWin32Dir)record;$(DatDir)opthelp" + Outputs="$(BinDir).nethackrc.template;$(BinDir)Guidebook.txt;$(BinDir)license;$(BinDir)sysconf.template;$(BinDir)symbols.template;$(BinDir)record;$(BinDir)opthelp"> + + - +