Commit Graph

167 Commits

Author SHA1 Message Date
nethack.allison
1bdf37ec00 SAFERHANGUP win32gui (from <Someone>) 2003-09-30 03:42:01 +00:00
cohrs
559be58c21 conflicting delayed killers
Introduce a new set of functions to manage delayed killers in the trunk, used
in addressing the various reports of delayed killer confusion.  Since existing
delayed killers are related to player properties, the delayed killers are
keyed by uprop indexes.  I did this to avoid adding yet another set of
similar identifiers.
- the new delayed_killer() is used for stoning, sliming, sickness, and
delayed self-genocide while polymorphed.  Some other timed events don't
use it (and didn't use the old delayed_killer variable) because they
use a fixed message when the timeout occurs.
- A new data structure, struct kinfo, is used to track both delayed and
immediate killers.  This encapsulates all the info involved with
identifying a killer.  The structure contains a buffer, which subsumes the
old killer_buf and several other buffers that didn't/couldn't use killer_buf.
- the killer list is saved and restored as part of the game state.
- the special case of usick_cause was removed and a delayed killer list
entry is now used in its place
- common code dealing with (un)sliming is moved to a new make_slimed function
- attempted to update all make dependencies for new end.c -> lev.h
dependency, sorry if I messed any up
2003-09-29 19:24:20 +00:00
nethack.allison
64e75e05e4 win32gui (from <Someone>)
trunk and branch:
Do not limit role selection list by race/gender/alignment. The default.nh
selection will still be honored but the list itself will include every
possible role.

Some interface tweaks for main trunk:
- improved calculation of the size of the menu window
- made auto-arrange windows on/off option (it was reset automatically
  which was unintuitive and in some cases annoying, IMO)
2003-09-27 12:30:28 +00:00
nethack.allison
c12d797531 trunk only: preserving context (remaining files)
Pat Rankin wrote:
> collect them all into some new struct and
> save that separately rather than jamming more non-option stuff
> into struct flags.

This patch:
- collects all context/tracking related fields from flags
  into a new structure called "context."
It also adds the following to the new structure:
- stethoscope turn support
- victual support
- tin support
2003-09-21 11:57:26 +00:00
nethack.allison
416412f92b Remove vestiges of old overlay source split
[trunk only]
2003-09-05 02:45:18 +00:00
nethack.allison
e382e3b055 U613 specifying alignment in win32 and CE (from Yitzhak)
> The bug involved using the initalign (and related) indexes into
> the array of alignments as indexes into the respective combo box,
> and these are (apparently) not equivalent. To fix, the combo box
> is queried one by one for the item with the index that produces
> that proper alignment value, and then uses that index found. I
> did not find an API that does this in one step, but this only
> happens once, at dialog initialization.
2003-09-03 03:57:32 +00:00
nethack.allison
ee8ae0ed8b version info (from Yitzhak)
Changes are: Complete copyright notice, Versions using dot format instead of comma format, and nulls at the end of strings (required, at least for Windows 2000).
2003-08-28 05:46:50 +00:00
nethack.allison
1fd577124b win32 bits for main trunk (from <Someone>)
- set correct checkmark on "Lock Windows" menu item on startup
- redraw message window on resizing (it does not update properly otherwise)
- fixed copy/paste error in read registry settings function
2003-08-20 11:39:57 +00:00
nethack.allison
31a2c8cefa #U567: lootiing counts (from <Someone>) 2003-07-31 11:11:17 +00:00
nethack.allison
a4a5e8d8dd win32gui buffer overrun (from <Someone>)
splash screen off by one error overwrote one byte outside the
mallocked block
2003-07-31 11:04:17 +00:00
nethack.allison
ee430c5b3e win32gui: # to specifiy numeric count during loot
<email deleted> wrote:
> Windows NetHack graphical Version 3.4.1
> comments: I have been unable to remove or put in partial groups
> of items into a bag of holding or scak. With hethack 3.3.X I
> could put 2 of 3 potions or 3000 of 8000 pieces of gold into the
> bag. The menu persents you with the following options (yn#aq)(n).
> Using # exits the menu and typing in the number you wish to use
> does nothing. The work around is to drop the number you wish to
> not store and put all the remaining into the bag then pick up the
> remaining.
2003-07-30 01:17:12 +00:00
nethack.allison
99bcdf6a4e expand wincap options to second field
<Someone> wishes to add a couple of new options to the wince port ("run fullscreen" and "do not use CE software keyboard").

The wincap field was full, so this adds a second field for
additional options.
2003-07-17 01:35:31 +00:00
nethack.allison
a67ed775cb number_pad (modified from <Someone>'s patch)
The number_pad option can now optionally hold a value
{0,1, 2 } for {off, on, DOS-mode} but plain number_pad and
!number_pad in config files still work as before.

When number_pad:2 is set, iflags.num_pad_mode is set to 1
which triggers the following behaviour:
> '5', M('5') and M('0') are mapped in rhack()
>in cmd.c, only when they are entered as a command. When used as a
>number, like in the 'n' command, no mapping takes place. '0' is
>already mapped to 'i' by the core. The
>only difference [<Someone>] left in (deliberately) is when you press Ctrl-0;
>this used to map to C('i'), which is an invalid command; now
>keep it '0' (which is interpreted as 'i' by the core.)
2003-06-06 03:49:56 +00:00
nethack.allison
3a31710a6c win32gui (from <Someone>)
[main trunk only]
Fixes incorrect registry entries for inventory window position.
2003-06-06 01:56:34 +00:00
nethack.allison
a091428423 win32 (from Yitzhak)
>The attached is a patch for the makefiles and .rc that makes
>Borland compile. Files modified: sys/winnt/Makefile.bcc - changes
>Makefile so dependencies on dlls are removed for console, adds
>gamedir.tag sys/winnt/Makefile.msc - changes the Makefile a bit to
>make it dependent on gamedir.tag in both gui and console, and make
>the dlls a dependency only in console but without the !IF for
>$(GAMEFILE). The .rc format is made workable for both Borland and
>MSC. win/win32/winhack.rc - makes FONT format Borland compatible
2003-06-03 10:09:07 +00:00
nethack.allison
253a9d388b win32gui: prevent male valkyrie (from <Someone>)
>Steps to reproduce problem:
>1) make sure you don't have race, role, gender specified in your
>   defaults.h, then add
>   OPTIONS=role:Valkyrie,race:Human,gender:male,align:lawful
>2) start a new nethackw.exe game
>3) Uncheck "Random" from gender box, now you can select from male
>   or female, not only female.
>4) Select male and click OK.
>5) When game begins press shift+O (Options) and look to gender.
>   Your valkyrie is male.

