* Fixed initialization of attribute flags [AEJ]
* SQL support is now reported via @config compile. [RLB]
* Player aliases may now be supplied to @pemit/list. [RLB]
+ * Width() and height() take optional second argument for defaults. [RLB]
& HEIGHT()
& SCREENWIDTH
& SCREENHEIGHT
- width(<player|descriptor>)
- height(<player|descriptor>)
+ width(<player|descriptor>[, <default>])
+ height(<player|descriptor>[, <default>])
These two functions return the screen width and height for a connected
player. If the player's client is capable of doing so, it will let the
mush know what the correct sizes are on connection and when the client
- is resized. The defaults are 78 for width, and 24 for height, the
- normal minimal values. These can be changed with the special
- SCREENWIDTH and SCREENHEIGHT commands, both of which take a number as
- their sole argument, and set the appropriate field.
+ is resized.
- If used on something that's not a player, the functions return the
- default values.
+ The defaults are 78 for width, and 24 for height, the normal minimal
+ values. These can be overridden when calling the function by
+ providing the default to the function. Players can change the value
+ that will be returned when the functions are called on them with the
+ special SCREENWIDTH and SCREENHEIGHT commands, both of which take a
+ number as their sole argument, and set the appropriate field.
+
+ When used on something that's not a visible player, the functions
+ return the default values.
The intent of these functions is allow softcode that does formatting
to be able to produce a display that can make full use of any given
screen size.
+
& WHERE()
where(<object>)
safe_str(T("#-1 FUNCTION REQUIRES ONE ARGUMENT"), buff, bp);
else if ((match = lookup_desc(executor, args[0])))
safe_integer(match->width, buff, bp);
+ else if (args[1])
+ safe_str(args[1], buff, bp);
else
safe_str("78", buff, bp);
}
safe_str(T("#-1 FUNCTION REQUIRES ONE ARGUMENT"), buff, bp);
else if ((match = lookup_desc(executor, args[0])))
safe_integer(match->height, buff, bp);
+ else if (args[1])
+ safe_str(args[1], buff, bp);
else
safe_str("24", buff, bp);
}
{"HASPOWER", fun_hasdivpower, 2, 2, FN_REG},
{"HASPOWERGROUP", fun_haspowergroup, 2, 2, FN_REG},
{"HASTYPE", fun_hastype, 2, 2, FN_REG},
- {"HEIGHT", fun_height, 1, 1, FN_REG},
+ {"HEIGHT", fun_height, 1, 2, FN_REG},
{"HIDDEN", fun_hidden, 1, 1, FN_REG},
{"HOME", fun_home, 1, 1, FN_REG},
{"HOST", fun_hostname, 1, 1, FN_REG},
{"VISIBLE", fun_visible, 2, 2, FN_REG},
{"WAIT", fun_wait, 2, 2, FN_NOPARSE},
{"WHERE", fun_where, 1, 1, FN_REG},
- {"WIDTH", fun_width, 1, 1, FN_REG},
+ {"WIDTH", fun_width, 1, 2, FN_REG},
{"WILDGREP", fun_grep, 3, 3, FN_REG},
{"WILDGREPI", fun_grep, 3, 3, FN_REG},
{"WIPE", fun_wipe, 1, 1, FN_REG},