PatR [Tue, 24 Nov 2020 01:45:44 +0000 (17:45 -0800)]
Qt status: highlights when toggling 'showexp'
During status update at the time the 'showexp' option gets toggled
on or off, prevent comparing Xp (level) against Exp (points) when
deciding whether the value has gone up or down. Xp/Exp (when
toggling on) or just Xp (when toggling off) will be highligthed in
blue (changed, neither better nor worse) rather than green or red.
PatR [Tue, 24 Nov 2020 01:39:00 +0000 (17:39 -0800)]
Qt font selection dropdown menu
In "Qt settings" (or "Preferences" for OSX), the current font size
would show "Medium" if that was the current setting. So far, so
good. However, if you clicked on the up/down arrows to get the
dropdown menu, it was truncated to "Mediu" there regardless of
current setting. Force the menu to be wide enough to show "Medium".
PatR [Mon, 23 Nov 2020 09:29:53 +0000 (01:29 -0800)]
Qt status again: unhighlight disabled fields
If 'showscore' has been On and gets toggled Off while Score is
highlighted, remove that highlight immediately instead of letting
it stick around a few turns until it times out.
PatR [Sun, 22 Nov 2020 10:36:10 +0000 (02:36 -0800)]
Qt paperdoll bit
For the tool tips shown if you let the mouse pointer hover over
any of the cells in the paperdoll (inventory subset showing
worn and wielded items), remove the trailing period and add a
leading space and a trailing space. Improves readability.
PatR [Sun, 22 Nov 2020 09:10:52 +0000 (01:10 -0800)]
Qt status bit
When Qt highlights a field that has gotten better, use the same
shade of green as is used for the green range of hitpoint bar.
The old value was too dull, like olive green seen in shadow.
Not trivial enough to avoid getting the details wrong. An old
commit log message (58137a608acf418700dd527bc69b2ad5a198495d,
June of 2006) claimed that this was fixed for bag of tricks but
that was for monsters in general; mimics could still be wrong.
PatR [Sun, 22 Nov 2020 02:21:16 +0000 (18:21 -0800)]
tty: selecting gold in menus
Requested by a beta tester nearly four years ago: '$' is both an
inventory "letter" and a group accelator. The letter only works
if gold is on the current menu page and was taking precedence
over the group accelator. Allow '$' to toggle selection of gold
regardless of the page.
curses already behaves this way. X11 and Qt menus aren't
paginated so also pick gold even if the '$' entry in the menu
isn't visible at the time. No idea about Windows GUI...
PatR [Sun, 22 Nov 2020 01:37:01 +0000 (17:37 -0800)]
'showscore' vs containers
When SCORE_ON_BOTL is enabled, you could tell how much gold is
inside a container with unknown contents by having 'showsore' On
and watching how much the score changed on the status line when
picking the container up.
PatR [Sat, 21 Nov 2020 11:46:53 +0000 (03:46 -0800)]
ki-rin body parts
Use horse/unicorn body parts. The result for HAIR is "mane"
which is appropriate. There's no field for SKIN so the question
of whether to specify "scales" is moot. (Snakes and dragons
describe HAIR as "scales" but that wouldn't be right for ki-rin.)
PatR [Sat, 21 Nov 2020 02:56:35 +0000 (18:56 -0800)]
create monster creating concealed mimic
From an old bug report (sent directly to devteam, June of 2017):
wand or scroll of create monster becomes discovered if it makes
a mimic that is concealed as an object or as furniture within
the hero's view. Fixing this in the general case [when does
seeing a mimic as something other than a monster mean that the
mimic is being seen?] is a massive can of worms, but fixing this
specific case is trivial.
PatR [Thu, 19 Nov 2020 12:48:15 +0000 (04:48 -0800)]
daily Qt status window update...
Highlight changes to dungeon location or alignment in blue instead
of green or red since neither the old value nor the new can be
classified as better than the other. Likewise when changing
between regular Hp and Xp (or Xp/Exp) to or from you-as-mon Hp and
HD when polymorph or rehumanization takes place.
When toggling Score On, start out highlighted in blue instead of
green. When toggling it Off, don't highlight the blank space
where it had been in red. At the moment there's a quirk here;
if it is highlighted in green (from recent change) or blue (from
having just been toggled on) at the time it gets toggled off, the
space stays green or blue until that highlight times out. (It has
occurred to me that the bogus red highlight might have been added
to deliberately overwrite stale green highlights. If so, a better
fix should be achievable.)
For the title (plname and rank or plname and monster-species),
capitalize the player name since core's botl() and at least some
other interfaces do that.
TODO: toggling Exp needs work. The field used for deciding
up/down changes gets swapped and the update in progress compares
apples and oranges. [This wasn't an issue in the original Qt
implementation where Xp and Exp were two separate fields.]
PatR [Thu, 19 Nov 2020 09:57:13 +0000 (01:57 -0800)]
rename #wizlevelflip to #wizfliplevel
Since ^V is dead key for me with Qt on OSX, I use #wizlevelport
instead. It's annoying to have to type all the way up to the
'p' for it to become distinct. Rename the biggest conflict,
\#wizlevelflip to #wizfliplevel. I still have to type as far
as the first 'e' for #wizlevelport but 6 characters are easier
to type than 10.
It wasn't in the Guidebook so I've left things that way. I am
adding it to 'wizhelp' though.
PatR [Wed, 18 Nov 2020 19:16:21 +0000 (11:16 -0800)]
ki-rin's horn
Let ki-rin cure themselves (of being stunned, confused, or blinded)
with their own horn, and make them be poison resistant. They
aren't unicorns but their horn is very much like a unicorn horn.
They're flagged no-corpse so this hasn't changed them to leave
behind a horn upon death.
They were flagged as animals who neighed but they are also spell
casters. I took the animal flag off (they're still no-hands so
shouldn't be able to use items; also, unicorns aren't flagged as
animals either) and changed sound to 'ms_spell'.
PatR [Wed, 18 Nov 2020 16:56:20 +0000 (08:56 -0800)]
Qt: yet more status...
Fix the minor problem of the status lines moving up or down a
tiny amount when using the condensed (statuslines:2) layout and
the condition line changed from empty to non-empty or vice versa.
The widget used as filler when no conditions are shown needed to
have non-empty label text (single space suffices) and also has
to have its font set to the same value as the rest of status.
(I previously tried a label of " " and also "_" but had left the
font with its default value.)
The adjustments to the prefix string when the value of Xp/Exp
("Level" -> "Lvl" -> "L") or Score ("Score" -> "Scr" -> "S") was
too wide needed some fixing up. If shrinkage was needed, it was
setting the value multiple times and any extra times confused
field highlighting because it seemed to be assigning same value
rather than a changed one.
For condensed layout that moves Alignment to the Characteristics
line, add a vertical separator line between Charisma and Alignment.
PatR [Wed, 18 Nov 2020 02:55:16 +0000 (18:55 -0800)]
more Qt status
The slightly condensed (statuslines:2) status layout puts additional
width pressure on "Level:NN/nnnnnnnn" and "Score:nnnnnnnn" so add
some code to conditionally shorten the field prefix if the value of
the field is wider than the widget it's displayed in.
PatR [Tue, 17 Nov 2020 13:07:09 +0000 (05:07 -0800)]
Qt status overhaul: add support for 'statuslines'
Condense the Qt status slightly, moving Alignment field from the
Conditons line to the Characteristics line and the Time and Score
fields from their own possibly blank line to the HP,&c,Gold line.
That's for statuslines:2, which is the default. statuslines:3
restores the previous layout. I tried to make that become the
default for Qt but it got messy fast and I gave up.
I also tried to make changing 'statuslines' back and forth on the
fly work but failed. I left the code in as #if DYNAMIC_STATUSLINES
but that isn't defined anywhere. For the time being at least,
'statuslines' is config file or NETHACKOPTIONS only for Qt, not
changeable via 'O' like for curses and tty.
Change the option description for 'statuslines'. That depended
upon whether curses was compiled in when it should depend on which
interface is active. This moves the alternate info to Guidebook.
PatR [Tue, 17 Nov 2020 02:08:02 +0000 (18:08 -0800)]
auto-cursing helmet vs perm_invent
I though that I noticed a problem but later couldn't reproduce
it, so this might not be redundant. Update persistent inventory
when putting on a helmet causes it to become cursed.
Minor change: if blind at the time, hero loses knowledge of BUC
state.
PatR [Mon, 16 Nov 2020 11:06:39 +0000 (03:06 -0800)]
Qt status display
Move gold from in front of HP to the end of the line they're on,
and change its label from "Au:" to "Gold:". That makes both HP
and gold easier to see, by having HP first and by having gold
be shown after a blank column (where 'Exp' was once displayed
separately from 'Xp').
Get rid of the obsolete 'exp' widget, replacing it with 'blank1'.
Used to force 6 columns for HP, Energy, AC, Xp+Exp, blank, Gold
so that the row lines up with the six characteristics above it.
Handle Blind the same way as all the other On/Off conditions
instead of setting its label dynamically every time status gets
updated. The Qt3 code in outdated/ used to do things that way
and there doesn't seem to be any reason to have changed it.
Maybe someone (Ray?) had planned to show "Blindfolded" instead
of "Blind" when that's the only reason for being blind.
Reorder the widget declarations and initializations to match
their display order, and add a lot of comments.
PatR [Mon, 16 Nov 2020 02:28:20 +0000 (18:28 -0800)]
honor sysconf SHELLERS on VMS
I was looking into adding a confirmation prompt for '!' and it
isn't very promising due to sequencing issues. (The check for
whether '!' is allowed should happen before the prompt about
running it but the latter should take place in the core rather
than in the port code.) In the mean time, I noticed that VMS was
ignoring the SHELLERS value from SYSCF.
Untested implementation of a SHELLERS check on VMS. Even if it
works, it should not be using $USER as the user name to verify.
Tweaks the Unix implementation of check_user_string() but doesn't
switch the testing loop to the simpler version used by VMS which
is derived from the generic users test used by Qt.
PatR [Mon, 16 Nov 2020 02:19:53 +0000 (18:19 -0800)]
Qt character selection buglet
Testing for generic character name wasn't robust enough. Looking
for whether "game" is a generic name would work when compared
with the list "game games" but falsely report 'no' for the list
"games game". The first matching substring isn't followed by a
space and the routine wasn't checking for other matches in the
rest of the list. Check again with a subset list starting after
the next space beyond the false hit; repeat as needed.
PatR [Sun, 15 Nov 2020 16:59:08 +0000 (08:59 -0800)]
Qt screen layout
Simplify a recent change to the screen layout. Qt can calculate
the details and the recent code resulted in a slight amount of
blank space between the paperdoll and its resize hotspot.
Fix an off-by-one bug in the paperdoll resize routine. (The one
pixel margin at the top was being overlooked.)
PatR [Sun, 15 Nov 2020 16:34:19 +0000 (08:34 -0800)]
Qt hitpointbar tweak
When the hitpointbar is showing thick blue + thin dark blue (75%
or better health but less than 100%) and partial healing occurs,
the dark blue portion was momentarily visible pushed off the
right edge of the bar, resulting in slight flicker as the right
half of the bar got redrawn. I haven't noticed anything similar
for the paler injured-side colors, nor any temporary gap between
the two sides when losing health.
Also, remove a workaround that was needed at one point but isn't
needed anymore. (I don't remember the circumstances.)
Pasi Kallinen [Sat, 14 Nov 2020 11:41:31 +0000 (13:41 +0200)]
Futureproofing hypothetical type mismatches
If we ever want huge maps with COLNO or ROWNO larger than signed char,
this will at least allow the game to compile and start when typedef'ing
xchar to int. Trying to use huge maps exposes more bugs.
PatR [Sat, 14 Nov 2020 01:15:04 +0000 (17:15 -0800)]
Qt status
Try to set the initial window sizes to be big enough to show the
full welcome line in the message window when the Qt settings
(Preferences on OSX) specify Large font (Huge/Medium/Small/Tiny
seemed ok but I wasn't systematic about checking them).
While at it, I added a long comment about the status window format
and noticed a bug with experience formatting there. Again only
seemed to matter for Large font but the change to fix ignores font
size.
Plus add a couple of Qt "issues", one old and one just discovered.
PatR [Sat, 14 Nov 2020 00:52:45 +0000 (16:52 -0800)]
fix github issue #410 - mon throwing c'trice egg
If a monster threw a cocktrice egg that hit and petrified another
monster, the hero would credit (experience) and blame (possible
alignment penalty, &c) for it.
PatR [Thu, 12 Nov 2020 12:30:25 +0000 (04:30 -0800)]
fix #K2924 - breaking a wand without free hands
Breaking a wand didn't require the hero to have free hands.
That's definitely a bug when they're both welded to the same
two-handed weapon. It's debatable when welded separately to
a one-handed weapon and to a shield but simpler to pretend
there's no such distinction.
This also makes glass wand join balsa wand as "fragile". Hero
doesn't need as much strength to break them as other wands and
the wording for breaking them is slightly different.
My fixes entry initially had a trailing space. When I took
that out, I spotted a couple of others so take those out too.
PatR [Mon, 9 Nov 2020 00:38:01 +0000 (16:38 -0800)]
Qt paper doll's depiction of two-handed weapon
When wielding a two-handed weapon, Qt's paper doll shows uwep
in the shield slot as well as in the weapon slot to reflect
that it's occupying both hands. Make the shield slot's copy
be a mirror image of the weapon's tile so that it looks less
like wielding two weapons.
PatR [Mon, 9 Nov 2020 00:07:42 +0000 (16:07 -0800)]
fix github issue #408 - stuck to distant mimic
Attacking a concealed mimic at range by applying a polearm
could make the hero be stuck to that mimic in addition to
bringing it out of hiding. Only do that when adjacent.
This also adds a new sanity check when setting u.ustuck.
It may get triggered by other sticking activity since only
attacking has been tested. The check must be explicitly
enabled by setting the wizard mode 'sanity_check' option.
PatR [Fri, 6 Nov 2020 00:03:05 +0000 (16:03 -0800)]
github pull request #406 - polyfodder() macro
Some eggs and tins could cause an out of bounds index into the
mons[] array. Post-3.6 bug: the faulty part of the test is only
relevant for 3.7 genetic engineer monster. Earlier versions just
called pm_to_cham() which does it's own index validation.
PatR [Thu, 5 Nov 2020 23:35:30 +0000 (15:35 -0800)]
Qt text windows
Text window search behaved very strangely: at some point after
selecting [Search], entering a search string, having the string
entry popup go away, and having the search performed, but before
the result could be shown, the text window got pushed behind the
main window (map+messages+paperdoll+status). Clicking on the
main window's minimize button hid the main window and gave access
to the text window behind it. That was still functional even
after having been inaccessible; another search could be performed
and/or it could be dismissed. I still don't know what causes
that or how to properly fix it, but using raise() is a workaround
to bring it to the front where it belongs. Unfortunately you can
see it go away and come back so searching for text is distracting.
Allow <return> (when not searching) to dismiss all text windows
including RIP. Accept ctrl+[ as ESC.
Make text window searching be case-insensitive.
Searching wouldn't find a match on the first line of text. Now
it will.
This also includes an attempt to fix github issue #400 (typing a
pickup command while "things that are here" popup text window is
displayed seems to hang the program), but since I can't reproduce
that, I can't tell whether the fix works. The issue description
says that pickup started executing and "things here" couldn't be
dismissed which is different from "things here" being behind the
map waiting for it to be dismissed. The attempted fix is for text
window handling to tell Qt that it wants control of the keyboard,
so nethack shouldn't see any attempted pickup command.
PatR [Thu, 5 Nov 2020 22:36:13 +0000 (14:36 -0800)]
Qt string requestor
Some enhancements to the widget used to get player input for
getline() and also menu search and text window search.
give caller control of [cancel] and [okay] button names;
give caller a say in how wide the string input box should be
instead of basing that on the length of the prompt string
(needs more work...);
use fixed-width font for displaying the user's input;
clean up the widget layout a little bit.
src/Makefile needs a dependency update for Qt (not included).
PatR [Tue, 3 Nov 2020 22:25:06 +0000 (14:25 -0800)]
ignitable() macro
ignitable() was excluding magic lamp and then every place that
used it did so as 'ignitable(obj) || obj->otyp == MAGIC_LAMP'
so just include magic lamp.
I noticed that while hunting for an explanation for report #K2734
where returning to a previously visited level triggered the
warning "begin_burn: unexpected eggs". I've decided that the
zombie apocalypse is probably the cause. It inserted a new type
of timer in the list of such but it didn't bump EDITLEVEL to
invalidate save and bones files which relied on indices into the
old list. I'm not sure whether we should bump that now.
PatR [Sun, 1 Nov 2020 21:46:16 +0000 (13:46 -0800)]
Qt hitpointbar coloring
A couple of colors used by the Qt hitpointbar didn't look very good.
Switch to lighter green because the named value for that is too dark.
It was using the wrong value for orange; the right one isn't too dark
after all.
PatR [Sat, 31 Oct 2020 22:34:47 +0000 (15:34 -0700)]
Qt: yn dialog bit
Take care of a Qt TODO: when using 'popup_dialog' and entering
a count during a yn#aq question, change the default answer button
from 'n' to 'y' since ending the count with <return> accepts it.
PatR [Sat, 31 Oct 2020 00:46:21 +0000 (17:46 -0700)]
more alignment conversion
The overview code could reveal the true alignment of an altar
if hero saw a mimic pretending to be an altar on that spot, or
reveal junk for the alignment when mimicking at altar on some
other spot.
Avoid passing macros that might evaluate their arguments more
than once to other macros which might also do that. The hidden
code expansion can easily get out of hand (although in this case
it was modest).
Also, get rid of the unused MSA_foo alignment values since two
of them had the values swapped. Lastly, make Amask2align() more
robust in case a value with the shrine bit set gets passed to it.
PatR [Thu, 29 Oct 2020 01:07:27 +0000 (18:07 -0700)]
Qt character selection hackery
Tweak the Qt character selection widget format a bit. Forcing
the 'logo' string to be taller has resulted in stretching the
window enough to fit all the roles without a scrollbar. (On my
monitor on my OSX system, that is. It won't necessarily be an
improvement for anybody else but shouldn't break anything.)
The TODO item about making it taller so that role list fits is
still there.
PatR [Wed, 28 Oct 2020 08:43:53 +0000 (01:43 -0700)]
Qt: character selection
For Qt's character selection widget, only allow the [Play] button
to be used when the character name field is non-blank. When that
field is blank, show "(required)" there.
Catch up with SYSCF for checking generic names like "player".
Fix up handling for some conditionally unused variables.
PatR [Tue, 27 Oct 2020 22:10:22 +0000 (15:10 -0700)]
Qt: new game vs saved game selection
If player got Qt's saved game selection widget at startup but
picked "new game" there, the save file for the last character
in the list of saved games would be clobbered with the new
character's game if a save was performed. It wasn't necessarily
easy to spot because saved game selection shows the character
name from inside the file rather than from the file name, so the
next restore would look normal except for one older character
missing.
Noticed while testing: when you used the character selection
widget (either by picking "new game" in saved game selection or
because there aren't any save files), if you blanked out the
name field or it was already blanked because a generic name like
"player" had been specified, then clicked on "play", the program
would get stuck in a loop somewhere. I didn't try to figure out
where, just changed qt_askname() to revert to original name if
it ended up with a blank one.
PatR [Tue, 27 Oct 2020 05:37:40 +0000 (22:37 -0700)]
Qt saved game selection
This fixes the Qt popup widget for selecting among saved games.
The character name from each applicable save file is shown in a
button and clicking on one of those buttons restores corresponding
file. Previously all the buttons were written on top of each
other so only the final name was visible and the button for the
initial name received the click. The widget also has [quit] and
[new game] buttons.
This fixes restoring an existing save file if no character name
is supplied on the command line in the options. It does not fix
the problem where picking [new game] remembers the file name of
the last saved game in the popup's list and overwrites that file
(after requesting confirmation to do so) if/when you eventually
save. The resulting file will contain the character just saved
but be named for the earlier one. It may not be obvious because
on subsequent restores it will list names from inside the files
rather than deduce those from file names, so the clobbered/
misnamed file will just show up as the former new character.
PatR [Mon, 26 Oct 2020 19:44:40 +0000 (12:44 -0700)]
Qt popup dialog input vs '&'
I'm not sure whether any yn_function() calls include ampersand
in the list of acceptable choices but if any did, the button
for that character would have shown up blank. (Clicking on it
would have successfully produced '&' as player's input though.)
PatR [Sun, 25 Oct 2020 22:47:49 +0000 (15:47 -0700)]
Qt hitpointbar
Add support for the 'hitpointbar' to the Qt interface. Rather
than rendering the status title (name+rank or name+monster_species)
using inverse video for leading substring to produce distinct left
and right sides, draw a horizontal bar above that field.
The left portion (current health) is thicker and uses red for <10%
or <5hp, orange for <25% or <10hp, yellow for <50%, green for <75%,
blue for <100%, and black for 100%.
The right portion (missing maximum health) is thinner and runs
from white (paired with red), light gray (paired with orange),
dark gray (with yellow), plain gray (which turns out to be darker
than dark gray, with green), dark blue (with blue), and black (but
black is never shown for injury portion because that's suppressed
when at full health).
Qt already supports a square frame around the hero's map tile that
changes color according to health. Turning the hitpointbar option
Off or On has no effect on that.
PatR [Sat, 24 Oct 2020 10:17:19 +0000 (03:17 -0700)]
disclosure prompt phrasing
With to-be-3.7, if game ends without any achievements, the conduct
disclosure prompt is the same as it has always been
Do you want to see your conduct?
If it ends after attaining one achievement (probably entering the
mines or acquiring the second rank title when gaining Xp level 3)
you're asked
Do you want to see your conduct and achievement?
which looks awkward after the fact if 'y' reveals multiple conducts.
Instead of deciding whether to pluralize "conduct(s)", simplify the
prompt when one or more achievements have been attained to be
Do you want to see your conduct and achievements?
That works even when there is only one achievement.
PatR [Sat, 24 Oct 2020 03:15:01 +0000 (20:15 -0700)]
fix #K2622 - fire/frost horn feedback for monster
When a monster used a fire horn or frost horn to attack the hero,
the feedback claimed that the attack was being directed at itself.
The error occurred in code that was added to 3.7 during 3.6
development but wasn't present in 3.6.x so fixes entry is in the
"exposed by git" section.
PatR [Sat, 24 Oct 2020 02:43:10 +0000 (19:43 -0700)]
fix #K2617 - metallivores eating iron bars
Monsters with rust attacks (rust monster) and corrosion attacks
(black pudding, gray ooze) can eat or otherwise destroy iron bars
but xorns could only move through the iron bars spot without being
able to eat the metal there. Change xorn to eat bars instead of
phazing through them. Lets rock moles eat bars too.
Hero polymorphed into a rust monster would eat bars if trying to
move to their location but couldn't do so if already there (maybe
was in xorn form and now in rust monster form). Xorns could pass
through them but not eat them. Allow hero metallivores to eat
bars at the current location via 'e', similar to eating food off
the floor. Hero as rock mole behaves like rust monster.
Pasi Kallinen [Wed, 21 Oct 2020 18:04:03 +0000 (21:04 +0300)]
Mild Zombie Apocalypse
When a zombie (or lich) kills a monster in melee without a weapon,
the monster can rise few turns later as a zombie.
The only creatures that can be zombified are ones that actually have
a zombie counterpart monster. A zombie cannot turn a jackal into
a zombie, for instance. But it could turn a shopkeeper into a human
zombie, or a dwarf king into a dwarf zombie.
Zombies will fight with monsters that can be turned into zombies.
Originally this was a SliceHack feature, but this is based on xNetHack
version of it, with some modifications.
Bart House [Sat, 13 Jul 2019 17:53:53 +0000 (10:53 -0700)]
Removing assertion that does not hold under all scenarios.
When we save gamestate as part of making an insurance snapshot, we will
save message history which will clear toplines but leaving window state
in tack including the need for more.
Bart House [Fri, 12 Jul 2019 04:04:29 +0000 (21:04 -0700)]
Fixed bug with inmore and toplin state management.
When fuzzing, we would increment ttyDisplay->inmore but then prematurely
exit more() leaving ttyDisplay->inmore set.
Under various conditions, we can request to remember the topline when
the topline had not yet been acknowledged leaving toplin state in an
inappropriate state.
Bart House [Sat, 13 Jul 2019 23:00:14 +0000 (16:00 -0700)]
Add stopping in the debugger when nhassert() is hit in the windows port.
When stopping in the debugger after having called impossible, the windowing
state will have been modified since the assertion was hit. This made
examining state that caused the nhassert to fire no longer possible.
To avoid this issue, we now detect the debugger and stop in the debugger
prior to impossible.