defaults.nh values were not used the dialog initialization. That's
why both male/female options were available for Valkyries. This is
now fixed.

Also added: checking for consistency of the initial settings and
resetting all incompatible values to ROLE_NONE.
2003-05-26 09:58:15 +00:00
nethack.allison
debd89444c (from <Someone>)
What's in it:
some MessageBox tidbits:
- Let all MessageBoxes display an icon
- Introduced NHMessageBox to have messageboxes display a consistent title
- Change icon in mswin_display_file from MB_ICONERROR to MB_ICONEXCLAMATION
  for non-fatal error
And to solve #U355: NetHackW won't run on Win2K OS:
- Avoid a crash when closing the main window while the splash screen is
  displayed.
- Make sure NetHack starts normal when closed minimized
- Center the splash screen on the screen, not on the parent window
  (which may be off-screen)

What's new in it:
- Show copyright banner in textbox in splash screen instead of over the picture
- Show news in splash screen only if iflags.news (solves W341-6)
- show complete version information in splash screen when it is used as about box)

[Also reverse the numkey patch in main trunk]
2003-03-27 00:23:24 +00:00
nethack.allison
39befe07fd To summarise:
- My "various Windows refinements" patch from yesterday went into 3.4.x correctly
- My "NumberPad" patch went into 3.4.x, but should be backed out
- My "various Windows refinements" patch from last week was for 3.5.0, but is incomplete; you can safely ignore that.
- I'll make a new "various Windows refinements" patch for 3.5.0 tonight.
2003-03-26 00:02:09 +00:00
nethack.allison
adfaae0677 numkey (from <Someone>)
mapping the 5 and 0 to '5' and '0' respectively
when NumLock is off, to make entering numbers easier. The core will map '5' and
'0' to 'g' and 'i' respectively. This solves W341-5.

