@program #121 1 1000 d i ( Customizable unparseobj for GlowMuck 1.9.2. Syvel @ FurryFaire -- Feb 12, 1998 -- Alynna waz here [edited this shit for PROTO] on June 17 2001 Subs are as follows, based on this object: Syvel[#2P/CBMT/W4] %n Name of Object. 'Syvel' %d DBref of Object. '#2' %o Type Flag. 'P' %f General Flags 'CBMT' %l Mucker Level Flag 'W4' Capitalizing the subs will prepend a slash to them, for %d, %o, %f and %l. Colors are selected by unparseobj, unless _prefs/unparse/nocolor? is set to yes, in which case, you may put color codes in the formatter. Default: %n[%d%o%F%L] {note, []'s are parens, but, cant do those in a muf comment} Properties: [ on you ] _prefs/unparse/format: Format for unparseobj _prefs/unparse/nocolor?: 'yes' to disable smart colorization. NOTEs: The name is not normally given a color, giving the calling program a chance to set the color of the unparsed name. ) $include $lib/case lvar STRIPCOLOR lvar OBJ : glow_unparseobj ( d -- s ) ( GlowMuck Unparseobj ) dup ok? not if pop "^GLOOM^*INVALID*" exit then OBJ ! ME @ "_prefs/unparse/format" getpropstr dup not if pop "%n^WHITE^\(%d%o%F%L^WHITE^\)^NORMAL^" 0 STRIPCOLOR ! else ME @ "_prefs/unparse/nocolor?" getpropstr "yes" stringcmp 0 = not if 0 STRIPCOLOR ! else 1 STRIPCOLOR ! then then ( name first ) OBJ @ name "%n" subst ( dbref ) "^FOREST^#" OBJ @ intostr strcat over "%D" instr if "^GRAY^/" swap strcat STRIPCOLOR @ if ansi_strip then "%D" subst else STRIPCOLOR @ if ansi_strip then "%d" subst then ( object type flag ) OBJ @ case player? when "^GREEN^P" end room? when "^CYAN^R" end program? when "^RED^F" end exit? when "^BLUE^E" end thing? when "^PURPLE^T" end default pop "" end endcase over "%O" instr if "^GRAY^/" swap strcat STRIPCOLOR @ if ansi_strip then "%O" subst else STRIPCOLOR @ if ansi_strip then "%o" subst then ( general flags ) "" ( ABODE/AUTOSTART/ABATE (A) BUILDER/BOUND (B) CHOWN_OK/COLOR_ON/ANSI (C) DARK/DEBUG (D) GUEST (G) HAVEN/HARDUID/HIDE (H) IDLE (I) JUMP_OK (J) ANTIPROTECT (K) LINK_OK (L) NO_COMMAND (N) LIGHT (O) QUELL (Q) SILENT/SETUID/STICKY (S) VEHICLE/VIEWABLE (V) XFORCIBLE (X) EXAMINE_OK (Y) ZOMBIE/PUPPET (Z) LOGWALL (!) MUFCOUNT (+) PROTECT (*) PARENT/PROG_DEBUG (%) HIDDEN (#) MOBILE ) ( powers ) OBJ @ "b" flag? if "B" strcat then ( builder ) OBJ @ "g" flag? if "G" strcat then ( guest ) OBJ @ "j" flag? if "J" strcat then OBJ @ "v" flag? if "V" strcat then OBJ @ "x" flag? if "X" strcat then OBJ @ "z" flag? if "Z" strcat then ( modes ) OBJ @ "l" flag? if "L" strcat then OBJ @ "c" flag? if "C" strcat then OBJ @ "i" flag? if "I" strcat then OBJ @ "s" flag? if "S" strcat then OBJ @ "ANTIPROTECT" flag? if "K" strcat then OBJ @ "EXAMINE_OK" flag? if "Y" strcat then OBJ @ "LOGWALL" flag? if "!" strcat then OBJ @ "MUFCOUNT" flag? if "+" strcat then OBJ @ "PROTECT" flag? if "*" strcat then OBJ @ "PARENT" flag? if "%" strcat then OBJ @ "mobile" flag? if "^GRAY^/^YELLOW^GUI" strcat then ( privfactors ) OBJ @ "d" flag? if "D" strcat then OBJ @ "a" flag? if "A" strcat then OBJ @ "HIDDEN" flag? if "#" strcat then OBJ @ "h" flag? if "H" strcat then ( OBJ @ "o" flag? if "O" strcat then ) OBJ @ "q" flag? if "Q" strcat then ( OBJ @ "meeper" flag? if "M" strcat then ) ( OBJ @ "idle" flag? if "I" strcat then ) ( OBJ @ "tinkerproof" flag? if "T" strcat then) "^AQUA^" swap strcat over "%F" instr if dup ansi_strip if "^GREY^/" swap strcat then STRIPCOLOR @ if ansi_strip then "%F" subst else STRIPCOLOR @ if ansi_strip then "%f" subst then ( mucker level ) "" ( 0 - No bit set 5 - W1 Mage 1 - M Meeper 6 - W2 Wizard 2 - M1 Apprentice 7 - W3 Arch Wizard 3 - M2 Journeyman 8 - W4 Boy 4 - M3 Master 9 - W5 Man (#1) ) OBJ @ mlevel dup 0 = if pop "" strcat else dup 1 = if pop "/^RED^M" strcat else dup 2 = if pop "/^RED^M1" strcat else dup 3 = if pop "/^RED^M2" strcat else dup 4 = if pop "/^PURPLE^M3" strcat else dup 5 = if pop "/^PURPLE^W1" strcat else dup 6 = if pop "/^PURPLE^W2" strcat else dup 7 = if pop "/^PURPLE^W3" strcat else dup 8 = if pop "/^PURPLE^W4" strcat else dup 9 = if pop "/^PURPLE^W5" strcat else pop then then then then then then then then then then over "%L" instr if OBJ @ mlevel if "^GRAY^" swap strcat then STRIPCOLOR @ if ansi_strip then "%L" subst else STRIPCOLOR @ if ansi_strip then "%l" subst then ; . c q