Page tree
Skip to end of metadata
Go to start of metadata



Introduced in

Version:1.24

Description

Description:

Create new subclass of class.

In V1.24+, allows for base class to be specified for the configuration classes in memory (accessed using the configFile command) and configuration files (created using the newConfig command).

Syntax

Syntax:configFile addClass newClass
Parameters:
  • configFile: Config-2 - Configuration file.
  • newClass: String - New class name.
Return Value:Config-2

Alternative Syntax

Syntax:configFile addClass [newClass, baseClass]
Parameters:
  • configFile: Config-2 - Configuration file.
  • newClass: String - New class name
  • baseClass: String - Base class name.
Return Value:Config-2

Examples

Examples:
_newclass = (configFile >> "parentClass") addClass "newClass"
_newclass = (configFile >> "parentClass") addClass ["newClass","baseClass"]
_newclass = (configFile >> "CfgVehicles") addClass ["myNewCar","VBS2_IQ_Civ_car_sedan_01"]

Mission to demonstrate creation of custom weapons (with different properties),
based on existing classes customClasses.Intro.zip

Additional Information

See also: addValue, deleteClass, openClass, configClasses
Multiplayer:
Problems:

Notes







Posted on 09:43, 13 February 2012 (PST)
Richard Kissel
When adding a Button class to a dialog, e.g.


_controlsClass = (missionConfigFile >> "myDialog" >> "Controls");
_newClass = _controlsClass addClass ["newButton", "RscButton"];

the button has no animations and is disabled(?) -- button 'actions' will not execute. To utilize the button, add a VBS User Interface Event Handlers afterwards and enable the control to track 'clicks' on that button, e.g.

_newClass addValue ["onMouseButtonDown", "player sideChat str _this"];
//re-open dialog if visible to refresh the display
ctrlEnable[_buttonIDC, true];

Be aware, if the dialog was already visible, you must re-open the dialog to see the new button and for the ctrlEnable to take effect