Note: I changed nhdefkey.c and mhmain.c, so both the tty and the windows
interface will show new behaviour. I deliberately did not change nh340key.dll.

Note: Maybe the same change should be made to the MSDOS port.

Note: The behaviour of getobj is a little bit strange: It doesn't use
yn_question's  facility for returning a number, but handles that itself. The
net effect of this is that if you type d55$ (to drop 55 zorkmids,) only the
first '5' is shown
2003-03-23 19:20:22 +00:00
nethack.allison
34272b3249 More (from <Someone>) 2003-03-23 19:16:54 +00:00
nethack.allison
5311cce717 From Yitzhak
(2 troublesome bands removed
and will follow later)
Here's the new patch with the Windows improvements; this should apply to the
3.4.2 tree. Note the changed filename in the diff lines.
What's in it:
> some MessageBox tidbits:
> - Let all MessageBoxes display an icon
> - Introduced NHMessageBox to have messageboxes display a consistent title
> - Change icon in mswin_display_file from MB_ICONERROR to MB_ICONEXCLAMATION
> for non-fatal error
>
> And to solve #U355: NetHackW won't run on Win2K OS:
> - Avoid a crash when closing the main window while the splash screen is
> displayed.
> - Make sure NetHack starts normal when closed minimized
> - Center the splash screen on the screen, not on the parent window (which may
> be off-screen)
What's new in it:
- Show copyright banner in textbox in splash screen instead of over the picture
- Show news in splash screen only if iflags.news (solves W341-6)
- show complete version information in splash screen when it is used as about
box
2003-03-23 19:03:08 +00:00
nethack.allison
27977b7c15 win32 stuff held until after bugfix release (from <Someone>)
-better handling of "more" prompt for messages that would have      scrolled off the window
-support perm_invent
-menu option to add/remove windows captions
2003-03-03 23:31:36 +00:00
cohrs
ee99c8e848 even more missing newlines 2003-02-23 16:49:18 +00:00
nethack.allison
7d0a10f3fd more win32 more (from <Someone>)
<Someone> and <Someone> both agreed that this was:
- useful
- unlikely to break anything.
2003-02-21 01:55:26 +00:00
nethack.allison
2875a46833 Roll back the last-minute patch after <Someone> found problems with it 2003-02-20 10:51:40 +00:00
nethack.allison
ed1fddc0b1 win32 "more" handling (from <Someone>)
> There is a slight problem with "--more--" prompt being handled in
> WM_PAINT. WM_PAINT can be sent while you're inside
> mswin_nhgetch(). This causes some weirdness if window is resized
> while waiting for --more-- prompt.
2003-02-20 03:42:46 +00:00
nethack.allison
fc2acbb130 win32 and msdos recover
Since the ports have SELF_RECOVER defined,
remove the build of recover.exe from the default steps.
You must explicitly use 'make recover' now.
2003-02-18 00:21:19 +00:00
nethack.allison
a1a296aa8d win32 bits 2003-02-15 22:46:10 +00:00
nethack.allison
676df2da62 more beta
BETA_INFO was being used in win32 code but
it is only defined in version.c
2002-12-26 17:14:34 +00:00
nethack.allison
335aeb4c9e win32 port update (from <Someone>)
Implemented doprev_message in windows port: scroll message
window up one line.
2002-12-23 12:59:06 +00:00
nethack.allison
70b4129ef3 Borland updates (from Yitzhak) 2002-12-23 12:51:57 +00:00
nethack.allison
46f4a4e5c5 win32 IDE fix
A recent change described as:
"changed the IDE files to build NetHackW.exe instead of
nethackw.exe. This is only cosmetic, but consistent with the
other executable."

