NetHack Patch Database v0.27

323 patches

Statuscolors and hitpointbar

NameStatuscolors and hitpointbar 2
Rating80%
Authortungtn
ForNetHack 3.6.0
DescriptionCustom rule-based coloring for status fields and visual bar for hit points
 This is a full rewrite of the old statuscolors and hitpointbar patches for NetHack 3.6.0, replacing 3.6.0's statushilites system. For the uninitiated, statuscolors allows status fields to be colored according to player-defined rules, e.g. show HP in green at 100%, yellow at 50% and red at 25%, highlight Hungry status, etc. whilst hitpointbar displays a bar behind the player's name filled according to the amount of HP remaining. Both features are bundled into a single patch because they share infrastructure, and almost everybody that wants one wants the other.

Why a rewrite? I noticed that the old patches were omitted from NetHack 3.6.0 by the DevTeam despite universal praise for them. My guess as to why is because of their TTY-centric design that made it hard to extend to other window ports. As such, this patch is designed to be easily extended to other window ports.

NOTE: This patch only implements these features for TTY, but with work could be extended to other window ports.


### TO COMPILE ###

For statuscolors, add -DSTATUS_VIA_WINDOWPORT and -DSTATUS_COLORS to your CFLAGS, then compile the game as usual.

For hitpointbar, only -DSTATUS_VIA_WINDOWPORT is needed.


### USING HITPOINTBAR ###

OPTIONS=hitpointbar

That's all.


### USING STATUSCOLORS ###

First, statuscolors need to be enabled.

OPTIONS=statuscolors

Next, statuscolor rules need to be defined. Rules for the old statuscolor patch are compatible, as are the new rule types added by NAO-3.4.3.

Basic example that colors hit points with multiple rules:

STATUSCOLOR=HP%100:lightgreen,HP%75:yellow,HP%50:orange,HP%25:red&underline

Conditions can be colored:

STATUSCOLOR=Satiated:lightcyan,Hungry:orange

Support for NAO-3.4.3-style less than, equal and greater than rules:

STATUSCOLOR=Pw<5:black&bold,Pw.5:nocolor,Pw>5:white

Like 3.6.0's statushilites, all numeric fields can be highlighted, and change rules are supported:

STATUSCOLOR=AC-1:brightgreen&inverse,AC+1:orange&inverse
STATUSCOLOR=St<18/01:nocolor
STATUSCOLOR=St<18/**:white
STATUSCOLOR=St.18/**:white&underline
STATUSCOLOR=St>18/**:white&underline&inverse

Change amounts can be colored differently:

STATUSCOLOR=Gold+1:green
STATUSCOLOR=Gold+100:brightgreen
STATUSCOLOR=Gold+200:brightgreen&underline
STATUSCOLOR=Gold-1:red

Like 3.6.0's statushilites, this patch features an in-game statuscolors customization menu for adjusting rules, under the options menu. Rules set this way can even be copy-pasted back into a configuration file!

For the full lists of status field names, rule types, color and attribute names, consult the changes to the Guidebook:

https://github.com/tung/nethack360-statuscolors/commit/7e259294d778ed7cb282f69c19ec02d646f28a97
Downloadhttps://github.com/tung/nethack360-statuscolors/compare/master...statuscolors2.diff (162.7 Kb)
AddedJanuary 28, 2016 10:35
Submit an update to this patch

5 Comments

5PlispAugust 02, 2018 07:59
Works, be sure to use the 3.6.0 sources@http://nethack.org/v360/download-src.html and add the appropriate CFLAGS before compiling.

Can confirm a prefix install with the 'linux' hints file works[Quote]
5Ozma777September 21, 2017 11:29
bouquet wrote:

Doesn't patch against current 3.6.0 branch. I look forward to using it some day!

I haven't tried this, but in my experience if it doesn't patch when using the patch.exe command, you could also try hand coding it if you really want it.
(changing the - lines to the + lines, and also look at the filename and search for the last few lines BEFORE the change so you know where to put stuff in and the add stuff).
ALTHOUGH in this case that would be a hell of a lot of work if you really want it to work it might be worth the work.[Quote]
0bouquetSeptember 08, 2017 02:57
Doesn't patch against current 3.6.0 branch. I look forward to using it some day![Quote]
5FIQJune 30, 2017 18:56
Great![Quote]
5ElronndMarch 16, 2017 05:31
Works great![Quote]

Add a comment

Name ()required
Rating (0 is worst, 5 is best) 
Commentrequired
You can use up to 1024 characters.
Only supported tag is [url]clickable_link[/url].

You will need to answer the following question correctly: What symbol represents a potion?