Documentation

#CLASS

CLASS

Syntax: #CLA classname state|options

Sets the state of a class. The specified class name is enabled if the state expression is true (1) or disabled if it is false (0). If you just specify #CLASS with no parameters, a list of classes is displayed with the status of each class indicated.

The #CLASS command can also be used to set the "default class". The default class is used whenever a setting is defined without specifying a class name. Normally the default class is <None>. To set the default class, use #CLASS with a single argument, which is the name of the class you want to set as the default. To return to the <None> default, use a classname of "0" (zero).

The #CLASS command is also used to create a new class. This is used by the Import and Export routines. Instead of a numeric state value, a text string of options is given as the second argument. This option list can contain the following values: "enable" to enable the class at startup, "disable" to disable the class at startup, "remove" to remove the class at startup, "hidden" to mark the class as hidden, "menu" to mark the class as a special menu class, "setdef" to make this the default class for triggers, aliases, etc. running within it.

In any case, if a class does not exist, then it will be created.

CLASS Example

#CLASS Automapper 1
Turns on the Automapper class. Creates the Automapper class if it does not exist.

#CLASS
lists all classes and their status

#CLASS MyClass
#ALIAS test {this is a test}
#CLASS 0

This sets MyClass as the default class, and then defines an Alias, which is put into the MyClass class. The default class is then reset to the default of <None> by the last command.

#CLASS MyMenu {menu}
Creates a new class called "MyMenu" which is marked as a menu class. This class will contain menu items used to construct a menu structure for buttons or right-click menus.

Advanced Options

menu creates a class for submenus
setdef sets class as default when executing a setting in that class
enable causes class to automatically be enabled when connecting to the mud
disable causes class to automatically be disabled when connecting to the mud
remove causes inheritted settings in that class to not be loaded
hidden flag the class as hidden

The special Menu class is a grouping of menu items. Normally, when you right-click the mouse on the server window, any menu items that are found in any enabled classes are listed on that menu. However, this prevents the right-click menu from containing submenu items. The Menu Class was created to enhance this. Menu Items contained within a Menu Class are ignored by the normal right-click menu. However, if a menu item is added to the menu and has a subclass value equal to a Menu Class name, then all menu items within the menu class are used as a submenu for the menu item being added.

In other words, the menu items contained within the menu class are shown as a submenu for the menu item that has the subclass option set. See the #MENU command for more details.

The SetDef option for classes indicates that any settings added by triggers, aliases, macros, etc within this class will have this class name by default. Normally, when a new setting (alias, trigger, etc) is created, the current Default class is used for the setting's classname. However, if the setting is created from within a trigger assigned to a SetDef class, then the new setting is assigned the same classname as the trigger that creates it. Here is an example:

#TRIGGER {test} {#ALIAS test {hello world}} TestClass

When the SetDef option for TestClass is OFF, this trigger will create an alias called "test" within the current default class. However, if the SetDef option for TestClass is ON, this trigger will always create an alias called "test" within the TestClass class, no matter what the default class value is.

Add comment

Login or register to post comments