From 6f210425b1d448b07c4fd9ed4cbcd8c833122145 Mon Sep 17 00:00:00 2001 From: "nethack.allison" Date: Sun, 10 Mar 2002 22:30:47 +0000 Subject: [PATCH] Add win32 port help support. --- include/ntconf.h | 2 ++ sys/winnt/Makefile.bcc | 6 +++- sys/winnt/Makefile.gcc | 12 +++++-- sys/winnt/Makefile.msc | 6 +++- sys/winnt/porthelp | 77 +++++++++++++++++++++--------------------- win/win32/dlb_main.dsp | 4 +++ win/win32/resource.h | 29 ++++++++-------- win/win32/winhack.rc | 1 + 8 files changed, 80 insertions(+), 57 deletions(-) diff --git a/include/ntconf.h b/include/ntconf.h index 532a003e0..4d848714d 100644 --- a/include/ntconf.h +++ b/include/ntconf.h @@ -43,6 +43,8 @@ #endif #define OPTIONS_FILE OPTIONS_USED +#define PORT_HELP "porthelp" + /* The following is needed for prototypes of certain functions */ #if defined(_MSC_VER) #include /* Provides prototypes of exit(), spawn() */ diff --git a/sys/winnt/Makefile.bcc b/sys/winnt/Makefile.bcc index 81223bc5d..50ea35fea 100644 --- a/sys/winnt/Makefile.bcc +++ b/sys/winnt/Makefile.bcc @@ -863,9 +863,12 @@ $(O)dlb.o: $(O)dlb_main.o $(O)alloc.o $(O)panic.o $(INCL)\dlb.h $(O)dlb_main.o: $(UTIL)\dlb_main.c $(INCL)\config.h $(INCL)\dlb.h @$(cc) $(CFLAGS) -o$@ $(UTIL)\dlb_main.c +$(DAT)\porthelp: $(NTSYS)\porthelp + @copy $(NTSYS)\porthelp $@ >nul + nhdat: $(U)dlb_main.exe $(DAT)\data $(DAT)\oracles $(OPTIONS_FILE) \ $(DAT)\quest.dat $(DAT)\rumors $(DAT)\help $(DAT)\hh $(DAT)\cmdhelp \ - $(DAT)\history $(DAT)\opthelp $(DAT)\wizhelp $(DAT)\dungeon \ + $(DAT)\history $(DAT)\opthelp $(DAT)\wizhelp $(DAT)\dungeon $(DAT)\porthelp \ $(DAT)\license $(O)sp_lev.tag cd $(DAT) echo data >dlb.lst @@ -873,6 +876,7 @@ nhdat: $(U)dlb_main.exe $(DAT)\data $(DAT)\oracles $(OPTIONS_FILE) \ if exist options echo options >>dlb.lst if exist ttyoptions echo ttyoptions >>dlb.lst if exist guioptions echo guioptions >>dlb.lst + if exist porthelp echo porthelp >>dlb.lst echo quest.dat >>dlb.lst echo rumors >>dlb.lst echo help >>dlb.lst diff --git a/sys/winnt/Makefile.gcc b/sys/winnt/Makefile.gcc index d6b1c68be..df075fb2a 100644 --- a/sys/winnt/Makefile.gcc +++ b/sys/winnt/Makefile.gcc @@ -405,10 +405,11 @@ VVOBJ = $(O)version.o ALLOBJ = $(WINPOBJ) $(SOBJ) $(DLBOBJ) $(TTYOBJ) $(WOBJ) $(OBJS) $(VVOBJ) ifeq "$(GRAPHICAL)" "Y" -OPTIONS_FILE = $(DAT)\guioptions +OPTIONS_FILE = $(DAT)/guioptions else -OPTIONS_FILE = $(DAT)\ttyoptions +OPTIONS_FILE = $(DAT)/ttyoptions endif + #========================================== # Header file macros #========================================== @@ -452,6 +453,7 @@ DATABASE = $(DAT)/data.base GAMEFILE = $(GAMEDIR)/$(GAME).exe + #========================================== #=============== TARGETS ================== #========================================== @@ -833,9 +835,12 @@ $(O)dlb.o: $(O)dlb_main.o $(O)alloc.o $(O)panic.o $(INCL)/dlb.h $(O)dlb_main.o: $(UTIL)/dlb_main.c $(INCL)/config.h $(INCL)/dlb.h @$(cc) $(CFLAGS) -o$@ $(UTIL)/dlb_main.c +$(DAT)/porthelp: $(NTSYS)/porthelp + $(subst /,\,@copy $(NTSYS)/porthelp $@ >nul) + nhdat: $(U)dlb_main.exe $(DAT)/data $(DAT)/oracles $(OPTIONS_FILE) \ $(DAT)/quest.dat $(DAT)/rumors $(DAT)/help $(DAT)/hh $(DAT)/cmdhelp \ - $(DAT)/history $(DAT)/opthelp $(DAT)/wizhelp $(DAT)/dungeon \ + $(DAT)/history $(DAT)/opthelp $(DAT)/wizhelp $(DAT)/dungeon $(DAT)/porthelp \ $(DAT)/license $(O)sp_lev.tag $(subst /,\,cd $(DAT)) & \ echo data >dlb.lst & \ @@ -843,6 +848,7 @@ nhdat: $(U)dlb_main.exe $(DAT)/data $(DAT)/oracles $(OPTIONS_FILE) \ (if exist options echo options >>dlb.lst) & \ (if exist ttyoptions echo ttyoptions >>dlb.lst) & \ (if exist guioptions echo guioptions >>dlb.lst) & \ + (if exist porthelp echo porthelp >>dlb.lst) & \ echo quest.dat >>dlb.lst & \ echo rumors >>dlb.lst & \ echo help >>dlb.lst & \ diff --git a/sys/winnt/Makefile.msc b/sys/winnt/Makefile.msc index 821848c79..1d20fb4af 100644 --- a/sys/winnt/Makefile.msc +++ b/sys/winnt/Makefile.msc @@ -850,9 +850,12 @@ $(O)dlb.o: $(O)dlb_main.o $(O)alloc.o $(O)panic.o $(INCL)\dlb.h $(O)dlb_main.o: $(UTIL)\dlb_main.c $(INCL)\config.h $(INCL)\dlb.h @$(CC) $(CFLAGS) /Fo$@ $(UTIL)\dlb_main.c +$(DAT)\porthelp: $(NTSYS)\porthelp + @copy $(NTSYS)\porthelp $@ >nul + nhdat: $(U)dlb_main.exe $(DAT)\data $(DAT)\oracles $(OPTIONS_FILE) \ $(DAT)\quest.dat $(DAT)\rumors $(DAT)\help $(DAT)\hh $(DAT)\cmdhelp \ - $(DAT)\history $(DAT)\opthelp $(DAT)\wizhelp $(DAT)\dungeon \ + $(DAT)\history $(DAT)\opthelp $(DAT)\wizhelp $(DAT)\dungeon $(DAT)\porthelp \ $(DAT)\license $(O)sp_lev.tag cd $(DAT) echo data >dlb.lst @@ -860,6 +863,7 @@ nhdat: $(U)dlb_main.exe $(DAT)\data $(DAT)\oracles $(OPTIONS_FILE) \ if exist options echo options >>dlb.lst if exist ttyoptions echo ttyoptions >>dlb.lst if exist guioptions echo guioptions >>dlb.lst + if exist porthelp echo porthelp >>dlb.lst echo quest.dat >>dlb.lst echo rumors >>dlb.lst echo help >>dlb.lst diff --git a/sys/winnt/porthelp b/sys/winnt/porthelp index 332753f71..cc3ee9765 100644 --- a/sys/winnt/porthelp +++ b/sys/winnt/porthelp @@ -27,13 +27,45 @@ Some options are applicable only to the graphical port. These are discussed separately in their own section. Contents -1. Boolean options -2. Graphical Port Complex options -3. Graphical Port Additional/Enhanced Commands -4. Available ALT Key Combinations +1. Available ALT Key Combinations +2. Boolean options +3. Graphical Port Complex options +4. Graphical Port Additional/Enhanced Commands 5. Graphical Port Menus -1. Boolean Options +1. Available ALT Key Combinations +--------------------------------- +While playing NetHack under Windows you can press the ALT key in +combination with another key to execute an extended command as an +alternative method to pressing a # key sequence. (The non-graphical +(tty) version is always running in NetHack mode, but +"NetHack for Windows - Graphical Interface" can be toggled): + + Alt-2 #twoweapon - toggle two-weapon combat (unavailable + if number_pad mode is set) + Alt-a #adjust - adjust inventory letters. + Alt-c #chat - talk to someone or something. + Alt-d #dip - dip an object into something. + Alt-e #enhance - enhance your skill with a weapon. + Alt-f #force - force a lock. [works in NetHack mode only] + Alt-i #invoke - invoke an object's powers. + Alt-j #jump - jump to a location. + Alt-l #loot - loot a box on the floor. + Alt-m #monster - use a monster's special ability. + [works in NetHack mode only] + Alt-n #name - name an item or type of object. + Alt-o #offer - offer a sacrifice to the gods. + Alt-p #pray - pray to the gods for help. + Alt-q #quit - quit the game. (Same as #quit) + Alt-r #rub - rub a lamp. + Alt-s #sit - sit down. [works in NetHack mode only] + Alt-t #turn - turn undead. + Alt-u #untrap - untrap something. + Alt-v #version - list compile time options for this version of + NetHack. + Alt-w #wipe - wipe off your face. + +2. Boolean Options ------------------ Listed here are any options not discussed in the main help, options @@ -54,7 +86,7 @@ which may need a slightly more explanatory note: Default: [FALSE] -2. Graphical Port Complex Options +3. Graphical Port Complex Options --------------------------------- "NetHack for Windows - Graphical Interface" recognizes the following @@ -145,7 +177,7 @@ Miscellaneous options: vary_msgcount Number of lines to display in message window. -3. Graphical Port Additional/Enhanced Commands +4. Graphical Port Additional/Enhanced Commands ---------------------------------------------- The following function keys are active in @@ -168,37 +200,6 @@ the "NetHack for Windows - Graphical Interface": to select between the menus: File, Map, Window Settings, and Help. -4. Available ALT Key Combinations ---------------------------------- - -While playing NetHack under Windows you can press the ALT key in -combination with another key to execute an extended command as an -alternative method to pressing a # key sequence. (The non-graphical -(tty) version is always running in NetHack mode, but -"NetHack for Windows - Graphical Interface" can be toggled): - - Alt-a adjust - adjust inventory letters. - Alt-c chat - talk to someone or something. - Alt-d dip - dip an object into something. - Alt-e enhance - enhance your skill with a weapon. - Alt-f force - force a lock. [works in NetHack mode only] - Alt-i invoke - invoke an object's powers. - Alt-j jump - jump to a location. - Alt-l loot - loot a box on the floor. - Alt-m monster - use a monster's special ability. - [works in NetHack mode only] - Alt-n name - name an item or type of object. - Alt-o offer - offer a sacrifice to the gods. - Alt-p pray - pray to the gods for help. - Alt-q quit - quit the game. (Same as #quit) - Alt-r rub - rub a lamp. - Alt-s sit - sit down. [works in NetHack mode only] - Alt-t turn - turn undead. - Alt-u untrap - untrap something. - Alt-v version - list compile time options for this version of - NetHack. - Alt-w wipe - wipe off your face. - 5. Graphical Port Menus ----------------------- diff --git a/win/win32/dlb_main.dsp b/win/win32/dlb_main.dsp index f9d62002f..ea93a5141 100644 --- a/win/win32/dlb_main.dsp +++ b/win/win32/dlb_main.dsp @@ -63,6 +63,8 @@ chdir \ if exist options echo options >>dlb.lst \ if exist ttyoptions echo ttyoptions >>dlb.lst \ if exist guioptions echo guioptions >>dlb.lst \ + if NOT exist porthelp copy ..\sys\winnt\porthelp porthelp \ + if exist porthelp echo porthelp >>dlb.lst \ echo quest.dat >>dlb.lst \ echo rumors >>dlb.lst \ echo help >>dlb.lst \ @@ -115,6 +117,8 @@ chdir \ if exist options echo options >>dlb.lst \ if exist ttyoptions echo ttyoptions >>dlb.lst \ if exist guioptions echo guioptions >>dlb.lst \ + if NOT exist porthelp copy ..\sys\winnt\porthelp porthelp \ + if exist porthelp echo porthelp >>dlb.lst \ echo quest.dat >>dlb.lst \ echo rumors >>dlb.lst \ echo help >>dlb.lst \ diff --git a/win/win32/resource.h b/win/win32/resource.h index 43e672b30..7fa83bf6f 100644 --- a/win/win32/resource.h +++ b/win/win32/resource.h @@ -121,19 +121,20 @@ #define IDM_HELP_OPTIONS_LONG 32778 #define IDM_HELP_EXTCMD 32779 #define IDM_HELP_LICENSE 32780 -#define IDM_MAP_TILES 32781 -#define IDM_MAP_ASCII4X6 32782 -#define IDM_MAP_ASCII6X8 32783 -#define IDM_MAP_ASCII8X8 32784 -#define IDM_MAP_ASCII16X8 32785 -#define IDM_MAP_ASCII7X12 32786 -#define IDM_MAP_ASCII8X12 32787 -#define IDM_MAP_ASCII16X12 32788 -#define IDM_MAP_ASCII12X16 32789 -#define IDM_MAP_ASCII10X18 32790 -#define IDM_MAP_FIT_TO_SCREEN 32791 -#define IDM_NHMODE 32793 -#define IDM_CLEARSETTINGS 32794 +#define IDM_HELP_PORTHELP 32781 +#define IDM_MAP_TILES 32782 +#define IDM_MAP_ASCII4X6 32783 +#define IDM_MAP_ASCII6X8 32784 +#define IDM_MAP_ASCII8X8 32785 +#define IDM_MAP_ASCII16X8 32786 +#define IDM_MAP_ASCII7X12 32787 +#define IDM_MAP_ASCII8X12 32788 +#define IDM_MAP_ASCII16X12 32789 +#define IDM_MAP_ASCII12X16 32790 +#define IDM_MAP_ASCII10X18 32791 +#define IDM_MAP_FIT_TO_SCREEN 32792 +#define IDM_NHMODE 32794 +#define IDM_CLEARSETTINGS 32795 #define IDC_STATIC -1 // Next default values for new objects @@ -141,7 +142,7 @@ #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 145 -#define _APS_NEXT_COMMAND_VALUE 32795 +#define _APS_NEXT_COMMAND_VALUE 32796 #define _APS_NEXT_CONTROL_VALUE 1331 #define _APS_NEXT_SYMED_VALUE 110 #endif diff --git a/win/win32/winhack.rc b/win/win32/winhack.rc index 6d90a745c..7af76637d 100644 --- a/win/win32/winhack.rc +++ b/win/win32/winhack.rc @@ -82,6 +82,7 @@ BEGIN MENUITEM "&Longer list of game options", IDM_HELP_OPTIONS_LONG MENUITEM "List of e&xtended commands", IDM_HELP_EXTCMD MENUITEM "The &NetHack license", IDM_HELP_LICENSE + MENUITEM "NetHack for &Windows help", IDM_HELP_PORTHELP END END