Inform - Support - Source

Back to List

Inventory
Complete

Backward
Forward

Plain
Coloured
Gaudy

This code
in plain text

Browsing verblibm.h

DoMenu (lines 600-686)

0600  #ENDIF;
0601   
0602  #IFV5;
0603  [ DoMenu menu_choices EntryR ChoiceR
0604           lines main_title main_wid cl i j oldcl pkey;
0605   
0606    if (pretty_flag==0)
0607        return LowKey_Menu(menu_choices,EntryR,ChoiceR);
0608   
0609    menu_nesting++;
0610    menu_item=0;
0611    lines=indirect(EntryR);
0612    main_title=item_name; main_wid=item_width;
0613    cl=7;
0614   
0615    .ReDisplay;
0616        oldcl=0;
0617        @erase_window $ffff;
0618        i=lines+7;
0619        @split_window i;
0620        i = 0->33;
0621        if (i==0) i=80;
0622        @set_window 1;
0623        @set_cursor 1 1;
0624        style reverse;
0625        spaces(i); j=i/2-main_wid;
0626        @set_cursor 1 j;
0627        print (string) main_title;
0628        @set_cursor 2 1; spaces(i);
0629        @set_cursor 2 2; print (string) NKEY__TX;
0630        j=i-12; @set_cursor 2 j; print (string) PKEY__TX;
0631        @set_cursor 3 1; spaces(i);
0632        @set_cursor 3 2; print (string) RKEY__TX;
0633        j=i-17; @set_cursor 3 j;
0634        if (menu_nesting==1) print (string) QKEY1__TX;
0635                        else print (string) QKEY2__TX;
0636        style roman;
0637        @set_cursor 5 2; font off;
0638   
0639        if (menu_choices ofclass String) print (string) menu_choices;
0640        else menu_choices.call();
0641   
0642        for (::)
0643        {   if (cl ~= oldcl)
0644            {   if (oldcl>0) { @set_cursor oldcl 4; print " "; }
0645                @set_cursor cl 4; print ">";
0646            }
0647            oldcl=cl;
0648            @read_char 1 -> pkey;
0649            if (pkey==NKEY1__KY or NKEY2__KY or 130)
0650            {   cl++; if (cl==7+lines) cl=7; continue;
0651            }
0652            if (pkey==PKEY1__KY or PKEY2__KY or 129)
0653            {   cl--; if (cl==6)  cl=6+lines; continue;
0654            }
0655            if (pkey==QKEY1__KY or QKEY2__KY or 27 or 131) break;
0656            if (pkey==10 or 13 or 132)
0657            {   @set_window 0; font on;
0658                new_line; new_line; new_line;
0659      
0660                menu_item=cl-6;
0661                EntryR.call();
0662      
0663                @erase_window $ffff;
0664                @split_window 1;
0665                i = 0->33; if (i==0) { i=80; }
0666                @set_window 1; @set_cursor 1 1; style reverse; spaces(i);
0667                j=i/2-item_width;
0668                @set_cursor 1 j;
0669                print (string) item_name;
0670                style roman; @set_window 0; new_line;
0671      
0672                i = ChoiceR.call();
0673                if (i==2) jump ReDisplay;
0674                if (i==3) break;
0675      
0676                L__M(##Miscellany, 53);
0677                @read_char 1 -> pkey; jump ReDisplay;
0678            }
0679        }
0680   
0681        menu_nesting--; if (menu_nesting>0) rfalse;
0682        font on; @set_cursor 1 1;
0683        @erase_window $ffff; @set_window 0;
0684        new_line; new_line; new_line;
0685        if (deadflag==0) <<Look>>;
0686  ];  


Last updated 27 February 2004. This site is no longer supported; information may be out of date.
Maintained as a historical archive by the Interactive Fiction Technology Foundation. Copyright 1993-2018 IFTF, CC-BY-SA unless otherwise noted.
This page was originally managed by Graham Nelson (graham@gnelson.demon.co.uk) assisted by C Knight.