Commit Graph

137 Commits

Author SHA1 Message Date
PatR
2e30f6916f more !STATUS_HILITES
No point in checking for timed out temporary highlights if there aren't
any highlights.
2019-04-09 17:45:32 -07:00
PatR
0e425d645f curses vs !HILITE_STATUS
The curses interface wouldn't build with HILITE_STATUS disabled.  I
started adapting it to handle genl_status_update() but that was taking
too much effort with each niggling detail leading to another.  This
goes the opposite direction:  forcing the old STATUS_VIA_WINDOWPORT
behavior without having that #define available.  That dragged along a
bunch of unexpected changes too.
2019-04-06 15:53:51 -07:00
PatR
0bfd12dd16 tty status
Take care of a minor 'TODO' and make another stab at getting truncated
encumbrance and/or level-description to reset to full size when enough
space becomes available.
2019-04-06 05:36:29 -07:00
PatR
b7a884289d botl.c functions
Put the prototypes for routines in botl.c into the same order as the
corresponding functions are in the file.  Also a few were missing and
another few used STATIC_OVL when STATIC_DCL was appropriate.
2019-04-06 01:08:16 -07:00
PatR
0a847f46f9 streamlined status update for 'time'
When the 'time' option is on and context.botl isn't already set,
call a simpler status update routine that ignores all other fields.
When that flag is already set, full status update takes care of time
along with the other fields.

Expected to reduce bottom lines processing time but not screen I/O.
Only lightly tested.
2019-03-31 08:23:36 -07:00
PatR
c63d3fbfbb bogus status updates
I finally figured out why status gets updated periodically even if
none of the fields have changed.  Once a temporary highlight times
out, it starts a cycle of timeouts every 'statushilites' turns.  When
I worked on this before, it was convoluted but not this convoluted.

In moveloop, if 'context.botl' call bot; in bot
  call evaluate_and_notify_windowport;
  for each field, call evaluate_and_notify_windowport_field:
    call hilite_reset_needed and set 'reset' to the result;
    if 'reset' is True then do status_update
      and set 'curr->chg' and 'prev->chg' to True.
Then in moveloop call status_eval_next_unhilite:
  for each field
    if 'curr->chg' set 'curr->time' to moves+hilite_delta;
    on the call after hilite_delta ('statushilites') moves,
      call hilite_reset_needed which returns True if there is any
      rule for temporary highlight and set 'context.botl'.
Go back to start.  If multiple fields had temporary timeouts and
they were activated on different turns so expired on different turns
you could conceivably end up with context.botl being set every turn.

My first writeup trying to explain all this was wrong.  I won't
testify about the accuracy of this one in court....

This extends the highlighting data structure to track the current
rule that's in use.  And for that to make sense, it eliminates the
merging of settings from multiple matching rules.  So anybody with
 hit-points/up/inverse
 hit-points/up/green
 hit-points/up/bold
will need to manually merge their rules like
 hit-points/up/green&inverse+bold
or else whichever rule matches last will be the only one in effect.

