Hyperlink Interface

version 9/140814 by Leonardo Boselli

  • Home page
  • Beginning
  • Previous
  • Next



  • Chapter - Changing Style
    Understand the command "hyperlinks" as something new.
    Setting the hyperlink emphasis is an action out of world applying to nothing. Understand "hyperlinks" as setting the hyperlink emphasis.

    tempstyles is a list of hyperlink emphases that varies.
    Carry out setting the hyperlink emphasis (this is the Hyperlink Interface carry out setting hyperlink emphasis rule):
        carry out the setup hyperlink emphasis activity;
    Setup hyperlink emphasis is an activity.
    Rule for setup hyperlink emphasis (this is the setup hyperlink emphasis rule):
        let mychar be 1;
        [Keep track of which menu number is assigned to each of the four possible options.]
        let object-number be 0;
        let direction-number be 0;
        let topic-number be 0;
        let parser-number be 0;
        while mychar is not 0:
            clear the screen;
            let menu-counter be 0;
            say "[story title] makes use of [emphasiz]ed hyperlinks. It is [if hyperlinks required is true]necessary[else]recommended[end if] that your interpreter program correctly displays them with some form of emphasis. Type a number below to cycle through display options until you find one that shows clearly on your system." (A);
            say line break;
            if object hyperlink highlighting is true:
                increase menu-counter by 1;
                say "[menu-counter]) ";
                now object-number is menu-counter;
                say "[Emphasiz]ed [o]object[x] hyperlinks currently look like [o]this[x]." (B);
            if direction hyperlink highlighting is true:
                increase menu-counter by 1;
                say "[menu-counter]) ";
                now direction-number is menu-counter;
                say "[Emphasiz]ed [d]exit[x] hyperlinks currently look like [d]this[x]." (C);
            if topic hyperlink highlighting is true:
                increase menu-counter by 1;
                say "[menu-counter]) ";
                now topic-number is menu-counter;
                say "[Emphasiz]ed [t]topic[x] hyperlinks currently look like [t]this[x]." (D);
            if parser highlighting is true:
                say line break;
                increase menu-counter by 1;
                say "[menu-counter]) ";
                now parser-number is menu-counter;
                say "[as the parser]Messages from the parser currently display like this[as normal]." (E);
            [Print a warning if emphasis is disabled in a game where hyperlinks are required; note that the player is still allowed to disable emphasis, if they choose.]
            if hyperlinks required is true:
                if ( object hyperlink highlighting is true and style of object-word is hyperlink-no-style ) or ( direction hyperlink highlighting is true and style of direction-word is hyperlink-no-style ) or ( topic hyperlink highlighting is true and style of topic-word is hyperlink-no-style ) :
                    say "[line break]**A warning: The [emphasiz]ed hyperlinks are integral to [story title]'s design. It may be difficult or impossible to know how to continue if emphasis is not visible.**" (F);
            [Print a warning if any two active hyperlink styles are the same.]
            truncate tempstyles to 0 entries;
            let duplicated-style be false;
            if object hyperlink highlighting is true:
                add style of object-word to tempstyles;
            if direction hyperlink highlighting is true:
                if style of direction-word is listed in tempstyles:
                    now duplicated-style is true;
                else:
                    add style of direction-word to tempstyles;
            if topic hyperlink highlighting is true:
                if style of topic-word is listed in tempstyles:
                    now duplicated-style is true;
            if duplicated-style is true:
                say "[line break]**A warning: it may be useful to distinguish one type of hyperlink from another.**" (G);
            [Show instruction message and get the player's single-character input.]
            say "[paragraph break]Press 0 when you're finished here, or 9 to [if screen reader mode is true]de[end if]activate screen reader mode.[run paragraph on]" (H);
            now mychar is single-character - 48; [Converts ASCII to actual number typed.]
            [Process the player's input.]
            if mychar is object-number:
                advance style with object-word;
            otherwise if mychar is direction-number:
                advance style with direction-word;
            otherwise if mychar is topic-number:
                advance style with topic-word;
            otherwise if mychar is parser-number:
                advance style with parser-word;
            otherwise if mychar is 9:
                clear the screen;
                try setting screen reader mode;
                say "Press any key to continue." (I);
                wait for any key;
                now mychar is 0;
        [Upon quitting, clear the screen and look.]
        clear the screen;
        if pre-game hyperlink setting is true:
            now pre-game hyperlink setting is false;
            do nothing;
        otherwise:
            try looking.
        
    To advance style with (kwtype - a hyperlink type):
        now the style of kwtype is the hyperlink emphasis after the style of kwtype.
    To decide which number is single-character: (- (VM_KeyChar()) -).