was not just cosmetic. The changes prevented the
executable from being copied to the target binary
directory at all, due to the removal of the necessary
trailing tab.
2002-12-11 03:52:06 +00:00
nethack.allison
bea789ea2d win32 updates (from <Someone>)
- restructured Install.nt quite a bit. It now contains instructions
to build a graphical nethack using NMAKE, too. I merged
the instructions for command line builds, and separated the IDE
build; that made more sense to me. It is shorter, too.
- added some lines to all Makefiles so they now build
NetHackW.exe when GRAPHICAL is "Y", and NetHack.exe
otherwise. I espacially did not test this on Borland.
Previously, the makefiles would always build NetHack.exe.
- changed the IDE files to build NetHackW.exe instead of
nethackw.exe. This is only cosmetic, but consistent with the
other executable.
- made a small change to pcmain.c, as the MinGW linker
cannot decide between main() and WinMain() when both are
present, as explained in <Someone>'s original
message. (I used a #ifndef instead of comments ;-)
The MinGW graphical build indeed seems to work.
2002-12-09 03:12:47 +00:00
nethack.allison
fded4ca778 B08003 (from <Someone>) 2002-11-04 03:26:59 +00:00
nethack.allison
04f845f87b splash screen patches (from <Someone>)
- Show splash on "Help - About" with all version information
- Show splash with news on startup (if show_splash is on of course).
I made another small patch to the splash screen. Because the greenish background colour always seemed a little odd to me, I decided
to make it transparent. Doing that, I found the following:
- The splash picture was a 24-bit bitmap, although it had less than 256 colours. That makes the size of the final executable about
200K larger than necessary. I changed it to a 256-colour bitmap. I also changed the background colour to the default tile background
colour, for consistency. The new bitmap is attached here. My excuses if the large file means a problem to anyone.
- In Microsoft's documentation (see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/bitmaps_2y9g.asp) is is
stated that on Windows 95/98 "TransparentBlt contains a memory leak that can exhaust system resources." It is recommended to use
different code to draw transparent bitmaps, to be precise: the alternative code that is already in nhapply_image_transparent(). I'm
almost convinced that this is the cause for Betabug B08008 reported bij <Someone>. Can anyone confirm he is using 95/98? I decided
for the easy way out and removed the code that uses TransparentBlt completely. I see not much reason to use it if it is a) buggy and
b) we have an alternative that works perfectly. This is attached as trans.patch.
- The rest of the patch only changes the BitBlt() in mhsplash.c to a nhapply_image_transparent().
2002-11-03 15:26:41 +00:00
nethack.allison
2b31ea2c96 NH 3.4.0 fonts on Win2K / Japanese (from <Someone>)
Here is one more patch (see attachment). It does TranslateCharsetInfo
to map codepage to a character set. I am not sure if it will help though.
Japanese Windows is using codepage 932 and I don't think IBMgraphics
will work too well in this codepage.
AFAIK, there is no way in win32 to force arbitrary codepage for a font
(CP 437  in case of Nethack). That means IBMgraphics is unlikely to work
if the system locale is set to something other than US or Western Europe
(CP 437 & 850).

-<Someone>
2002-11-03 15:16:22 +00:00
nethack.allison
b9a3376fc5 stray files (from <Someone>)
winhack.h is not being used anywhere now and can safely be deleted.
There 2 instances of this file:

sys\wince\winhack.h
win\win32\winhack.h

The patch is also attached that adjusts for this.
2002-09-19 00:16:10 +00:00
nethack.allison
ffb22245a9 (from <Someone>) 2002-09-17 03:32:07 +00:00
nethack.allison
6bebdbb135 win32 USER_SOUNDS
This uses pmatch() as a default pattern matcher,
and #defines USER_SOUNDS_REGEX for Qt
to enable the code for regular expressions.

This is enabled for win32tty and win32gui.
2002-09-02 23:28:54 +00:00
nethack.allison
71eb636e14 win32 (from <Someone>)
This patch is an improvement for menu/text dialogs.
This is a code carried over from Windows CE port. It changes
text and menu windows from "system popup" to plain "child"
windows of the main nethack window. Nethack main window can
now be resized/moved/minimized when menu/text window is up.
Menu/text windows will always stay inside the main window and
move along with it.

<Someone>
2002-08-28 04:53:50 +00:00
nethack.allison
ea31aa03dc (from <Someone>)
> Questions are being appended in the message window, some showing
> up on the same line. This is really noticeable with the
> end-of-game disclosure questions. Questions should always be
> presented on a new line.