There are a lot of miscellaneous changes made as I flailed about.
The three most significant ones are that there is no guesswork over
what kind of highlight rule is in effect, status_eval_next_unhilite
will only set a timeout value if the current rule is for a temporary
highlight, and hilite_reset_needed will only return True if a timeout
is for a temporary highlight (probably moot after the _next_unhilite
change).
2019-03-31 00:33:33 -07:00
PatR
4ca8f6428b status line title field
Status formatting used to truncate the Name portion of "Name the Rank"
or "Name the Monster-type" at 10 characters even if the rank or monster
portion left room for more.  Change that to keep as much of the name as
will fit.  The truncation might vary over time as new experience levels
produce new rank titles of differing lengths, but I don't think that's
a problem.  For truncated names, it still keeps at least 10 characters
even if that leaves the field longer than the target length for title
(which used to be 29 but now is 30).
2019-03-30 17:46:16 -07:00
PatR
d989b36763 revamped curses status display
I've overhauled the status display for curses.  Horizontal layout
supports both 2 lines and 3 lines which can be changed dynamically
via using 'O' to set 'statuslines'.  Fields are spread out a little
more than they used to be, making it more readable--at least to me--
but the extra spaces get squeezed out when lines become too long.
If 'showexp' is on and either conditions or hunger+encumbrance go
off the right edge, experience points are suppressed (but the option
is left on, so they'll come back once there is room).

For traditional 2-line hozizontal status, if hunger+encumbrance+
conditions go off the right edge even after experience points are
knocked out, there will be a '+' in the rightmost column if there
are any conditions that are all the way off.  At present it doesn't
use the tty method of switching to abbreviated condition names to
reduce their legnth.  I'll probably tackle that eventually if no one
beats me to it.

For 3-line horizonal status, there was an older implementation (but
disabled via #if 0) with gold and score moving to the third line.
(I'm not sure how status conditions were handled.)  This one ignored
that and modified 2-line from scratch, moving alignment from line one
to line 2 and level description, time, and conditions from line 2 to
line 3.  It looks like this (view with a fixed-width font...).

Wizard the Hatamoto            St:16 Dx:15 Co:18 In:8 Wi:11 Ch:7    S:25
Lawful  $:21  HP:25(25)  Pw:6(6)  AC:4  Xp:2/21  Hungry Burdened
Dlvl:1  T:36                                     Blind Lev

Score is actually right aligned with the edge but I've deleted several
spaces to keep the line shorter here.  The status conditions line up
with the hunger slot as that shifts due to changes in gold/HP/power/AC/
experience, and conditions prefer that column even when hunger and/or
encumbrance are blank.  Howver, if the number of conditions increase to
the point where they would go off the edge, the whole list shifts left
instead of trying to stay lined up with hunger.  (It's just coincidence
that the lefthand parts of lines 2 and 3 seem to line up in this sample.
In general, they don't.)

The vertical layout has reordered most of the fields and now has a few
blank lines to separate those fields into some groups for readability.
Lines have the form of
Field-name  : Value
and when highlights apply, now they only affect the value portion.
Single digit characteristics are padded with a leading space so that
all six of them line up (for "18/xx", "/xx" protrudes to the right).
HP and Pw are aligned with each other.  Hunger and encumbrance share a
line.  When there are more than three conditions, they're shown three
per line instead of wrapping across lines.  And if too many lines are
present, it will squeeze out enough blank ones to fit.

To see the vertical status, you need a display size of at least 106
columns with 'windowborders' explicitly off, or 110 with them on; also
set option 'align_status' to 'right' or 'left'.  (With borders on,
including the default 'auto' setting, the vertical status appears at
width of 108 columns, but does so by hiding 2 columns of the map; using
110 columns avoids that.)  Resizing from outside the game or changing
align_status via 'O' both cause dynamic reconfiguration of the layout;
there's no need to save, make config changes, then restore.
2019-03-23 17:38:23 -07:00
PatR
ebae433711 highlighting status condition via 'O' bug
It took me a while to track this down:  if you use 'O' to create
hilite_status rule(s) for status condition(s) and you specify multiple
attributes in the rule creation menu, it accepts them but it was
parsing the new rule(s) incorrectly and only supported one attribute.

 if (mask & bit)
  something;
 else if (mask & other_bit)
  something_else;
 else if (mask & yet_another_bit) ...

effectively stops at the first bit matched.  (At the time that that
was written, the menu leading to it only accepted a single attribute.)
2019-03-21 18:26:31 -07:00
PatR
9d67cd1597 status lines' "End Game"
Change the generic status line location "End Game" to relevant element
name "Earth", "Air", &c.  ("Plane of <element>" might be too long if
hungry and encumbered and afflicted by conditions.  "Astral Plane" is
already specific so not affected.)
2019-03-15 17:51:39 -07:00
PatR
2d62513b1b minor nitpicks
A couple of trivial things I noticed while looking at status cleanup.
2019-02-09 15:33:16 -08:00
Pasi Kallinen
7bbc1f0130 Fix warning
Fix "using integer constants in boolean context"
2019-01-31 21:31:29 +02:00
PatR
02cfd131ee status gold vs symset:Blank
Symset:Blank sets all the map symbols (except STRANGE_OBJECT) to
<space>.  The status lines for !STATUS_HILITES force status to use '$'
instead of ' ' for the prefix before ":1234" for gold, but the status
lines for STATUS_HILITES did not.  tty ended up with ":1234" for gold.
win32 and curses both ignore the prefix and construct their own, but
since win32 uses the map symbol for that it must also be ending up
with ":1234" (I assume; I haven't seen it).  curses is forcing '$' for
the prefix, even on the rogue level.

This attempts to fix win32 without be able to test the result.  I've
left curses alone.
2018-12-24 18:43:51 -08:00
PatR
27a515a4cc get_hilite_color()
Stop pretending that long and int are the same size when picking status
highlight rule for gold or time or experience-points.

Also, K&R compilation might lack <limits.h>, so let XXXconf.h define the
necessary macro(s) (currently just LONG_MAX) so that it can be skipped.
2018-12-15 15:46:49 -08:00
nhmall
afc34d3016 a late bot() call was observed on GUI Windows so prevent such a crash 2018-12-08 22:08:55 -05:00
PatR
e8a5ff6dff gold highlight bit
Keep type/value straight:  'update_all' is boolean, not ordinary int.
2018-12-07 16:37:24 -08:00
PatR
9e170baecc fix #H7655 - highlighting gold
With options along the line of
 OPTIONS=statushilites:4
 HILITE_STATUS=gold/always/yellow
gold started out unhighlighted (unhighlit?).  I didn't try to figure
out why, just changed things to force a full status update when gold
requires internal changes (different \G encoding or different glyph)
which is something that happens when session first enters moveloop().
2018-12-07 00:36:38 -08:00
PatR
27fe555bc1 src/ formatting
Clean up quite a bit of minor things found with simple grep patterns:
operator at end of continued line instead of beginning of continuation
(and a few comments which produced false matches, so that they won't
do so next time), trailing spaces (only one or two of those), tabs (a
dozen or so of those), several casts which didn't have a space between
the type and the expression (I wasn't systematic about finding these).

I think the only code change was in the function for the help command.
2018-11-17 16:40:53 -08:00
nhmall
731e10f058 follow-up bit for stale gold sym 2018-11-15 02:51:27 -05:00
nhmall
acdc62a861 stale gold symbol displayed after symset change
a stale gold symbol could be displayed on the status line following a switch
to a new symset, as observed and reported for Windows RogueEpyx symset.

An update is required for gold in the status line for a change to
any of the following:
    context.rndencode value
    the encoded glyph value for COIN_CLASS
    the gold amount
2018-11-15 02:34:45 -05:00
Pasi Kallinen
0470065b47 X11: TTY-style status lines
Set X resource NetHack*fancy_status: False to enable the TTY-style
status lines. Default is the fancy status.

This patch is somewhat unfinished - even though the TTY-style status
allow for status hilites, the colors don't work correctly yet.
Also changes the fancy status to use the windowport notification code.
2018-10-22 21:26:56 +03:00
PatR
14bef9a02d formatting cleanup src/*.c
Remove trailing spaces, and remove tabs from the files that had
trailing spaces.

Also, rndorcname() was using a random value to terminate a loop
and was recalculating a new one each iteration.
2018-10-02 16:53:22 -07:00
nhmall
21a81d0294 BL_RESET usage for window port status line updating
Like BL_FLUSH, only send BL_RESET if the window port has
indicated it wants them via setting the appropriate WC2
bits in its window_procs structure. Update documentation.
2018-09-22 22:41:02 -04:00
PatR
4ce6d81d60 hilite_status type 'up' or 'down' vs strings
The temporary highlight types 'goes-up' and 'goes-down' aren't useful
for the three string status fields (title, dungeon-level, alignment)
since the string values might go up when the underlying value goes up
or might go down instead (and similarly for down, down, up).  The code
involved can compare strings but the values are effectively arbitrary
so the comparison is only really useful for same vs changed.  This
treats types 'up' and 'down' for strings as 'changed' when coming from
config file and no longer offers them as choices when using 'O'.

Config file parsing perhaps ought to treat them as errors instead.
2018-09-06 05:26:21 -07:00
nhmall
a417d67572 status_update distinguish new BL_RESET from BL_FLUSH
This adds BL_RESET to status_update to send a flag to a window
port that every field should be updated because something has
happened in the core to make current values shown to be
untrustworthy or potentially obliterated.

That is now distinguished from BL_FLUSH, which now has no
bearing on whether every field needs to be redone, and instead
can be used by a window port indicator that it is time to render
any buffered status field changes to the display.

tty port now sets WC2_FLUSH_STATUS indicator for BL_FLUSH support
and now does one rendering per bot() call, instead of up to 22.

Side note: The tty hitpoint bar code was relying on the old
behavior of redrawing everything upon BL_FLUSH apparently, so it
initially had some color change lag issues, corrected by marking
BL_STATUS as dirty (in need of updating) in tty_status_update()
whenever BL_HP was marked as dirty.
2018-09-03 08:18:18 -04:00
nhmall
0b32735ff8 ensure BL_FLUSH always sent when context.botlx is set
ensure BL_FLUSH always gets sent down to the window port whenever bot() is
called with context.botlx set so that status updates work as
expected after full screen clear after a level change

Fixes #107
2018-09-02 18:26:42 -04:00
nhmall
9323f074f7 Revert "ensure BL_FLUSH always gets sent down to the window port whenever bot() is"
This reverts commit ee4c12b238.
2018-09-02 18:10:40 -04:00
nhmall
ee4c12b238 ensure BL_FLUSH always gets sent down to the window port whenever bot() is
called with context.botlx set so that status updates work as
expected after full screen clear after a level change

Fixes #107
2018-09-02 18:05:16 -04:00
PatR
7af51743b7 hilite_status: score vs !SCORE_ON_BOTL reprise
Handle suppression of 'score' from the 'O' menu for viewing and
setting hilite_status rules differently so that the count of the
number of rules will always match the number of rules shown by the
'a - View all hilites in config format' choice.  If there are score
rules in the config file for a game running under !SCORE_ON_BOTL
configuration, list 'score' normally but if player picks that menu
entry, the followup menu will have the existing rule(s) and 'X -
remove selected hilites' but not 'Z - Add a new hilite'.  If there
aren't any score rules--or there were some but they've now all been
'X'd--then 'score' won't be listed as one of the status fields.
2018-06-26 17:36:00 -07:00
PatR
c04b652e40 hilite_status: score vs !SCORE_ON_BOTL
When built without support for SCORE_ON_BOTL (the default), suppress
'score' field from 'O' menus for adding/removing hilite_status rules.

Also, add "encumbrance" as field name synonym for "carrying-capacity"
and "experience-points" for "experience".  Relevant for rules set in
config file or via NETHACKOPTIONS.
2018-06-24 17:44:33 -07:00
PatR
9b71a62cb4 more hilite_status condition attributes
The formatted value for attributes of condition highlights was
reporting 'normal' (aka no attributes) even when the highlight
rule specified some other value.  It initialized a bitmap variable
to ATR_NONE, which is not 0, and then or'd other bits to that.
Then during formatting it checked whether the ATR_NONE bit was set
and returned 'normal' without examining the other bits.  Actual
highlighting wasn't affected, just the strings in the rule set
shown by the 'O' command.

This is a separate issue from the earlier 'bonus fix' where the
attributes of previous condition rules got clobbered if a
hilite_status:condition/any-color&normal rule was added.
2018-06-24 01:56:15 -07:00
PatR
699e65fa34 hilite_status attributes
Take a step towards eliminating merging hilite_status rules during
highlighting by creating a single rule instead of multiple ones
when specifying multiple attributes for the same highlight via the
'O' command's menus.

Old:
 (pick_one menu to pick a color) + (pick_one menu to pick an attribute)
| hilite_status:title/always/red&bold
 (pick_one menu to pick a color) + (pick_one menu to pick an attribute)
| hilite_status:title/always/red&blink
New:
 (pick_one menu to pick a color) + (pick_any menu to pick attributes)
| hilite_status:title/always/red&bold+blink

At present, rule selection during highlighting still merges multiple
applicable rules instead of finding the best one first, with the
problems that entails.

Bonus fix:  a hilite_status rule for status conditions which specified
"no attributes" would clear attributes for all previous condition
rules rather than just the one(s) in that "no attributes" rule.
2018-06-23 17:37:54 -07:00
PatR
645e1ac5b3 hilite_status title when polymorphed
Make a 'textmatch' rule for title that matches a specific monster type
while polymorphed take precedence over a "none of the above" one.
2018-05-22 19:23:03 -07:00
PatR
cb02e77589 hilite_status, what else?
While deciding which highlights to apply, give 'percentage' and/or
'absolute' rules that match precedence over 'always' rules regardless
of order within the config settings.

When using 'O' to add 'up/down/changed' rule, don't include 'down'
as a choice for field 'time'.

When using 'O' to add rules, don't squeeze out spaces if adding a
'textmatch' rule for title (to support "field worker", "high priest",
"student of stones", and so forth).

While deciding which highlights to apply, ignore double quotes when
testing whether a 'textmatch' rule matches the current text of a
field.  This allows rules to specify string values as '"value"'
instead of just 'value'.  It not does validate them to ensure quotes
are paired at beginning and end, it just ignores them.  New rules
created via 'O' for rank title include them when displaying what the
new rule would look like as a config file option.  Other text fields
haven't been changed to show quotes but ignoring such applies to all
'textmatch' comparisons.

Expand the menu for adding 'textmatch' rules for title.  When a rank
has separate male and female titles, list three entries instead of
just one
  "male rank"
  "female rank"
  "male rank" or "female rank"
(the order of the first two entries and of the two titles in the
third entry is reversed if the current character is female).  If the
user picks the third entry, two rules are added instead of just one,
identical to each other except for the text to match.

Further expand that menu with
  "none of the above (polymorphed)"
at the end.  When deciding which highlights to apply, "none of the
above" and "(polymorphed)" and the full string are treated as
equivalent (with spaces, quotes, and parentheses ignored).  Rather
than comparing anything against the title text, it matches if the
hero is polymorphed (where title will be "<hero> the <monster-type>"
instead of "<hero> the <rank>").  Note that the user can have config
file 'textmatch' rules for title to match specific "<monster-type>"
values but the 'O' menu doesn't offer any opportunity for that.
(I've just realized that rules for specific monster types should be
given precedence over "none of the above" but at present that isn't
done; the order of the rules will determine which wins out.)
2018-05-22 10:40:55 -07:00
PatR
1e0f546740 hilite_status string comparison
Simplify the string comparison done when checking 'textmatch' rules
to decide whether to highlight something.

Fix the menu titles when setting up a textmatch via 'O':  the title
for color referred to attribute and the one for attribute used the
default.  The two tiles are set up in advance; the one for color was
set correctly but then the one for attribute was written into the
wrong buffer.

When using 'O' to manipulate hilite_status rules, if there are any
when you're done and the 'statushilites' option (iflags.hilite_delta)
is 0, give a message reminding that it needs to be non-zero for
highlighting to be activated.
2018-05-22 02:42:08 -07:00
PatR
2b8160a70d status_hilite: no more ANY_UINT
The fact that the index to the array of hunger strings is an unsigned
field in 'struct you' is unimportant as far as its usage for status
highlighting.  Since it is the only ANY_UINT field, change BL_HUNGER
to plain 'int' so that there'll be no need for ANY_UINT handling.

And some more validation when setting up highlight rules.  For 'O',
in the menu to choose a relationship after supplying a number N,
don't include "less than N" and "N or less" for percentage or
absolute--other than AC--unless N is greater than 0, and don't
include "N or more" and "more than N" for percentage unless N < 100.

Also, when 'O' prompted for a number, if you entered <X or =X (for X
not a sequence of digits), it remembered the '<' or '=' (or '>=', &c)
when reprompting for a valid number.  If the 'X' portion is invalid,
discard the relationship operator before asking for another number.
2018-05-21 19:11:18 -07:00
nhmall
f614b9e27e fix access violation in status_finish() if window port not initialized 2018-05-21 18:31:45 -04:00
PatR
dc00df935b hilite_status support for <=, >=, explicit =
Add threshold relationships <= and >= so that the change to make <
and > perform their expected comparison can be resolved.  "Point
release shouldn't force players to update their config files" does
not carry sufficient weight given that they already had to do that
to turn on status highlighting when going from 3.6.0 to 3.6.1.  The
3.6.2 release notes can warn them about the need to update their
status highlight options if they're currently using '<' and/or '>'.

Entering new hilite rules via the 'O' command accepted '=' prefix
for numbers, but rules from config files did not.  Now they do.
The '=' prefix is optional in both situations.

With 'O', percent rules and absolute rules had separate menu entries
so picking one was already choosing the rule type, but entering a
numeric value without percent sign (for percent) or with one (for
absolute) would change the type on the fly.  If someone has already
picked percentage they shouldn't be required to append '%' to the
digits, so that is now optional.  If explicitly included with the
number after having picked absolute, the value is rejected.  It is
trivial to back up in those menus and choose the alternate type if
someone changes his/her mind part way through.

If a status field has both persistent (percent, absolute, always)
and temporary highlights (up, down, changed), give the temporary one
precedence when the value has changed.  To do that with 3.6.1, the
rules for temporary had to follow the ones for persistent highlights
since whichever matched last was the one used.  Now their order
relative to each other doesn't matter.  If a value increases and
there is both an 'up' rule and a 'changed' rule, the more specific
'up' takes precedence, regardless of their relative order; likewise
for decreases and 'down' vs 'changed'.

There were a couple more tweaks needed to support negative values;
I overlooked the 'O' menu handling before.  >-1% and <101% now work
for both the config file and interactive adding via 'O' methods of
defining highlight rules, although new >=0% and <=100% will be
clearer to anyone examining a rule set.

'enum relationship' was forcing LT_VALUE to be -1 but that fact was
never utilized anywhere, and the code was using magic number -2 to
mean "no relationship yet".  This adds NO_LTEQGT to replace the
latter and gives it value -1.  EQ_VALUE is still 0 so effectively
the default if a highlight hasn't been fully set up yet.  LT_VALUE
is now just another positive value along with GT_VALUE, LE_VALUE, &c.

The Guidebook hasn't caught up with the code yet.

The rule choosing code used when deciding how to highlight something
only supports 'int' fields and relies on 'long' having the same bits.
It needs to be extended to support 'long' properly.  Fixing should
be straightforward (except maybe for the initialization of min/max
best fit handling) but this doesn't address that.  Also, data type
for encumbrance/carrying-capacity should be changed from unsigned to
plain int so that no extra handling for just one field will be needed.
2018-05-21 05:58:01 -07:00
PatR
4fa455e306 more status_hilite threshold handling
Negative AC needed one extra change to support >-N since there was
a place in the code that assumed 0 was the lowest possible value.
(My earlier testing was with <-N which didn't have that issue.)

Make '/<N/' work as 'val < N' instead of 'val <= N', and />N/ work
as 'val > N' instead of >=.  The <= and >= behavior might have been
intentional but the only support for that I could find was that
the 'O' menu used "N or less" for '<' and "N or more" for '>' when
setting up 'absolute' rules.  If we actually want <= and >= (and we
probably do...), we should add them as more relationship operators
instead of misusing < and >.

Simplify the is_ltgt_percentnumber() case when parsing options
since input has been fully validated by the point that that test
passes.  Among other things, /<-0/ and />-0' are now accepted (as
synonums for 0; -0 doesn't mean anything special) instead of being
silently rejected and then discarding the rest of the config file.
(That bad behavior is a separate issue not dealt with here.)
2018-05-20 01:20:51 -07:00
PatR
bed79b8391 more hilite_status threshold number parsing
In addition to leading '-' for negative values, accept explicit '+'
for positive values as a no-op.
2018-05-18 22:56:21 -07:00
PatR
4b98266e25 fix #H7160 - hilite thresholds reject negatives
There was a prior report about this but I can't find it; maybe it
didn't go through the web contact form.  Anyway, status_hilite
threshold numeric values wouldn't accept a minus sign before the
digits, preventing negative AC values from being tracked.
2018-05-17 15:48:09 -07:00
nhmall
88f5dcbfb4 fix spaces in hilite_status option text field not working H7107 (GitHub #88)
Fixes #88

H7107: FWD: spaces in hilite_status option text field not working
2018-05-15 19:35:36 -04:00
nhmall
d2a7c8afa1 some status data corrections 2018-05-07 08:41:54 -04:00
nhmall
71bead4e39 do some performance optimizations on highlighting of tty status 2018-05-05 19:43:10 -04:00
keni
d8c49ec9d1 Add updated copyright lines, part 1. 2018-04-25 15:00:13 -04:00
Pasi Kallinen
2548d68dd3 Fix some warnings
Remove an unused variable, add missing FALLTHRUs, and use the same
FALLTHRU wording where it wasn't recognized by gcc
2018-03-30 19:42:50 +03:00
Pasi Kallinen
94ad7512a6 Compile-time option to allow some prompts remember the input
Define EDIT_GETLIN to make the tty, X11, and Qt4 windowports to
remember the input strings for wishing and annotation.
2018-03-26 23:04:53 +03:00
Pasi Kallinen
b416564f39 Fix garbage value warning 2018-03-05 21:09:15 +02:00
Alex Smith
27e5f025f1 Don't use a plain %s when writing to a buffer
My compiler was understandably concerned about a potential buffer
overflow here. I don't think the string could get long enough to
cause that to happen, but it's hard to be certain. It's much safer
to limit the length of the string so that it fits in the buffer, as
done here, and if there really wasn't a problem the change will
cause no harm at all. (If there was, the string will be truncated
rather than corrupting memory. This code is in showing the
config-file version of a status highlight, something where
truncated text will probably be obvious to the user.)
2017-11-01 15:24:52 +00:00
Pasi Kallinen
4af8a93cff Status hilites: Fix defining hunger via menu 2017-10-25 12:27:02 +03:00