Commit Graph

7 Commits

Author SHA1 Message Date
nhmall
b61f55f0e4 Use-after-free when saving Qt message history #996
Possibly resolve #996
2023-03-10 11:27:11 -05:00
nhmall
ba5356603a yn()
A number of C compiler suites have a math.h library that includes a yn()
function name that conflicts with NetHack's yn() macro:
"The y0(), y1(), and yn() functions are Bessel functions of the second kind,
for orders 0, 1, and n, respectively. The argument x must be positive. The
argument n should be greater than or equal to zero. If n is less than zero,
there will be a negative exponent in the result."

At one point, isaac64.h included math.h, although that has since been removed.

Some libraries used in NetHack (Qt for one) do include math.h and that required
build work-arounds to avoid the conflict.

Rename the NetHack macro from yn() to y_n() and avoid the math.h conflict
altogether, eliminating the need for that particular work-around.
2023-01-12 16:04:40 -05:00
PatR
69dd0485fb Qt message window: horizontal scrolling
Multiple stints of flailing about without a clue finally led to
a breakthrough.  When writing a new message to the multi-line
message window, force the view back to showing the starts of
lines if player has scrolled it to the side and left it that way.
Put another way, if it has been scrolled to the right, scroll it
as far as possible back to the left.
2020-11-29 16:58:56 -08:00
PatR
dde561810d Qt prompt highlighting
When qt_yn_function() or qt_more() is asking for a single character
response, typing anything will cause the prompt line in the message
window to stop being highlighted.  If they reject what's been typed,
they beep (--More-- doesn't start beeping until second rejection);
change both of them to also rehighlight the prompt line to give a
visual indication that the question/acknowledgement is still being
asked.
2020-10-08 11:24:11 -07:00
PatR
2a762ab641 Qt prompt responses in message window
When Qt issues a prompt string in the message window, update it
with the player's response once that has been obtained.
2020-08-31 00:30:36 -07:00
PatR
1f953fa959 Qt message [un]highlighting
The Qt interface highlights the last message issued (using a
mechanism for selection, as if for copy+paste or similar operation)
but it was staying highlighted until another message was eventually
given.  Having an old message seem to stick around is annoying and
is particularly bad when the message is a prompt.  If the player's
answer doesn't cause a message to be shown then it seems as if the
prompt is still pending.

This removes the highlighting (by bulk unselecting) once the player
gives another input keystroke or mouse click.

It would be much better if the selecting/highlighting was for all
messages issued since last time highlighting was cleared.  Figuring
out how to do that correctly is more effort than I want to expend.
2020-08-30 22:50:02 -07:00
nhmall
3073a588eb Rename Qt4 directory to Qt 2019-12-07 17:07:50 +01:00