ConsoleObject Class Reference#include <consoleObject.h>
Inheritance diagram for ConsoleObject: ![]() Detailed DescriptionInterface class to the console.
The BasicsAny object which you want to work with the console system should derive from this, and access functionality through the static interface.This class is always used with the DECLARE_CONOBJECT and IMPLEMENT_* macros.
// A very basic example object. It will do nothing! class TorqueObject : public ConsoleObject { // Must provide a Parent typedef so the console system knows what we inherit from. typedef ConsoleObject Parent; // This does a lot of menial declaration for you. DECLARE_CONOBJECT(TorqueObject); // This is for us to register our fields in. static void initPersistFields(); // A sample field. S8 mSample; }
// And the accordant implementation... IMPLEMENT_CONOBJECT(TorqueObject); void TorqueObject::initPersistFields() { // If you want to inherit any fields from the parent (you do), do this: Parent::initPersistFields(); // Pass the field, the type, the offset, and a usage string. addField("sample", TypeS8, Offset(mSample, TorqueObject), "A test field."); } That's all you need to do to get a class registered with the console system. At this point, you can instantiate it via script, tie methods to it using ConsoleMethod, register fields, and so forth. You can also register any global variables related to the class by creating a consoleInit() method. You will need to use different IMPLEMENT_ macros in different cases; for instance, if you are making a NetObject (for ghosting), a DataBlock, or a NetEvent.
Member Typedef Documentation
Reimplemented in BanList, HTTPObject, TCPObject, AtlasInstance, DynamicConsoleMethodComponent, ConsoleLogger, ScriptObject, SimDataBlock, SimObject, SimSet, SimGroup, FileObject, FileStreamObject, StreamObject, ZipObject, CubemapData, DebugDrawer, GFXStateBlockData, GFXSamplerStateData, GuiTSCtrl, GuiBitmapButtonCtrl, GuiBitmapButtonTextCtrl, GuiButtonBaseCtrl, GuiButtonCtrl, GuiCheckBoxCtrl, GuiIconButtonCtrl, GuiRadioCtrl, GuiToggleButtonCtrl, GuiToolboxButtonCtrl, GuiAutoScrollCtrl, GuiContainer, GuiControlArrayControl, GuiDragAndDropControl, GuiDynamicCtrlArrayControl, GuiFormCtrl, GuiFrameSetCtrl, GuiPaneControl, GuiPanel, GuiRolloutCtrl, GuiScrollCtrl, GuiSplitContainer, GuiStackControl, GuiTabBookCtrl, GuiWindowCtrl, GuiBackgroundCtrl, GuiBitmapCtrl, GuiColorPickerCtrl, GuiConsole, GuiConsoleEditCtrl, GuiConsoleTextCtrl, GuiDirectoryFileListCtrl, GuiDirectoryTreeCtrl, GuiFileTreeCtrl, GuiGameListMenuCtrl, GuiGameListMenuProfile, GuiGameListOptionsCtrl, GuiGameListOptionsProfile, GuiListBoxCtrl, GuiMLTextCtrl, GuiMLTextEditCtrl, GuiPopupTextListCtrl, GuiPopUpMenuCtrl, GuiPopupTextListCtrlEx, GuiPopUpMenuCtrlEx, GuiSliderCtrl, GuiTabPageCtrl, GuiTextCtrl, GuiTextEditCtrl, GuiTextEditSliderCtrl, GuiTextListCtrl, GuiTreeViewCtrl, GuiArrayCtrl, GuiCanvas, GuiControl, GuiScriptNotifyCtrl, GuiCursor, GuiControlProfile, DbgFileView, GuiEditCtrl, GuiFilterCtrl, GuiGraphCtrl, GuiImageList, GuiInspector, GuiInspectorTypeEnum, GuiInspectorTypeCheckBox, GuiInspectorTypeGuiProfile, GuiInspectorTypeFileName, GuiInspectorTypeColor, GuiInspectorTypeColorI, GuiInspectorTypeColorF, GuiInspectorTypeString, GuiInspectorTypeS32, GuiMenuBackgroundCtrl, GuiSubmenuBackgroundCtrl, GuiMenuTextListCtrl, GuiMenuBar, GuiSeparatorCtrl, GuiInspectorDatablockField, GuiInspectorDynamicField, GuiInspectorDynamicGroup, GuiInspectorField, GuiInspectorGroup, GuiAviBitmapCtrl, GuiMessageVectorCtrl, GuiProgressCtrl, CreatorTree, EditManager, EditTSCtrl, GuiTerrPreviewCtrl, MissionAreaEditor, Terraformer, TerrainEditor, WorldEditor, WorldEditor::Selection, GuiTheoraCtrl, GuiTickCtrl, GuiAtlasMonitorCtrl, GuiBubbleTextCtrl, GuiInputCtrl, GuiMouseEventCtrl, MessageVector, LangTable, InteriorInstance, InteriorSubObject, MirrorSubObject, PathedInteriorData, PathedInterior, SceneLighting, sgGuiTexTestCtrl, sgLightObjectData, sgLightObject, sgMissionLightingFilterData, sgMissionLightingFilter, sgSceneLighting, VolumeLight, BaseMaterialDefinition, CustomMaterial, Material, ShaderData, SimXMLDocument, MenuBar, PopupMenu, FileDialog, OpenFileDialog, OpenFolderDialog, SaveFileDialog, DInputManager, UInputManager, XBGamerProfile, XBGamepad, ForcedMaterialMeshMgr, RenderBinManager, RenderGlowMgr, RenderMeshDynamicLightingMgr, RenderMeshMgr, RenderObjectMgr, RenderPassManager, RenderRefractMgr, RenderTranslucentMgr, DecalData, DecalManager, SceneObject, SceneRoot, Path, Marker, SFXDescription, SFXEnvironment, SFXProfile, SFXSource, ActionMap, NetEvent, NetConnection, NetObject, AIClient, AIConnection, AIPlayer, CameraData, Camera, DebrisData, Debris, ExplosionData, Explosion, fxFoliageReplicator, fxLightData, fxLight, fxShapeReplicatedStatic, fxShapeReplicator, fxSunLight, GlowBuffer, GroundCover, LightningData, Lightning, ParticleData, ParticleEmitterData, ParticleEmitter, ParticleEmitterNodeData, ParticleEmitterNode, PrecipitationData, Precipitation, SplashData, Splash, GameBaseData, GameBase, GameConnection, GameTSCtrl, GuiObjectView, ItemData, Item, MissionArea, MissionMarkerData, MissionMarker, SpawnSphere, CameraBookmark, PathCameraData, PathCamera, PhysicalZone, PlayerData, Player, ProjectileData, Projectile, RigidShapeData, RigidShape, T3DSceneComponent, SFXEmitter, ShapeBaseImageData, ShapeBaseData, ShapeBase, StaticShapeData, StaticShape, Trigger, TSStatic, FlyingVehicleData, FlyingVehicle, HoverVehicleData, HoverVehicle, VehicleData, Vehicle, VehicleBlocker, WheeledVehicleTire, WheeledVehicleSpring, WheeledVehicleData, WheeledVehicle, Sky, Sun, TerrainBlock, WaterBlock, TSShapeConstructor, EventManager, Message, MessageForwarder, ScriptMsgListener, UndoAction, UndoManager, and UndoScriptAction.
Constructor & Destructor Documentation
Member Function Documentation
Get a reference to a field by name.
Gets the ClassRep.
Set the value of a field.
Get the classname from a class tag.
Mark the beginning of a group of fields. This is used in the consoleDoc system.
Mark the end of a group of fields. This is used in the consoleDoc system.
Register a complex field.
Register a simple field.
Register a validated field. A validated field is just like a normal field except that you can't have it be an array, and that you give it a pointer to a TypeValidator subclass, which is then used to validate any value placed in it. Invalid values are ignored and an error is printed to the console.
Register a complex protected field.
Register a simple protected field.
Add a deprecated field. A deprecated field will always be undefined, even if you assign a value to it. This is useful when you need to make sure that a field is not being used anymore.
Remove a field. Sometimes, you just have to remove a field!
Register dynamic fields in a subclass of ConsoleObject.
Reimplemented in AtlasInstance, ConsoleLogger, SimObject, CubemapData, GFXStateBlockData, GFXSamplerStateData, GuiTSCtrl, GuiBitmapButtonCtrl, GuiButtonBaseCtrl, GuiCheckBoxCtrl, GuiIconButtonCtrl, GuiToolboxButtonCtrl, GuiAutoScrollCtrl, GuiContainer, GuiControlArrayControl, GuiDragAndDropControl, GuiDynamicCtrlArrayControl, GuiFormCtrl, GuiFrameSetCtrl, GuiPaneControl, GuiRolloutCtrl, GuiScrollCtrl, GuiSplitContainer, GuiStackControl, GuiTabBookCtrl, GuiWindowCtrl, GuiBitmapCtrl, GuiColorPickerCtrl, GuiConsoleEditCtrl, GuiConsoleTextCtrl, GuiFileTreeCtrl, GuiGameListMenuCtrl, GuiGameListMenuProfile, GuiGameListOptionsCtrl, GuiGameListOptionsProfile, GuiListBoxCtrl, GuiMLTextCtrl, GuiMLTextEditCtrl, GuiPopUpMenuCtrl, GuiPopUpMenuCtrlEx, GuiSliderCtrl, GuiTabPageCtrl, GuiTextCtrl, GuiTextEditCtrl, GuiTextEditSliderCtrl, GuiTextListCtrl, GuiTreeViewCtrl, GuiCanvas, GuiControl, GuiScriptNotifyCtrl, GuiCursor, GuiControlProfile, GuiFilterCtrl, GuiImageList, GuiMenuBar, GuiSeparatorCtrl, GuiInspectorGroup, GuiAviBitmapCtrl, GuiMessageVectorCtrl, EditTSCtrl, GuiTerrPreviewCtrl, MissionAreaEditor, TerrainEditor, WorldEditor, GuiTheoraCtrl, GuiMouseEventCtrl, MessageVector, InteriorInstance, MirrorSubObject, PathedInteriorData, PathedInterior, sgGuiTexTestCtrl, sgLightObjectData, sgLightObject, sgMissionLightingFilterData, sgMissionLightingFilter, VolumeLight, CustomMaterial, Material, ShaderData, SimXMLDocument, PopupMenu, FileDialog, OpenFileDialog, OpenFolderDialog, SaveFileDialog, XBGamerProfile, RenderBinManager, RenderMeshMgr, RenderObjectMgr, RenderPassManager, DecalData, SceneObject, Path, Marker, SFXDescription, SFXEnvironment, SFXProfile, SFXSource, NetObject, CameraData, Camera, DebrisData, Debris, ExplosionData, Explosion, fxFoliageReplicator, fxLightData, fxLight, fxShapeReplicator, fxSunLight, GlowBuffer, GroundCover, LightningData, Lightning, ParticleData, ParticleEmitterData, ParticleEmitterNodeData, ParticleEmitterNode, PrecipitationData, Precipitation, SplashData, GameBaseData, GameBase, ItemData, Item, MissionArea, MissionMarker, SpawnSphere, CameraBookmark, PathCameraData, PathCamera, PhysicalZone, PlayerData, ProjectileData, Projectile, RigidShapeData, RigidShape, SFXEmitter, ShapeBaseImageData, ShapeBaseData, StaticShapeData, StaticShape, Trigger, TSStatic, FlyingVehicleData, FlyingVehicle, HoverVehicleData, VehicleData, Vehicle, VehicleBlocker, WheeledVehicleTire, WheeledVehicleSpring, WheeledVehicleData, WheeledVehicle, Sky, Sun, TerrainBlock, WaterBlock, TSShapeConstructor, EventManager, MessageForwarder, UndoAction, and UndoManager.
Register global constant variables and do other one-time initialization tasks in a subclass of ConsoleObject.
Reimplemented in AtlasInstance, GuiTSCtrl, GuiInspectorTypeEnum, GuiInspectorTypeCheckBox, GuiInspectorTypeGuiProfile, GuiInspectorTypeFileName, GuiInspectorTypeColorI, GuiInspectorTypeColorF, GuiInspectorTypeString, GuiInspectorTypeS32, EditTSCtrl, InteriorInstance, DecalManager, NetConnection, Camera, fxLight, GroundCover, GameBase, GameConnection, Item, PathCameraData, PathCamera, Player, ShapeBase, and Sky.
Get a list of all the fields. This information cannot be modified.
Get a list of all the fields, set up so we can modify them.
Get a handle to a boolean telling us if we expanded the dynamic group.
Get the abstract class information for this class.
Get the abstract class information for this class's superclass.
Get our network-layer class id.
Get our compiler and platform independent class name.
Overridden from SimComponent, in debug, to detect console method redirect conflicts.
Reimplemented from SimComponent.
|