# # Patch name: horizontal # Patch version: 1 # Author's name: Naomi Novik # Author's email: tf2005@aptlabta.wpi.edu # Version of PennMUSH: 1.6.10p0 # Date patch made: Wed Jan 29 16:12:23 EST 1997 # Author is willing to support (yes/no): no # Patch format: diff -c # # # This is a contributed PennMUSH patch. Its use is subject to the # same restrictions found in PennMUSH's hdrs/copyrite.h file. # # No warranty is given for this patch. It is not necessarily going # to work on your system, with any version of PennMUSH other than # the one above, etc. # # If the author given above was willing to support the patch, you # should write to the author if you have any questions or problems. Do # *NOT* send email messages to Javelin or any PennMUSH mailing list about # this patch! # # Below this line is the author's description of the patch, # followed by the patch itself. If the patch is in context diff # format, you'll probably apply it by typing: patch < patchfile # in your top-level MUSH directory, unless instructed otherwise # below. # # This patch adds the option for HORIZONTAL_ROOM_CONTENTS to dune.h. IIf # defined, this option automatically displays the contents of a room # in horizontal format (i.e., names are separated by spaces instead of # all on one line) if there are more than x objects in the room. You # can specify x by setting the option HORIZONTAL_ROOM_LIMIT to whatever # number you wish. It also adds the HORIZONTAL flag, which you can set # on a room to have it display contents horizontally whether there are # more than the specified number of objects or not. # # Naomi *** dune.h.dist 1997/01/29 20:52:35 1.1 --- dune.h.dist 1997/01/29 20:55:58 *************** *** 350,355 **** --- 358,376 ---- * Code by Nick Gammon (but his leading two spaces have been removed) */ /* #define COMMA_EXIT_LIST */ + + /* If defined, the contents of a room (both players and objects) will + * be displayed in horizontal format if the number of things in a room + * exceeds the HORIZONTAL_ROOM_LIMIT. If you do not define the LIMIT, + * the default value is 10 objects. To have contents always displayed + * horizontally, set LIMIT to 1. + * + * Also enables the HORIZONTAL flag for rooms. A room set HORIZONTAL + * will always display its contents horizontally, whether there are + * enough objects to exceed the limit or not. + */ + /* #define HORIZONTAL_ROOM_CONTENTS /* */ + /* #define HORIZONTAL_ROOM_LIMIT 10 /* */ /* If defined, the count of players on the WHO list will include * Dark/Hidden players not visible on the list *** hdrs/flags.h 1997/01/29 20:46:27 1.1 --- hdrs/flags.h 1997/01/29 19:47:26 *************** *** 161,166 **** --- 161,169 ---- #define ROOM_UNINSPECT 0x1000 /* Not inspected */ #endif + #ifdef HORIZONTAL_ROOM_CONTENTS + #define ROOM_HORIZONTAL 0x80000000 /* Display contents horizontally */ + #endif /*-------------------------------------------------------------------------- * Exit flags *** src/flags.c 1997/01/29 20:46:27 1.1 --- src/flags.c 1997/01/29 20:30:09 *************** *** 166,171 **** --- 166,174 ---- #ifdef UNINSPECTED_FLAG {"UNINSPECTED", 'u', TYPE_ROOM, ROOM_UNINSPECT, F_ROYAL, F_ROYAL}, #endif + #ifdef HORIZONTAL_ROOM_CONTENTS + {"HORIZONTAL", 'h', TYPE_ROOM, ROOM_HORIZONTAL, F_ANY, F_ANY}, + #endif {"CLOUDY", 'x', TYPE_EXIT, EXIT_CLOUDY, F_ANY, F_ANY}, *************** *** 437,443 **** {"UNIN", "UNINSPECTED"}, {"UNI", "UNINSPECTED"}, #endif ! {NULL, NULL} }; --- 440,451 ---- {"UNIN", "UNINSPECTED"}, {"UNI", "UNINSPECTED"}, #endif ! #ifdef HORIZONTAL_ROOM_CONTENTS ! {"HORIZONT", "HORIZONTAL"}, ! {"HORIZON", "HORIZONTAL"}, ! {"HORIZ", "HORIZONTAL"}, ! {"HOR", "HORIZONTAL"}, ! #endif {NULL, NULL} }; *** src/look.c 1997/01/29 20:46:27 1..1 --- src/look.c 1997/01/29 20:49:10 *************** *** 169,174 **** --- 169,182 ---- { dbref thing; dbref can_see_loc; + #ifdef HORIZONTAL_ROOM_CONTENTS + int limit = 10; /* default value at which we go to horizontal list */ + int total_contents = 0; + char tbuf[BUFFER_LEN]; + char nbuf[BUFFER_LEN]; + char *tbuf_ptr; + char *nbuf_ptr; + #endif /* check to see if he can see the location */ /* * patched so that player can't see in dark rooms even if owned by that *************** *** 180,194 **** --- 188,235 ---- DOLIST(thing, db[loc].contents) { if (can_see(player, thing, can_see_loc)) { /* something exists! show him everything */ + #ifdef HORIZONTAL_ROOM_CONTENTS + tbuf_ptr = tbuf; + #ifdef HORIZONTAL_ROOM_LIMIT + /* Let the user configure the limit of contents */ + limit = HORIZONTAL_ROOM_LIMIT; + #endif /* LIMIT */ + /* count how many things are present in the room */ + total_contents++; + } + } + /* have we exceeded the limit? */ + /* or is the room set HORIZONTAL? */ + if ( (total_contents > limit) || IS(loc,TYPE_ROOM,ROOM_HORIZONTAL) ) { + /* display them horizontally */ + notify(player, contents_name); + DOLIST(thing, db[loc].contents) { + if (can_see(player, thing, can_see_loc)) { + strcpy(nbuf, unparse_object(player,thing)); + if ((nbuf_ptr = strchr(nbuf, ';'))) { + *nbuf_ptr = '\0'; + } + safe_str(nbuf, tbuf, &tbuf_ptr); + safe_str(" ", tbuf, &tbuf_ptr); + } + } + *tbuf_ptr = '\0'; + notify(player, tbuf); + } else { + #endif /* HORIZONTAL_ROOM_CONTENTS */ notify(player, contents_name); DOLIST(thing, db[loc].contents) { if (can_see(player, thing, can_see_loc)) { notify(player, unparse_object(player, thing)); } } + #ifdef HORIZONTAL_ROOM_CONTENTS + } + #else break; /* we're done */ } } + #endif } static int *** game/txt/hlp/pennflag.hlp 1997/01/29 20:46:27 1.1 --- game/txt/hlp/pennflag.hlp 1997/01/29 21:04:23 *************** *** 30,36 **** a - Audible b - Debug c - Connected, Cloudy d - Destroy_Ok e - Enter_Ok f - Force_White ! g - Gagged h - Halt j - Jury_Ok l - Light m - Myopic n - No_Command o - On-Vacation p - Puppet r - Royalty s - Suspect t - Transparent u - Uninspected --- 30,36 ---- a - Audible b - Debug c - Connected, Cloudy d - Destroy_Ok e - Enter_Ok f - Force_White ! g - Gagged h - Halt, Horizontal j - Jury_Ok l - Light m - Myopic n - No_Command o - On-Vacation p - Puppet r - Royalty s - Suspect t - Transparent u - Uninspected *************** *** 155,160 **** --- 155,178 ---- This flag may be used by the MUSH to indicate rooms which have not been inspected by the Building Council, Administration, etc. + & HORIZONTAL + Flag: HORIZONTAL (rooms) + + If your MUSH allows room content lists to be displayed horizontally, + this flag will be available. It forces a room's contents to be displayed + in horizontal format whether or not there are more than 10 objects + in the room. + + For example: + Without the flag: + Contents: + Nightbird + Puppet + Car + + With the flag: + Contents: + Nightbird Puppet Car & COLOR Flag: COLOR (players)