Hyperlink Interface

version 9/140814 by Leonardo Boselli

  • Home page
  • Beginning
  • Previous
  • Next



  • SECTION hyperlink command prompt
    This is the set hyperlink command prompt rule:
        let count of exits be the number of viable directions;
        now the command prompt is "[o]Look[x] | [o]Inventory[x] | [o]Menu[x] | [o]Exits[x][line break][line break]>>" (A);
        
        [MAIN LINE <----------------------------------------------------------------------------------------------------]
    To set off echo line event:
        (- if(glk_gestalt(gestalt_LineInputEcho, 0)) glk_set_echo_line_event(gg_mainwin,0); -)
        
    After reading a command:
        if hyperlink clicked is false:
            if the result of gestalt of LineInputEcho is not 0:
                say "[the player's command]";
        otherwise:
            now hyperlink clicked is false;
    To decide which number is the result of gestalt of LineInputEcho:
        (- glk_gestalt(gestalt_LineInputEcho, 0) -)
    Before printing a parser error:
        say "[line break]";
    HI capturing is a truth state that varies. Hi capturing is usually false.
    To start HI hyperlink capture:
        now HI capturing is true;
        start capturing text;
    To end HI hyperlink capture:
        if HI capturing is true:
            stop capturing text;
            now HI capturing is false;
            let cap-text be "[captured text]";
            increment HI-hyperlinks-counter;
            if HI-hyperlinks-counter is greater than HI-max-hyperlinks:
                now HI-hyperlinks-counter is HI-min-hyperlinks;
            say "[set link HI-hyperlinks-counter][cap-text][end link]";
            choose row ( HI-hyperlinks-counter ) in the Table of Hyperlink Commands;
            now replacement entry is "[cap-text]";
    Hyperlink clicked is initially false.
    The default command replacement by hyperlinks rule is not listed in any rulebook.
    A clicking hyperlink rule (this is the alternative command replacement by hyperlinks rule):
        Now hyperlink clicked is true;
        if current link number is greater than HI-max-hyperlinks:
            now glulx replacement command is "";
            rule succeeds;
        choose row ( current link number ) in the Table of Hyperlink Commands;
        now the glulx replacement command is replacement entry;