17.21. Constructing the status line

| Chapter 17: Activities |

| 17.21. Constructing the status line

1. When it happens. Just before input is accepted from the keyboard, Inform constructs a "status line" at the top of the window which is normally displayed in reverse colours (white on black instead of black on white, say).

2. The default behaviour. Makes the status line up out of two pieces, the "left hand status line" and the "right hand status line". Since these can freely be changed, note that the status line is already very customisable without using rules applied to this activity.

3. Examples. (a) The most useful thing about this activity is that it allows us to vary descriptions in the status line. This is especially helpful to abbreviate unduly long room names, which might not otherwise fit:

> The Temple Of A Thousand Mightily Peeved Deities is a room. Rule for printing the name of the Temple while constructing the status line: say "Temple".

(b) Again, it's usually not necessary to apply activity rules to this, but occasionally amusing effects are possible if we do:

> The blindfold is wearable and carried. Rule for constructing the status line while the blindfold is worn: do nothing.

336
| Example Ways Out A status line that lists the available exits from the current location. |
RB

> A not-uncommon device in games with large maps is a list of available exits printed in the status bar. We might do this so: "Ways Out" When play begins: now left hand status line is "Exits: [exit list]"; now right hand status line is "[location]". To say exit list: let place be location; repeat with way running through directions: let place be the room way from the location; if place is a room, say " [way]". We may find that printing out full directions makes the status line unpleasantly crowded. Fortunately, it isn't hard to provide a set of abbreviations to use in this context: Rule for printing the name of a direction (called the way) while constructing the status line: choose row with a heading of the way in the Table of Abbreviation; say "[shortcut entry]". Table of Abbreviation
> heading | shortcut
> north | "N"
> northeast | "NE"
> northwest | "NW"
> east | "E"
> southeast | "SE"
> south | "S"
> southwest | "SW"
> west | "W"
> up | "U"
> down | "D"
> inside | "IN"
> outside | "OUT"
Dome is a room. North of Dome is North Chapel. South of the Dome is South Chapel. West of the Dome is Western End. Quiet Corner is northwest of the Dome, north of Western End, and west of North Chapel. Loud Corner is east of North Chapel, northeast of Dome, and north of Eastern End. Eastern End is north of Dim Corner and east of Dome. Dim Corner is southeast of Dome and east of South Chapel. Ruined Corner is southwest of Dome, west of South Chapel, and south of Western End. The church door is east of Eastern End and west of the Courtyard. The church door is a door. Test me with "w / n / e / e / s / e". Everywhere else, the names of directions will still be printed out in full in the usual way.

337
| Example Guided Tour A status line that lists the available exits from the current location, changing the names of these exits depending on whether the room has been visited or not. |
RB

Previous | Contents | Next