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.
I'll push a formatting guide at some point. There may still be
outstanding changes, but please feel free to resolve those as you arrive
a them.
To the best of my knowledge, there is no changes to the actual code
content, but the formatter does have the occasional bug. If you run into
an issue, please fix it!
Move some internals-related code out of port-specific main so that
it isn't duplicated a bunch of times. One minor side-effect of this
change is that if you auto-pickup something at the very start of a game,
it will happen after any full moon/new moon/Friday 13th message rather
than before. There's a second change for some: the shared main() used
by several of the micro ports had a small difference in game play--if you
saved a game while on an engraving, it would automatically be read when
you resume--that will now occur for everybody [Elbereth weenies rejoice!].
pcmain() was also calling update_inventory() at start of play. That's
unnecessary for new games, where inventory initialization triggers a call
to it for each item added to your pack; but I wasn't sure about restored
games, so everybody gets it there now.
The Mac and BeOS ports evidently haven't been touched it some time;
they still referenced flags.move which got replaced by context.move quite
a while back. The Windows GUI code has a declaration for mswin_moveloop()
which appears to be non-existant, but I left it alone. I assume that the
Qt interface uses the existing main() routines; at least I couldn't find
any start of game code specific to it. vmsmain's revised main() is the
only one which has been tested.
-better handling of "more" prompt for messages that would have scrolled off the window
-support perm_invent
-menu option to add/remove windows captions
Two things:
1. This patch causes the window placement of the main window to be
written to the registry, and to be restored upon the next start
of the program. I had to move the creation of the main window to init_nhwindows,
as the registry is not read until then.
2. Implement support for wc_popup_dialog (or rather, support for not having
popup windows.) It asks getlin questions and get_ext_cmd on the
message window, much like the TTY port does it.
The get_ext_cmd procedure is almost but not quite the same as the
one for TTY, and I think it is better: It autocompletes the extended
command you type, but if you keep on typing it doesn't add those letters
after the completed command, but just keeps track of how many (correct)
characters you typed. If you type a different character than the
autocompleted command has, it shows you what you typed again. If you
press backspace, it deletes the characters you typed, and if autocompletion
is no longer possible, it removes the autocompleted part. The effect
of this is that you can type as many letters as you want when typing
an extended command, as long as it is enough to identify one command;
and you only have to delete the characters you actually typed if you made
a mistake. I think autocompletion is a lot less obtrusive this way.
Some notes about the patch:
- Both mswin_getlin and mswin_get_ext_cmd now have two versions, with
and without a popup.
- yn_question was changed so that it displays a caret, which is a lot
nicer IMHO.
- I had to implement a new NetHack Windows Message parameter,
"MSNH_MSG_CARET", to make it possible to show and hide the caret in
the message window. Normally the caret is created and destroyed by the
window that owns it, but in NetHack the input focus is always on the
main window, while the caret is in the message window, which happens
to be the only one that knows how large the caret should be.
- mswin_putstr_ex's last parameter changed from boolean to int; the
semantics are enhanced so that a negative last parameter means "delete
that many characters from the input line". The string to be deleted is
passed in as well, although it is currently not used.
- A rather large chunk of code finds out where the last string that was
displayed on the message window ended. This is necessary to place the
caret at the right spot. The caret is always positioned there, even if
it is hidden or non-existing.
- mswin_get_nh_event was changed to actually process and empty the
message queue, and called from mswin_putstr_ex to make sure the
message window is updated before the next step is done. Without this,
the caret is positioned before the last message is painted, which
makes its x-position after the last character of the previous line.
part 2 touches only port files
Makes Borland happy with current sources.
Fixes bug in WM_PAINT handling in rip/splash code.
Fixes getline() bug (H0009)
Tidies up source.
Fixes up copyright notices.
Adds TODO docs for Borland. (Removes "TODO" note)
Small changes to defaults formatting.
Fixes ALT key on Graphical Port non NetHack mode.
Hilites pet in Graphical Port text mode.
Also Implements windowcolors for status and message window in graphical port.
On graphical port,
tested to see it actually works.
Tested on platforms Makefile MSC/BCC Graphical/Console, MSC IDE for
compile and run and performing hilite pet in graphical text, not
displaying rawio, alt key.
Here's a patch that checks whether the common control
library is available and up-to-date
[slightly modified from <Someone>'s version to reduce
indentation one level, and to fix wrap-around
in the patch]
win32gui: more splash screen integration
The Makefile have rip.uu/splash.uu added to them. However, this won't
work if you don't have splash.uu. Instead, just copy rip.uu or another
.uu and name it splash.uu. Make expects to have splash.uu present (at
least Borland's make). It doesn't add splash.uu decoding to the IDE
framework. It does a bit in winhack.rc and Makefile.bcc to bring
winhack.rc up to sync with Borland's compiler. If you don't like the
splash screen, then I'll have to redo that part of the patch apart from
the others.
also corrects a cut-and-paste error that I made in options.c
The following options can be set in the game now:
WC_HILITE_PET
WC_ALIGN_MESSAGE
WC_ALIGN_STATUS
WC_SCROLL_MARGIN
WC_MAP_MODE
WC_FONT_MESSAGE
WC_FONT_STATUS
WC_FONT_MENU
WC_FONT_TEXT
WC_FONTSIZ_MESSAGE
WC_FONTSIZ_STATUS
WC_FONTSIZ_MENU
WC_FONTSIZ_TEXT
- added support for new options
- fixed couple of typos in options.c
- added sunken edge around message window
- added capability to replace font in the font table (if we will want to
change font sizes dynamically later)
The following fixes several bugs:
1) Mismatch between docs and game in definition of what '+' resolved in
favor of docs...
2) When game needs to be recovered a message box is shown. This is a very
deprecated fix. It pretty much answers just the conditions that require
this (a yn question to an erroneous winid), and is not useful for other
purposes.
3) The score file is written.
[...]
One of them deals with the patch you just sent, that changes the name but
does so more extensively, particularly, also in the Save dialog in
mhmain.c. Another is one of the changes to winhack.rc to make it compile
under Borland.
This also (beyond patches I sent): fixes no Options prompt bug, and fixes
up the menu bar (which I broke in one of my patches).
Tested on msc/bcc tty/win makefiles and vc ide.
- added counting to the menu window. I changed the way it works in the TTY
port though ("you hear the rumble of distant thunder..." :) The count
applies to the currently selected item instead of being aplied to the item
to be selected (in other words a12 instead of 12a). It works better this
way in the graphical port since there is a notion of current menu item.
I also notes that the count is ignored for PICK_ONE menu - is this by
design?
- somebode mention that text is not scrollable by default - this is fixed.
- fixed player selection dialog to use initXXXX options
-----------------------
B1028 [reported] win32: popup window is too short
The text in the popup window's top line "What do you want to
call the ..." is cut off. Could the window be bigger, so you
can read the entire line?
Fixed.
---------------------
B1027 [reported] win32: select via traditional class char
In a shop (and perhaps elsewhere), I can autoselect a class of
items to drop: a for all types, b for coins, c for weapons, ...,
A for every item, B for blessed items, ... I like the new
possibilities, but I would like to be able to use the old way of
using ! for potions, ) for weapons, etc., as well.
Fixed.
---------------------
B1026 [reported] win32: setting multiple options
I want to set packorder and pickup_types. The first comes up
first, and I type in the order. Then comes the second, without
any hint what is asked of me. A little explanation here would
be appropriate, like "pick up what things automatically?" or
somesuch. When more than one option is set where extra input
is required, some explanation is useful.
Looking into. Apparently something end_menu() call is ignored by nethackw.
---------------------
B1025 [reported] win32: menu navigation
I press O. Now, when I press "a" to turn on "autodig", not only
is the mark set at "a", but there also appears a dotted
rectangle around option "A" (capitalized). Shouldn't this
rectangle also appear at "a"? Pressing "a" repeatedly toggles
the checkmark, but the rectangle switches between "A" and "a".
My CAPS LOCK is not set. The same goes for B, C, D, ... N,
by the way. Pressing "A" works the other way around: the first
press checks "A" and "rectangles" "a", the next unchecks "A"
and rectangles "A" as well.
Fixed.
---------------------
B1024 [reported] win32: no text in final window
After I clicked away the last screen with information
(challenges, I believe it was), I got an empty text screen, as
big as my screen, without any content. It looked like the text
screens that appear on the right, only it was larger and had
only a large OK button over the full width of the window, and
no cancel button. Why this window?
Fixed. The program did not set window text for RIP window.
---------------------
B1010 [known issue] win32: cosmetic
When I get my list of spells, the columns aren't properly
aligned: if the spell name is longer, the rest of the line
shifts right.
Fixed. Fixed-pitch font is used for menu window.
---------------------
B1004 [reported] win32: numeric keyboard Del/.-key
The Del/.-key on my numeric keyboard doesn't make me rest a turn
Fixed. Added rest on Del.
---------------------
B1003 [reported] win32: focus
When the window has the focus, the window bar isn't highlighted.
This is by design. Menu and text widnows are popup and the main
window is disabled when they are up.
because there was an extraneous argv[1] that was
a repeat of the module name, but in quotation
marks. The processing in pcmain stops on the first
argument that doesn't start with '-' so my other
arguments got ignored.
argv[0] 0x00b40800 "C:\test\binary\nethackw.exe"
argv[1] 0x00b40878 ""C:\test\binary\nethackw.exe""
argv[2] 0x00b408f0 "-uwizard"
argv[3] 0x00b40938 "-D"
Fixes:
- menu shortcuts implemented
- most windows close on space (except for menus with
PICK_ANY style)
- "hilite_pet" option is implemented
- map scrolling is improved somewhat (it now scrolls if
the char is within 5 spaces from the edge of the map -
configurable by #define CLIPAROUND_MARGIN)
- added 3 winhack-specific options:
win32_map_mode:[tiles|ascii4x6|ascii6x8|ascii8x8
|ascii16x8|ascii7x12|ascii8x12|ascii15x12
|ascii12x16|ascii10x18|fit_to_screen]=20
win32_align_status:[left|top|right|bottom]
win32_align_message:[left|top|right|bottom]
Note: aligning status window to left or right edge of the screen does
not look good.