To manage the line skips which space paragraphs out, and to handle the printing of pieces of text and numbers.


§1. Prompt. This is the text printed just before we wait for the player's command: it prompts him to type.

[ PrintPrompt i;
    ShowRTP();
    ClearRTP();
    style roman;
    EnsureBreakBeforePrompt();
    TEXT_TY_Say(CommandPromptText());
    ClearBoxedText();
    ClearParagraphing(14);
];

§2. Boxed Quotations. These appear once only, and happen outside of the paragraphing scheme: they are normally overlaid as windows on top of the regular text. We can request one at any time, but it will appear only at prompt time, when the screen is fairly well guaranteed not to be scrolling. (Only fairly well since it's just possible that {\it Border Zone}-like tricks with real-time play might be going on, but whatever happens, there is at least a human-appreciable pause in which the quotation can be read before being taken away again.)

Global pending_boxed_quotation; a routine to overlay the quotation on screen

[ DisplayBoxedQuotation Q;
    pending_boxed_quotation = Q;
];

[ ClearBoxedText i;
    if (pending_boxed_quotation) {
        ClearParagraphing(15);
        pending_boxed_quotation();
        ClearParagraphing(16);
        pending_boxed_quotation = 0;
    }
];

§3. Score Notification. This doesn't really deserve to be at I6 level at all, but since we want a fancy text style for Glulx, ...

[ NotifyTheScore d;
    if ((WorldModelKit`SCORING_CFGV) && (notify_mode == 1)) {
        DivideParagraphPoint();
        VM_Style(NOTE_VMSTY);
        d = score-last_score;
        if (d > 0) { ANNOUNCE_SCORE_RM('D', d); }
        else if (d < 0) { ANNOUNCE_SCORE_RM('E', -d); }
        new_line;
        VM_Style(NORMAL_VMSTY);
    }
];

§4. Print Rank. The table of scoring ranks is a residue from the ancient times of early IF: it gets a tiny amount of special treatment here, even though I7 works tend not to use these now dated conventions.

[ PrintRank i j v;
    if (WorldModelKit`RANKING_TABLE_GIVEN) {
        ANNOUNCE_SCORE_RM('B');
        j = TableRows(RANKING_TABLE);
        for (i=j:i>=1:i--)
            if (score >= TableLookUpEntry(RANKING_TABLE, 1, i)) {
                v = TableLookUpEntry(RANKING_TABLE, 2, i);
                TEXT_TY_Say(v);
                ".";
            }
    }
    ".";
];

§5. Status Line. The default status line rule is a little bit more efficient than the table-based system from Basic Inform.

[ DEFAULT_STATUS_LINE_R width posb;
    VM_StatusLineHeight(1);
    VM_MoveCursorInStatusLine(1, 1);
    if (statuswin_current) {
        width = VM_ScreenWidth();
        posb = width - 15;
        spaces width;
        ClearParagraphing(17);
        VM_MoveCursorInStatusLine(1, 2);
        TEXT_TY_Say(left_hand_status_line);
        VM_MoveCursorInStatusLine(1, posb);
        TEXT_TY_Say(right_hand_status_line);
        VM_MoveCursorInStatusLine(1, 1);
    }
    rtrue;
];

§6. Status Line Utilities. Two convenient routines for the default values of right_hand_status_line and left_hand_status_line respectively. SL_Location also implements the text substitution "[player's surroundings]".

Array T_SL_Score_Moves --> CONSTANT_PACKED_TEXT_STORAGE SL_Score_Moves;

[ SL_Score_Moves;
    if (not_yet_in_play) return;
    if (WorldModelKit`SCORING_CFGV)
        print sline1, "/", sline2;
];

Array T_SL_Location --> CONSTANT_PACKED_TEXT_STORAGE SL_Location;

[ SL_Location even_before;
    if ((not_yet_in_play) && (even_before == false)) return;
    if (location == thedark) {
        BeginActivity(PRINTING_NAME_OF_DARK_ROOM_ACT);
        if (ForActivity(PRINTING_NAME_OF_DARK_ROOM_ACT) == false)
            DARKNESS_NAME_INTERNAL_RM('A');
        EndActivity(PRINTING_NAME_OF_DARK_ROOM_ACT);
    } else {
        FindVisibilityLevels();
        if (visibility_ceiling == location) print (name) location;
        else print (The) visibility_ceiling;
    }
];

[ DARKNESS_NAME_INTERNAL_R; ];

§7. Player's name.

+replacing(from BasicInformKit) [ PRINT_PROTAGONIST_INTERNAL_R;
    if (indef_mode == NULL && caps_mode) PRINT_PROTAGONIST_INTERNAL_RM('A');
    else PRINT_PROTAGONIST_INTERNAL_RM('B');
];

§8. Banner. Note that Inform always compiles Story and Headline texts, but does not always compile a Story_Author.

[ Banner i serial;
   BeginActivity(PRINTING_BANNER_TEXT_ACT);
   if (ForActivity(PRINTING_BANNER_TEXT_ACT) == false) {
        VM_Style(HEADER_VMSTY);
        TEXT_TY_Say(Story);
        VM_Style(NORMAL_VMSTY);
        new_line;
        TEXT_TY_Say(Headline);
        if (WorldModelKit`STORY_AUTHOR_GIVEN) {
            print " ", (address) BY__WD, " ";
            TEXT_TY_Say(Story_Author);
        }
        new_line;
        print "Release ", VM_ReleaseNumber(), " / Serial number ";
        serial = VM_SerialNumber();
        for (i=0 : i<6 : i++) print (char) serial->i;
        print " / Inform 7 v", (PrintI6Text) I7_VERSION_NUMBER;
        #Ifdef DEBUG;
        print " / D";
        #Endif; DEBUG
        new_line;
    }
    EndActivity(PRINTING_BANNER_TEXT_ACT);
];

§9. Standard Response Issuing Rule. To print a response, we trigger off the response issuing activity. The following is the default "for" rule for that activity:

[ STANDARD_RESPONSE_ISSUING_R;
    RegardingSingleObject();
    TEXT_TY_Say(ResponseTexts-->(parameter_value - 1));
];