At end of game is probably the only place, since then more than one
question is asked in the same turn. Anyhow, here's the patch, in
mswproc.c  [...]

- No checkboxes in menu if menu is PICK_NONE. mhmenu.c

- About box changed to splash screen. This last thing is open
for discussion, as the splash screen currently does not give
exactly the ame information as the about box (or the v command).
Maybe the splash should be enhanced? Anyway, it looks better than
the About-box. I didn't remove the About-box code and resource yet
until this discussion is had. mhmain.c

<Someone>
2002-08-25 12:29:35 +00:00
nethack.allison
706f95ca7d misc bits: options, also win32 follow-up from <Someone>
(from <Someone>):
I guess that this:
      mcam += iflags.wc_scroll_amount;
should be his:
      mcam += iflags.wc_scroll_amount - 1;
In words: If scroll amount is 1, the behaviour should be as it was
before the option existed, which means: no addition to mcam.
2002-08-24 15:33:00 +00:00
nethack.allison
2ce6152d63 B08021 scroll_amount wincap option
> - I'd like to see another option added: scroll_amount. In
>   combination with scroll_margin, this would control the amount
>   of squares the screen is scrolled when the scroll_margin is
>   reached (currently, this amount is 1, but if I recall
>   correctly, it used to be more). For example, if both were 5,
>   when you came within 5 spaces of the left screen border, the
>   screen would shift 5 spaces to the right).
2002-08-23 01:03:59 +00:00
nethack.allison
b3417655da B08002 - win32gui: message window sizing (from <Someone>)
>>>  - When I set font and font size of the message window, the
>>>  message window size doesn't calculate correctly to show the
>>>  number of message lines specified. For example, I set the font
>>>  size to 6, and the number of messages to display to 8. Now
>>>  there is whitespace at the top of my message window. When I
>>>  set the font size to 14 now, I see only 5.5 message lines.
>>>  This is unintuitive: the interface should recalculate the
>>>  window size needed to display the correct number of lines.
>>>
>>  I agree, especially since the message window size is
>>  recalculated correctly if you save and restore. An easy way out
>>  would be to set those options to DISP_IN_GAME.
>
>  That seems like a good work-around until the proper fix is done.

The patch is attached. I moved the code that was computing the font
size to mswin_message_window_size(). This will cause the message
window to resize properly if the message font size changes. There
are also 2 minor bits in mswproc.c to invalidate the message window
when the font changes.
2002-08-21 23:14:27 +00:00
nethack.allison
411195c75f suggestions from <Someone> 2002-08-21 11:02:56 +00:00
nethack.allison
c5c963e5ca (from <Someone>)
> - When I pick up something, the count is displayed to the right.
>   I'd like this count to stay visible when I switch to another
>   item in the list.
2002-08-20 00:04:34 +00:00
nethack.allison
289c2635bb win32gui: hide perm_invent option from the options menu in the game 2002-08-18 01:53:05 +00:00
nethack.allison
0c31ade8df fix reported beta-tester problem of not being able
to select capital letter at some prompts.
2002-08-18 00:16:43 +00:00
nethack.allison
3ea4cad695 (from <Someone>)
there is a maximum of 200 characters for a message line
now. That should be TBUFSZ.
2002-08-13 00:38:03 +00:00
nethack.allison
0fef89bfe3 win32 message window (from <Someone>)
three new features for the message window we discussed:
- Graying out lines that are old -- slightly cleaner than <Someone>'s version.
- Message concatenation.
- --More-- prompt if there are more messages this turn than fit in the
  window.
As a by-product of these changes, some other things have changed, too:
- The message lines array is now used in a round-robin way, i.e. the
  messages are no longer copied one line up when adding a new message.
- clear_nhwindow no longer redraws the window, which significantly
  reduces screen flicker.
- A caret bug was fixed.
- The last line is no longer highlighted, as this seems unnecessary
  since the most recent messages are in a different colour
- A bug was fixed that caused two lines too many to be drawn on each
  paint.
2002-08-12 11:19:04 +00:00