Status bar question

i’m sure i’m making this harder than it actually is, but futzing with the status bar in dialog is messing with my brain.

all i want to do is BOLD the score (this has specific meaning under certain game conditions).

i’ve tried this but it doesn’t work:

(redraw status bar)
	(status bar @status) {
        (status headline) 
	    (current score $Score)
	    (div @score) {
			(span @bold)Score: $Score
			(if) (maximum score $Max) (then)
				of $Max
			(endif)
		       }
	    }
1 Like

Heartbreaking news, but:

Spans and inline style changes (bold, italic, reverse, fixed pitch, and roman) are ignored in the top status area.

Via: Chapter 5: Input and output

However! You can achieve very similar effects using divs. For example:

(style class @bold)
    font-weight: bold;
    float: left;

(style class @status)
	font-weight: normal;

(redraw status bar)
	(status bar @status) {
            (div @bold) { Score: 1 }
            Score: 1000
	}
3 Likes

This only works in Å-machine right?

So far I’ve only tested it in the Aa-machine… but I believe the div-based approach should work on the Z-machine too, based on the docs at least!

1 Like

I’m not actually sure if you can use bold and italics in the Z-machine status line. (Not as a Dialog thing, as a Z-machine standard thing.) You certainly can’t switch fixed-pitch on and off.

1 Like

Bold, italics, and colours should work in the Z-Machine’s upper window, but I don’t know if Dialog lets you control that.

1 Like

yeah, tried the above and it didn’t work. and, yes, you can use bold (at least) in the z-machine status line (it can be done with inform, anyway). i guess this just isn’t possible in dialog.

1 Like

Yeah, tested and confirmed. Odd! There’s no reason I know of it shouldn’t be possible. (Though I can’t make heads or tails of the compiler source…)