Rewrite the Command Line

version 2 by Ron Newcomb

  • Home page
  • Complete text



  • Version 2 of Rewrite the Command Line (for Glulx only) by Ron Newcomb begins here.

    "Allows us to erase then rewrite the commands our player types in."

    A Glulx command line echo mode is a kind of value. The Glulx command line echo modes are echoed by the story, echoed by the library, and always echoed per the interpreter.

    To decide which Glulx command line echo mode is the command line echo mode: (- echo_mode -).
    To change the/-- command line echo mode to (tr - a Glulx command line echo mode): (- set_line_echo({tr}); -).

    Include (- Global echo_mode = (+ echoed by the library +); -) after "Definitions.i6t".
    Include (-
    [ set_line_echo val;
        if (~~(glk($0004, 17, 0))) { ! gestalt(gestalt_LineInputEcho)
            echo_mode = (+ always echoed per the interpreter +);
            return; ! interpreter needs Glk version 0.7.1 or later
        }
        if (val == (+ always echoed per the interpreter +))
            val = (+ echoed by the library +);
        echo_mode = val;
        glk($0150, gg_mainwin, echo_mode - 1); ! glk_set_echo_line_event
    ];-).

    First when play begins (this is the initialize command line echo mode rule): change the command line echo mode to echoed by the story.

    To say input type: (- glk_set_style(style_Input); -).

    To decide if input type differs from roman type: (- (glk_style_distinguish(gg_mainwin, style_Normal, style_Input)) -).

    Rewrite the Command Line ends here.