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 running within it.

CLASS Example

#CLASS Automapper 1
Turns on the Automapper class.
lists all classes and their status
#CLASS MyClass
#ALIAS test {this is a test}
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

The special Menu class is a grouping of menu items. Normally, when you right-click the mouse on the MUD 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.