Re: [CODE] Max Window Size

From: Gary Barnett (gbarnett@POLARNET.COM)
Date: 04/14/98

-----Original Message-----
From: Ben Britton <ben@SW2.K12.WY.US>
To: <>
Date: Monday, April 13, 1998 9:50 PM
Subject:  [CODE] Max Window Size

>Greetings, Ive looked into this project for awhile, but I guess the books I
>have don't cover this:
>Where does Circlemud define the writable window size?  I've looked all
>through comm.c and telnet.h just defines the max size at 31 lines.  But how
>would i define  the writable size to like 28, so i can add a bar to the
>bottom of the screen that displays your hit, mana, etc without cluttering
>the screen everytime your screen moves.
The quick answer is that cirlce doesn't. The only area of the mud with the
concept of a page is page_string, IIRC.

Probably be best to ask the user how many lines they have.

I wrote a little routine that will determine the number of lines by spamming
the player and asking for them to read off the top number on their monitor
.. it follows.

Once you have the height stored in a handy variable then you can update
page_string to use it and your cursor positioning code to put the prompt in
the right spot.

For developing your cursor positioning code, get your hands upon a bunch of
different mud clients so you can enjoy the fun and misery of finding a set
of options that works for everyone. I'd recommend skipping the following

1) remembering cursor position / restoring cursor position
2) clear to end of screen
3) clear to end of line
4) function key support

I've found that goto position and up/down/left/right seem to work fairly
well. Watch writing on the 80th column, especially on the last line of the
display, even if it's suppposed to be protected by the non-scrolling area.

zMUD has the peculiar problem of blanking out the entire screen and
appearing to freeze if you try to paint outside the window or do anything
else outside it's strict expectations, when using a non-scrolling area.
Turning off the non-scroll area and clearing the screen will wake it up

For the windows environment, QVT Term seems to do the emulation correctly,
at least in my testing with the relevant RFC's in hand.


ACMD(do_screenlen) {
   /* determine users's screen length by putting them in a
      con state, clearing the screen and printing 100
   numbered lines 1-100, then asking them what number is at
   the top of their display.

 int x;

 if (IS_NPC(ch) || IS_MOB(ch) ) {
  send_to_char("Mobs don't have a screen length.\r\n",ch);

 strcpy(buf, "\033[2J 1\r\n");

 for (x=2;x<100;x++) {
  sprintf(buf2, " %d\r\n", x);
  strcat(buf, buf2);
 strcat(buf, "Enter the number that appears on the top line of your
monitor. ->");
 send_to_char(buf, ch);

and in nanny:

   /* take input and set length if valid */
   if (*arg && is_number(arg)) {
   if ( (x>0) && (x < 92) ) {
   (d->character)->player_specials->screen_len = 100 - x;
      sprintf(buf, "Your screen length is now: %d.\r\n"
       "Note that you will need to re-run the screenlen command if you
       "the size of your mud client's window, or change the font or other
       "that affect the height of the lines your client displays.\r\n",
   SEND_TO_Q(buf, d);
      SEND_TO_Q("Screen length not changed.\r\n", d);

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

This archive was generated by hypermail 2b30 : 12/15/00 PST