[Package Index | Mudlib Index | Effect Index]

File /std/basic/read_desc.c

This method keeps track of all the messages on the object for reading etc. Keeps track of the language, the text and the size.

Written by Pinkfish

Inherits

This class inherits the following classes /std/basic/desc.c

Includes

This class includes the following files /include/language.h and /include/nroff.h

Method index

Public Functions

These are functions that everyone can access.

add_read_mess
varargs mixed add_read_mess(mixed str,
                            string type,
                            string lang,
                            int size)

This method adds a new read message onto the object.

The str bit is the actual string to add, it is the message which will get printed. The type is the type of the writing, like "spidery writing" or "charcoal based letters". The language is the language in which it is written and the size is the size of the letters. The size is used to see if the writing can fit on the page.

If no type is given, then no type bit is printed and if no size is specified a size of 1 is the default.

This also adjusts the size of stuff on the object. If too much is attemnpted to be written ont the object, the remainer will be cut off.

Parameters:
str - the text of the message
type - the type of the message
lang - the language the message is in
size - the size of the message

See also:
query_read_mess(), set_max_size(), /obj/handlers/language->query_language_size() and /obj/handlers/language->squidge_text()


query_cur_size
int query_cur_size()

This method returns the current amount of wreiting size on the object.

Returns:
the current amount of writing on the object

See also:
set_max_size(), add_read_mess() and set_cur_size()


query_max_size
int query_max_size()

This method returns the current maximum size of the object.

Returns:
the current maximum size

See also:
set_max_size() and add_read_mess()


query_read_mess
mixed * query_read_mess()

This method returns the current read messae array on the object. The returned array consists of an array of arrays. The internal array has 4 elements, the first is the text of the mnessage the second is the type of the message,m the third is the languae and the last element is the size of the wiritn .

The defines in the file /include/language.h should be used for the indexes into this array.

Returns:
the read message array

See also:
add_read_mess(), set_max_size() and /include/language.h


query_read_short
string query_read_short(object player,
                        int ignore_labels)

This method returns the short description to use with the reading. It will go: You read :

It will automaticly add a $name$ onto the end of the string for you. This will be replaced with the correct a/the short for the message which is printed.

Parameters:
player - the player reading the message


query_readable_message
string query_readable_message(object player,
                              int ignore_labels)

This method returns the read message for the object. This is what should be displayed to the player if they attempt to read this object.

Returns:
the read message, 0 if there is none


remove_read_mess
int remove_read_mess(string str,
                     string type,
                     string lang)

This method removes a piece of writing off the object.

If you know the actual message or the language or the type you can remove that message.

Using the type and or language is a very dodgy way of doing this. Using a combination is much better.

Any of the parameters set to a non-zero value will be used for the search.

Parameters:
str - the text string
type - the type of the text
lang - the language it is written in

Returns:
0 if the text was not found, 1 if it was

See also:
/obj/handlers/language->query_language_size(), add_read_mess() and query_read_mess()


set_cur_size
void set_cur_size(int siz)

This method sets the current amount of writing size on the object.

Parameters:
siz - the new current size

See also:
set_max_size(), add_read_mess() and query_cur_size()


set_max_size
void set_max_size(int siz)

This method sets the maximum amount of writing to be able to be placed onto the object.

Parameters:
siz - the maximum size

See also:
query_max_size() and add_read_mess()