Newsgroups: rec.arts.int-fiction
Path: nntp.gmd.de!Germany.EU.net!EU.net!uunet!zib-berlin.de!news.belwue.de!news.informatik.uni-stuttgart.de!baumann
From: baumann@hermes.informatik.uni-stuttgart.de (Joachim Baumann)
Subject: Inform: A new statusline
Message-ID: <BAUMANN.94Nov21110404@chronos.informatik.uni-stuttgart.de>
Sender: news@informatik.uni-stuttgart.de
Organization: IPVR, University of Stuttgart, Germany
Date: Mon, 21 Nov 1994 10:04:04 GMT
Lines: 74

As I promised to all of you, I post my statusline code... Not that anyone
wanted it or even showed remote interest, but that's just as well. :-)
Here it comes:

!Replace DrawStatusLine;

#IFV5;

! The following constants describe the positions of the different parts
! of the windrose
Constant U_POS 28;
Constant W_POS 30;
Constant C_POS 31;
Constant E_POS 32;
Constant IN_POS 34;

[ DrawStatusLine i;
	! switch to status window and reverse it
	@split_window 3; @set_window 1;	style reverse;
	@set_cursor 1 1; spaces (0->33)-1;
	@set_cursor 2 1; spaces (0->33)-1;
	@set_cursor 3 1; spaces (0->33)-1;
	
	! now the original DrawStatusLine routine
	@set_cursor 1 2;  PrintShortName(location);
	if ((0->1)&2 == 0)
	{   
		@set_cursor 1 51; print "Score: ", sline1;
		@set_cursor 1 64; print "Moves: ", sline2;
	}
	else
	{   
		@set_cursor 1 51; print "Time: ";
		i=sline1%12; if (i<10) print " ";
		if (i==0) i=12;
		print i, ":";
		if (sline2<10) print "0";
		print sline2;
		if ((sline1/12) > 0) print " pm"; else print " am";
	}

	! and now print the directions of the location (if not dark)
	! THIS IS THE INTERESTING PART (for me at least)
	if(location ~= thedark)
	{
		! first line
		if(location.u_to ~= 0)	{ @set_cursor 1 U_POS; print "U"; }
		if(location.nw_to ~= 0)	{ @set_cursor 1 W_POS; print "@@92"; }
		if(location.n_to ~= 0)	{ @set_cursor 1 C_POS; print "|"; }
		if(location.ne_to ~= 0)	{ @set_cursor 1 E_POS; print "/"; }
		if(location.in_to ~= 0)	{ @set_cursor 1 IN_POS; print "I"; }
		! second line
		if(location.w_to ~= 0)	{ @set_cursor 2 W_POS; print "-"; }
								  @set_cursor 2 C_POS; print "o";
		if(location.e_to ~= 0)	{ @set_cursor 2 E_POS; print "-"; }
		! third line
		if(location.d_to ~= 0)	{ @set_cursor 3 U_POS; print "D"; }
		if(location.sw_to ~= 0)	{ @set_cursor 3 W_POS; print "/"; }
		if(location.s_to ~= 0)	{ @set_cursor 3 C_POS; print "|"; }
		if(location.se_to ~= 0)	{ @set_cursor 3 E_POS; print "@@92"; }
		if(location.out_to ~= 0){ @set_cursor 3 IN_POS; print "O"; }
	}

	@set_cursor 1 1; style roman; @set_window 0;	! switch to main window 
];
#ENDIF;

_______________________________________________________________________________
Snail:   Joachim Baumann,               |
         Universitaet Stuttgart, IPVR,  | Phone:   (+49 | 0 ) 711/7816-218
         Breitwiesenstr. 20-22,         | Fax:     (+49 | 0 ) 711/7816-424
         70565 Stuttgart, Germany       |
EMail:   joachim.baumann@informatik.uni-stuttgart.de(.sol_3.milky-way.universe)
PGP:     finger baumann@orgel.informatik.uni-stuttgart.de
