! "BannerPause.inf" Library extension for Inform 6.21 Library 6/10
!
! Implemented by Jay Goemmer (
[email protected]), 16 Dec 2002.
!
!
! This source code will enable the Inform implementor to "pause" the
! accompanying "Banner2" routine before displaying a game's initial
! location and drawing the status line. It's been hacked from the
! "Banner" routine in the original "Parserm.h" Inform library file.
!
! Please send any comments or suggestions you may have to the
! address above. Thanks!
Serial "021216";
Release 1;
Constant Story "BANNER PAUSE";
Constant Headline "^^An Inform Source Code Example
^Implemented by Jay Goemmer (downbelow@@64ltlink.com)
^^^";
! See "BannerPause" routine. Insert this line in your .inf source
! code file before including "Parser.h"
Constant BANNER_PAUSE;
Include "Parser";
Object LibraryMessages ! Include between Parser and VerbLib
with
before
[; Prompt: print "^> "; rtrue;
];
Include "Verblib";
! Banner2 routine -- Hacked from "Verblibm.h" (Library 6/10).
!
! Insert after "Verblib.h" and before "Grammar.h"
[ Banner2 i;
if (Story ~= 0)
{
#IFV5; style bold; #ENDIF;
print (string) Story;
#IFV5; style roman; #ENDIF;
}
if (Headline ~= 0)
print (string) Headline;
print "Release ", (0-->1) & $03ff, " / Serial number ";
for (i=18:i<24:i++) print (char) 0->i;
print " / Inform v"; inversion;
print " Library ", (string) LibRelease, " ";
#ifdef STRICT_MODE;
print "S";
#endif;
#ifdef INFIX;
print "X";
#ifnot;
#ifdef DEBUG;
print "D";
#endif;
#endif;
new_line;
new_line; ! Added 2 more lines -- one here...
#ifdef BANNER_PAUSE; ! Making Banner pause before 'Looking At Opening Room.'
BannerPause();
#endif;
new_line; ! ...and one here, so it looks better -- 14 Dec 2002.
];
Object Opening_Room "Opening Room"
with
description "^ The opening room's description is displayed first, and
then the status line is printed. That's pretty much all there is to
this programming example, so you may ~quit~ at any time.",
has light;
[ Initialise;
Location = Opening_Room;
print "^^ Usually, the best storytellers don't tell you the end
of the story first. They'll wait to reveal certain details until
the point in the story which will have the greatest dramatic
impact.
^^ Interactive fiction implementors are no exception. This
~BannerPause~ programming example will allow you to place a ~MORE~
prompt after printing the Inform ~Banner~ routine -- and delay
the initial appearance of the game's opening location.
^^ If you have any comments, please e-mail me at the address
below. Thanks!
^^^";
Banner2(); ! "Calls" modified "Banner" routine above.
return 2; ! Prevents "standard" Inform banner from printing.
];
Include "Grammar";
! Insert the following "BannerPause" routine in your .inf source
! code file after including "Grammar.h"
! Pauses Banner2 before "looking at" opening room.
[ BannerPause i; ! "ClearScreen" routine minus "erase window" command.
style roman; ! (Doesn't "wipe" upper and lower windows.)
print "^[MORE]";
do { @read_char 1 0 0 i; } until (i==32 or 10 or 13);
print "^";
];
Verb meta "help" "hint" "hints" "menu" "menus" "about" "thanks" "credits"
* -> Help;
[ HelpSub;
print "^ Obviously, the best way to use this programming example is to paste
it into the existing source code for the game to which you'd like to add this
~BANNER PAUSE~ option.";
style bold;
print "^^ Special thanks to Andrew ~Zarf~ Plotkin for pointing out, ~If you
want the banner message to contain extra newlines, hack the library Banner
routine. I mean, once you've decided to mess with library code...~
^^(rec.arts.int-fiction, 27 Jan 2003)";
style roman;
print "^^^ Intriguing, since that was the first Inform library hack I'd done
-- just six weeks before. (chuckling)
^^";
];
End;