Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*!
- @brief A container that splits its area between two child controls.
- A GuiSplitContainer can be used to dynamically subdivide an area between two child controls. A splitter bar is placed between the two controls and allows to dynamically adjust the sizing ratio between the two sides. Splitting can be either horizontal (subdividing top and bottom) or vertical (subdividing left and right) depending on #orientation.
- By using #fixedPanel, one of the panels can be chosen to remain at a fixed size (#fixedSize).@tsexample
- // Create a vertical splitter with a fixed-size left panel.
- %splitter = new GuiSplitContainer()
- {
- orientation = "Vertical";
- fixedPanel = "FirstPanel";
- fixedSize = 100;
- new GuiScrollCtrl()
- {
- new GuiMLTextCtrl()
- {
- text = %longText;
- };
- };
- new GuiScrollCtrl()
- {
- new GuiMLTextCtrl()
- {
- text = %moreLongText;
- };
- };
- };
- @endtsexample
- @note The children placed inside GuiSplitContainers must be GuiContainers.
- */
- class GuiSplitContainer : public GuiContainer {
- public:
- /*! @name Splitter
- Options to configure split panels contained by this control
- @{ */
- /*! */
- /*!
- Whether to split between top and bottom (horizontal) or between left and right (vertical).
- */
- GuiSplitOrientation orientation;
- /*!
- Width of the splitter bar between the two sides. Default is 2.
- */
- int splitterSize;
- /*!
- Point on control through which the splitter goes.
- Changed relatively if size of control changes.
- */
- Point2I splitPoint;
- /*!
- Which (if any) side of the splitter to keep at a fixed size.
- */
- GuiSplitFixedPanel fixedPanel;
- /*!
- Width of the fixed panel specified by #fixedPanel (if any).
- */
- int fixedSize;
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @deprecated Use GuiWindowCtrl with GuiWindowCtrl::canCollapse = true.
- */
- class GuiWindowCollapseCtrl : public GuiWindowCtrl {
- public:
- /*! @name Window
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class CmGuiDoubleValTextCtrl : public GuiTextCtrl {
- public:
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief Renders a background, so you can have a backdrop for your GUI.
- Deprecated
- @ingroup GuiImages
- */
- class GuiBackgroundCtrl : public GuiControl {
- public:
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A control that renders a skinned border specified in its profile.
- This control uses the bitmap specified in it's profile (GuiControlProfile::bitmapName). It takes this image and breaks up aspects of it to skin the border of this control with. It is also important to set GuiControlProfile::hasBitmapArray to true on the profile as well.
- The bitmap referenced should be broken up into a 3 x 3 grid (using the top left color pixel as a border color between each of the images) in which it will map to the following places:
- 1 = Top Left Corner
- 2 = Top Right Corner
- 3 = Top Center
- 4 = Left Center
- 5 = Right Center
- 6 = Bottom Left Corner
- 7 = Bottom Center
- 8 = Bottom Right Corner
- 0 = Nothing
- 1 2 3
- 4 5 0
- 6 7 8
- @tsexample
- singleton GuiControlProfile (BorderGUIProfile)
- {
- bitmap = "core/art/gui/images/borderArray";
- hasBitmapArray = true;
- opaque = false;
- };
- new GuiBitmapBorderCtrl(BitmapBorderGUI)
- {
- profile = "BorderGUIProfile";
- position = "0 0";
- extent = "400 40";
- visible = "1";
- };@endtsexample
- @see GuiControlProfile::bitmapName
- @see GuiControlProfile::hasBitmapArray
- */
- class GuiBitmapBorderCtrl : public GuiControl {
- public:
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief Designed soley for buttons, primarily used in editor.
- Currently editor use only, no real application without extension.
- */
- class GuiDecoyCtrl : public GuiControl {
- public:
- /*!
- Sets this control to decoy mode
- */
- bool isDecoy;
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A GuiControlProfile with additional fields specific to GuiGameListMenuCtrl.
- @tsexample
- new GuiGameListMenuProfile()
- {
- hitAreaUpperLeft = "10 2";
- hitAreaLowerRight = "190 18";
- iconOffset = "10 2";
- rowSize = "200 20";
- //Properties not specific to this control have been omitted from this example.
- };
- @endtsexample
- */
- class GuiGameListMenuProfile : public GuiControlProfile {
- public:
- /*!
- Position of the upper left corner of the row hit area (relative to row's top left corner)
- */
- Point2I hitAreaUpperLeft;
- /*!
- Position of the lower right corner of the row hit area (relative to row's top left corner)
- */
- Point2I hitAreaLowerRight;
- /*!
- Offset from the row's top left corner at which to render the row icon
- */
- Point2I iconOffset;
- /*!
- The base size ("width height") of a row
- */
- Point2I rowSize;
- /*! @name Behavior
- @{ */
- /*! */
- /// @}
- /*! @name Appearance
- @{ */
- /*! */
- /// @}
- /*! @name Text
- @{ */
- /*! */
- /// @}
- /*! @name Misc
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A GuiControlProfile with additional fields specific to GuiGameListOptionsCtrl.
- @tsexample
- new GuiGameListOptionsProfile()
- {
- columnSplit = "100";
- rightPad = "4";
- //Properties not specific to this control have been omitted from this example.
- };
- @endtsexample
- */
- class GuiGameListOptionsProfile : public GuiGameListMenuProfile {
- public:
- /*!
- Padding between the leftmost edge of the control, and the row's left arrow.
- */
- int columnSplit;
- /*!
- Padding between the rightmost edge of the control and the row's right arrow.
- */
- int rightPad;
- /*! @name Behavior
- @{ */
- /*! */
- /// @}
- /*! @name Appearance
- @{ */
- /*! */
- /// @}
- /*! @name Text
- @{ */
- /*! */
- /// @}
- /*! @name Misc
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class GuiListItem : public GuiButtonBaseCtrl {
- public:
- /*! @name Button
- @{ */
- /*! */
- /*!
- */
- ColorI FontColor;
- /// @}
- /*! @name Button
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A text entry control that accepts the Gui Markup Language ('ML') tags and multiple lines.
- @tsexample
- new GuiMLTextEditCtrl()
- {
- lineSpacing = "2";
- allowColorChars = "0";
- maxChars = "-1";
- deniedSound = "DeniedSoundProfile";
- text = "";
- escapeCommand = "onEscapeScriptFunction();";
- //Properties not specific to this control have been omitted from this example.
- };
- @endtsexample
- @see GuiMLTextCtrl
- @see GuiControl
- @ingroup GuiControls
- */
- class GuiMLTextEditCtrl : public GuiMLTextCtrl {
- public:
- /*!
- Script function to run whenever the 'escape' key is pressed when this control is in focus.
- */
- string escapeCommand;
- /*! @name Text
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class GuiRotatedBitmapCtrl : public GuiControl {
- public:
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A container.
- */
- class GuiInventoryContainer : public GuiWindowCtrl {
- public:
- /*! Initialize */
- virtual void init((U32 containerId)) {}
- virtual void onClose(()) {}
- /*! @name Window
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class GuiObjectInventoryContainer : public GuiInventoryContainer {
- public:
- /*! @name Window
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class GuiAuthorityContainer : public GuiObjectInventoryContainer {
- public:
- /*! @name Window
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class guiComboStep : public GuiButtonBaseCtrl {
- public:
- /*! @name Button
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class guiComboFinal : public GuiButtonBaseCtrl {
- public:
- /*! @name Button
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class GuiCreateWorldWindow : public GuiCreateWorldWindow {
- public:
- virtual Script onWorldStarting(( string this, string port, string password )) {}
- /*! @name Layout
- @{ */
- /*! */
- /*!
- The position relative to the parent control.
- */
- Point2I position;
- /*!
- The width and height of the control.
- */
- Point2I extent;
- /*!
- The minimum width and height of the control. The control will not be resized smaller than this.
- */
- Point2I minExtent;
- /*!
- The maximum width and height of the control. The control will not be resized more than this.
- */
- Point2I maxExtent;
- /*!
- The horizontal resizing behavior.
- */
- GuiHorizontalSizing horizSizing;
- /*!
- The vertical resizing behavior.
- */
- GuiVerticalSizing vertSizing;
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /*!
- The control profile that determines fill styles, font settings, etc.
- */
- GuiControlProfile profile;
- /*!
- Whether the control is visible or hidden.
- */
- bool visible;
- /*!
- Whether the control is enabled for user interaction.
- */
- bool active;
- /*!
- @deprecated This member is deprecated, which means that its value is always undefined.
- */
- deprecated modal;
- /*!
- @deprecated This member is deprecated, which means that its value is always undefined.
- */
- deprecated setFirstResponder;
- /*!
- Name of the variable to which the value of this control will be synchronized.
- */
- string variable;
- /*!
- Command to execute on the primary action of the control.
- @note Within this script snippet, the control on which the #command is being executed is bound to the global variable $ThisControl.
- */
- string command;
- /*!
- Command to execute on the secondary action of the control.
- @note Within this script snippet, the control on which the #altCommand is being executed is bound to the global variable $ThisControl.
- */
- string altCommand;
- /*!
- Key combination that triggers the control's primary action when the control is on the canvas.
- */
- string accelerator;
- /*!
- Opacity multiplier for rendering the control.
- */
- float opacity;
- /*!
- Control will hide on TAB.
- */
- bool canHideOnFreelook;
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /*!
- Control profile to use when rendering tooltips for this control.
- */
- GuiControlProfile tooltipProfile;
- /*!
- String to show in tooltip for this control.
- */
- string tooltip;
- /*!
- Time for mouse to hover over control until tooltip is shown (in milliseconds).
- */
- int hovertime;
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /*!
- If true, the control may contain child controls.
- */
- bool isContainer;
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /*!
- Name of string table to use for lookup of internationalized text.
- */
- string langTableMod;
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /*!
- Optional global name of this object.
- */
- string Name;
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /*!
- Optional name that may be used to lookup this object within a SimSet.
- */
- string internalName;
- /*!
- Group hierarchy parent of the object.
- */
- SimObject parentGroup;
- /*!
- Script class of object.
- */
- string class;
- /*!
- Script super-class of object.
- */
- string superClass;
- /*!
- Script class of object.
- */
- string className;
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /*!
- Whether the object is visible.
- */
- bool hidden;
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /*!
- Whether the object can be saved out. If false, the object is purely transient in nature.
- */
- bool canSave;
- /*!
- True if dynamic fields (added at runtime) should be saved. Defaults to true.
- */
- bool canSaveDynamicFields;
- /*!
- The universally unique identifier for the object.
- */
- pid persistentId;
- /*!
- True if this object is 4ever alone, perhaps it is an one side datablock.
- */
- bool local;
- /// @}
- };
- class GuiCreditsWindow : public GuiControl {
- public:
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class GuiMainMenuMultiplayerWindow : public GuiControl {
- public:
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class GAH_AnimalsList : public SimGroup {
- public:
- /*! @name Layout
- @{ */
- /*! */
- /*!
- The position relative to the parent control.
- */
- Point2I position;
- /*!
- The width and height of the control.
- */
- Point2I extent;
- /*!
- The minimum width and height of the control. The control will not be resized smaller than this.
- */
- Point2I minExtent;
- /*!
- The maximum width and height of the control. The control will not be resized more than this.
- */
- Point2I maxExtent;
- /*!
- The horizontal resizing behavior.
- */
- GuiHorizontalSizing horizSizing;
- /*!
- The vertical resizing behavior.
- */
- GuiVerticalSizing vertSizing;
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /*!
- The control profile that determines fill styles, font settings, etc.
- */
- GuiControlProfile profile;
- /*!
- Whether the control is visible or hidden.
- */
- bool visible;
- /*!
- Whether the control is enabled for user interaction.
- */
- bool active;
- /*!
- @deprecated This member is deprecated, which means that its value is always undefined.
- */
- deprecated modal;
- /*!
- @deprecated This member is deprecated, which means that its value is always undefined.
- */
- deprecated setFirstResponder;
- /*!
- Name of the variable to which the value of this control will be synchronized.
- */
- string variable;
- /*!
- Command to execute on the primary action of the control.
- @note Within this script snippet, the control on which the #command is being executed is bound to the global variable $ThisControl.
- */
- string command;
- /*!
- Command to execute on the secondary action of the control.
- @note Within this script snippet, the control on which the #altCommand is being executed is bound to the global variable $ThisControl.
- */
- string altCommand;
- /*!
- Key combination that triggers the control's primary action when the control is on the canvas.
- */
- string accelerator;
- /*!
- Opacity multiplier for rendering the control.
- */
- float opacity;
- /*!
- Control will hide on TAB.
- */
- bool canHideOnFreelook;
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /*!
- Control profile to use when rendering tooltips for this control.
- */
- GuiControlProfile tooltipProfile;
- /*!
- String to show in tooltip for this control.
- */
- string tooltip;
- /*!
- Time for mouse to hover over control until tooltip is shown (in milliseconds).
- */
- int hovertime;
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /*!
- If true, the control may contain child controls.
- */
- bool isContainer;
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /*!
- Name of string table to use for lookup of internationalized text.
- */
- string langTableMod;
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class GAH_Feeder : public SimGroup {
- public:
- /*! @name Layout
- @{ */
- /*! */
- /*!
- The position relative to the parent control.
- */
- Point2I position;
- /*!
- The width and height of the control.
- */
- Point2I extent;
- /*!
- The minimum width and height of the control. The control will not be resized smaller than this.
- */
- Point2I minExtent;
- /*!
- The maximum width and height of the control. The control will not be resized more than this.
- */
- Point2I maxExtent;
- /*!
- The horizontal resizing behavior.
- */
- GuiHorizontalSizing horizSizing;
- /*!
- The vertical resizing behavior.
- */
- GuiVerticalSizing vertSizing;
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /*!
- The control profile that determines fill styles, font settings, etc.
- */
- GuiControlProfile profile;
- /*!
- Whether the control is visible or hidden.
- */
- bool visible;
- /*!
- Whether the control is enabled for user interaction.
- */
- bool active;
- /*!
- @deprecated This member is deprecated, which means that its value is always undefined.
- */
- deprecated modal;
- /*!
- @deprecated This member is deprecated, which means that its value is always undefined.
- */
- deprecated setFirstResponder;
- /*!
- Name of the variable to which the value of this control will be synchronized.
- */
- string variable;
- /*!
- Command to execute on the primary action of the control.
- @note Within this script snippet, the control on which the #command is being executed is bound to the global variable $ThisControl.
- */
- string command;
- /*!
- Command to execute on the secondary action of the control.
- @note Within this script snippet, the control on which the #altCommand is being executed is bound to the global variable $ThisControl.
- */
- string altCommand;
- /*!
- Key combination that triggers the control's primary action when the control is on the canvas.
- */
- string accelerator;
- /*!
- Opacity multiplier for rendering the control.
- */
- float opacity;
- /*!
- Control will hide on TAB.
- */
- bool canHideOnFreelook;
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /*!
- Control profile to use when rendering tooltips for this control.
- */
- GuiControlProfile tooltipProfile;
- /*!
- String to show in tooltip for this control.
- */
- string tooltip;
- /*!
- Time for mouse to hover over control until tooltip is shown (in milliseconds).
- */
- int hovertime;
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /*!
- If true, the control may contain child controls.
- */
- bool isContainer;
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /*!
- Name of string table to use for lookup of internationalized text.
- */
- string langTableMod;
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class GAH_Breeder : public SimGroup {
- public:
- /*! @name Layout
- @{ */
- /*! */
- /*!
- The position relative to the parent control.
- */
- Point2I position;
- /*!
- The width and height of the control.
- */
- Point2I extent;
- /*!
- The minimum width and height of the control. The control will not be resized smaller than this.
- */
- Point2I minExtent;
- /*!
- The maximum width and height of the control. The control will not be resized more than this.
- */
- Point2I maxExtent;
- /*!
- The horizontal resizing behavior.
- */
- GuiHorizontalSizing horizSizing;
- /*!
- The vertical resizing behavior.
- */
- GuiVerticalSizing vertSizing;
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /*!
- The control profile that determines fill styles, font settings, etc.
- */
- GuiControlProfile profile;
- /*!
- Whether the control is visible or hidden.
- */
- bool visible;
- /*!
- Whether the control is enabled for user interaction.
- */
- bool active;
- /*!
- @deprecated This member is deprecated, which means that its value is always undefined.
- */
- deprecated modal;
- /*!
- @deprecated This member is deprecated, which means that its value is always undefined.
- */
- deprecated setFirstResponder;
- /*!
- Name of the variable to which the value of this control will be synchronized.
- */
- string variable;
- /*!
- Command to execute on the primary action of the control.
- @note Within this script snippet, the control on which the #command is being executed is bound to the global variable $ThisControl.
- */
- string command;
- /*!
- Command to execute on the secondary action of the control.
- @note Within this script snippet, the control on which the #altCommand is being executed is bound to the global variable $ThisControl.
- */
- string altCommand;
- /*!
- Key combination that triggers the control's primary action when the control is on the canvas.
- */
- string accelerator;
- /*!
- Opacity multiplier for rendering the control.
- */
- float opacity;
- /*!
- Control will hide on TAB.
- */
- bool canHideOnFreelook;
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /*!
- Control profile to use when rendering tooltips for this control.
- */
- GuiControlProfile tooltipProfile;
- /*!
- String to show in tooltip for this control.
- */
- string tooltip;
- /*!
- Time for mouse to hover over control until tooltip is shown (in milliseconds).
- */
- int hovertime;
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /*!
- If true, the control may contain child controls.
- */
- bool isContainer;
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /*!
- Name of string table to use for lookup of internationalized text.
- */
- string langTableMod;
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class GuiListDeed : public GuiButtonCtrl {
- public:
- /*! @name Button
- @{ */
- /*! */
- /// @}
- /*! @name Button
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class GuiListDeedsControl : public GuiDynamicCtrlArrayControl {
- public:
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class GAH_BreederSlot : public SimGroup {
- public:
- /*! @name Layout
- @{ */
- /*! */
- /*!
- The position relative to the parent control.
- */
- Point2I position;
- /*!
- The width and height of the control.
- */
- Point2I extent;
- /*!
- The minimum width and height of the control. The control will not be resized smaller than this.
- */
- Point2I minExtent;
- /*!
- The maximum width and height of the control. The control will not be resized more than this.
- */
- Point2I maxExtent;
- /*!
- The horizontal resizing behavior.
- */
- GuiHorizontalSizing horizSizing;
- /*!
- The vertical resizing behavior.
- */
- GuiVerticalSizing vertSizing;
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /*!
- The control profile that determines fill styles, font settings, etc.
- */
- GuiControlProfile profile;
- /*!
- Whether the control is visible or hidden.
- */
- bool visible;
- /*!
- Whether the control is enabled for user interaction.
- */
- bool active;
- /*!
- @deprecated This member is deprecated, which means that its value is always undefined.
- */
- deprecated modal;
- /*!
- @deprecated This member is deprecated, which means that its value is always undefined.
- */
- deprecated setFirstResponder;
- /*!
- Name of the variable to which the value of this control will be synchronized.
- */
- string variable;
- /*!
- Command to execute on the primary action of the control.
- @note Within this script snippet, the control on which the #command is being executed is bound to the global variable $ThisControl.
- */
- string command;
- /*!
- Command to execute on the secondary action of the control.
- @note Within this script snippet, the control on which the #altCommand is being executed is bound to the global variable $ThisControl.
- */
- string altCommand;
- /*!
- Key combination that triggers the control's primary action when the control is on the canvas.
- */
- string accelerator;
- /*!
- Opacity multiplier for rendering the control.
- */
- float opacity;
- /*!
- Control will hide on TAB.
- */
- bool canHideOnFreelook;
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /*!
- Control profile to use when rendering tooltips for this control.
- */
- GuiControlProfile tooltipProfile;
- /*!
- String to show in tooltip for this control.
- */
- string tooltip;
- /*!
- Time for mouse to hover over control until tooltip is shown (in milliseconds).
- */
- int hovertime;
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /*!
- If true, the control may contain child controls.
- */
- bool isContainer;
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /*!
- Name of string table to use for lookup of internationalized text.
- */
- string langTableMod;
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class GAH_Info : public GuiControl {
- public:
- /*! @name Layout
- @{ */
- /*! */
- /*!
- */
- GuiDockingType docking;
- /*!
- */
- RectSpacingI margin;
- /*!
- */
- RectSpacingI padding;
- /*!
- */
- bool anchorTop;
- /*!
- */
- bool anchorBottom;
- /*!
- */
- bool anchorLeft;
- /*!
- */
- bool anchorRight;
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class GuiBrewingTank : public GuiObjectInventoryContainer {
- public:
- /*! @name Window
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class GuiCheckBoxInventory : public GuiCheckBoxCtrl {
- public:
- /*! @name CheckBox
- @{ */
- /*! */
- /// @}
- /*! @name Button
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class GuiClickInventoryButton : public GuiBitmapButtonCtrl {
- public:
- /*! @name Bitmap
- @{ */
- /*! */
- /// @}
- /*! @name Button
- @{ */
- /*! */
- /// @}
- /*! @name Button
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class GuiInventoryScrollCtrl : public GuiScrollCtrl {
- public:
- /*! @name Scolling
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class GuiPartOfBitmap : public GuiControl {
- public:
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class GuiSkillLockButton : public GuiClickBitmapButton {
- public:
- /*! @name Bitmap
- @{ */
- /*! */
- /// @}
- /*! @name Button
- @{ */
- /*! */
- /// @}
- /*! @name Button
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A single-line text control that displays its text in a multi-line popup when clicked.
- This control acts like a GuiTextCtrl (and inherits from it), when clicked it creates a GuiMLTextCtrl roughly where you clicked with the same text in it. This allows you to have a single line text control which upon clicking will display the entire text contained in a multi-line format.
- @tsexample
- new GuiBubbleTextCtrl(BubbleTextGUI)
- {
- text = "This is the first sentence. This second sentence can be sized outside of the default single line view, upon clicking this will be displayed in a multi-line format.";
- };
- @endtsexample
- @see GuiTextCtrl
- @see GuiMLTextCtrl
- @ingroup GuiControls
- */
- class GuiBubbleTextCtrl : public GuiTextCtrl {
- public:
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class AwGui : public GuiControl {
- public:
- virtual void execJavaScript(( string script )) {}
- /*! @brief Loads the specified URL. */
- virtual void loadURL(( string url )) {}
- /*! @brief Returns the start URL. */
- virtual string getStartURL(()) {}
- /*! @brief Returns the current URL. */
- virtual string getCurrentURL(()) {}
- /*! @brief Refreshes the current page. */
- virtual void reload(()) {}
- /*! @brief If there's a page being loaded, this stops it from doing so. */
- virtual void stop(()) {}
- /*!
- The URL which is loaded initially.
- */
- string StartURL;
- /*!
- Path to a session file which will contain cookies, history, passwords etc. A blank path forces the control to use the default session.
- */
- string SessionPath;
- /*!
- The amount of frames per second to render. 0 means unlimited.
- */
- char Framerate;
- /*!
- Whether this control supports transparency or not. Default: Disabled
- */
- bool IsTransparent;
- /*!
- Forced resolution. Defaults to (0, 0) which lets AwGui and AwShape decide. In that case AwGui will set the resolution to the size of the Gui control and AwShape will set the size to 800 x 600.
- */
- Point2I Resolution;
- /*!
- Unloads all resources if the AwGui goes asleep. This can be used to keep the memory footprint down.
- */
- bool UnloadOnSleep;
- /*!
- If the amount of alpha is below this value, no mouse events will be processed for that pixel.
- */
- char AlphaCutoff;
- /*!
- Shows the loading screen if true. Default: Disabled
- */
- bool ShowLoadingScreen;
- /*!
- If enabled will bring the control to the top of the GUI stack when clicked. Default: Disabled
- */
- bool BringToFrontWhenClicked;
- /*!
- Enables right-mouse clicks. If you're using Flash, this might not be desired as it can bring up an annoying context menu. Default: Disabled
- */
- bool EnableRightMouseButton;
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class AwWebBrowser : public AwGui {
- public:
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief This class contains code for rendering and manipulating a 3D gizmo
- It is usually used as a helper within a TSEdit-derived control. Not intended for game development, for editors or internal use only.
- */
- class Gizmo : public SimObject {
- public:
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class CmCSEvent {
- public:
- };
- class TerrainAttachEvent {
- public:
- };
- class CmPatchEvent {
- public:
- };
- class CmChangeEvent {
- public:
- };
- class YoPatchTerrainAttachEvent {
- public:
- };
- class YoPatchTerCachedRequestEvent {
- public:
- };
- class YoPatchTerCachedResponceEvent {
- public:
- };
- class YoPatchTerCachedDataRequestEvent {
- public:
- };
- class YoPatchTerCachedChunkCountEvent {
- public:
- };
- class YoPatchTerCachedDataCheckResponseEvent {
- public:
- };
- class YoPatchTerChunkDataEvent {
- public:
- };
- class ServerUUIDEvent {
- public:
- };
- /*!
- @brief Base class responsible for displaying an OS file browser.
- FileDialog is a platform agnostic dialog interface for querying the user for file locations. It is designed to be used through the exposed scripting interface.
- FileDialog is the base class for Native File Dialog controls in Torque. It provides these basic areas of functionality:
- - Inherits from SimObject and is exposed to the scripting interface
- - Provides blocking interface to allow instant return to script execution
- - Simple object configuration makes practical use easy and effective
- FileDialog is *NOT* intended to be used directly in script and is only exposed to script to expose generic file dialog attributes.
- This base class is usable in TorqueScript, but is does not specify what functionality is intended (open or save?). Its children, OpenFileDialog and SaveFileDialog, do make use of DialogStyle flags and do make use of specific funcationality. These are the preferred classes to use
- However, the FileDialog base class does contain the key properties and important method for file browing. The most important function is Execute(). This is used by both SaveFileDialog and OpenFileDialog to initiate the browser.
- @tsexample
- // NOTE: This is not he preferred class to use, but this still works
- // Create the file dialog
- %baseFileDialog = new FileDialog()
- {
- // Allow browsing of all file types
- filters = "*.*";
- // No default file
- defaultFile = ;
- // Set default path relative to project
- defaultPath = "./";
- // Set the title
- title = "Durpa";
- // Allow changing of path you are browsing
- changePath = true;
- };
- // Launch the file dialog
- %baseFileDialog.Execute();
- // Don't forget to cleanup
- %baseFileDialog.delete();
- @endtsexample
- @note FileDialog and its related classes are only availble in a Tools build of Torque.
- @see OpenFileDialog for a practical example on opening a file
- @see SaveFileDialog for a practical example of saving a file
- @ingroup FileSystem
- */
- class FileDialog : public SimObject {
- public:
- /*! @brief Launches the OS file browser
- After an Execute() call, the chosen file name and path is available in one of two areas. If only a single file selection is permitted, the results will be stored in the @a fileName attribute.
- If multiple file selection is permitted, the results will be stored in the @a files array. The total number of files in the array will be stored in the @a fileCount attribute.
- @tsexample
- // NOTE: This is not he preferred class to use, but this still works
- // Create the file dialog
- %baseFileDialog = new FileDialog()
- {
- // Allow browsing of all file types
- filters = "*.*";
- // No default file
- defaultFile = ;
- // Set default path relative to project
- defaultPath = "./";
- // Set the title
- title = "Durpa";
- // Allow changing of path you are browsing
- changePath = true;
- };
- // Launch the file dialog
- %baseFileDialog.Execute();
- // Don't forget to cleanup
- %baseFileDialog.delete();
- // A better alternative is to use the
- // derived classes which are specific to file open and save
- // Create a dialog dedicated to opening files
- %openFileDlg = new OpenFileDialog()
- {
- // Look for jpg image files
- // First part is the descriptor|second part is the extension
- Filters = "Jepg Files|*.jpg";
- // Allow browsing through other folders
- ChangePath = true;
- // Only allow opening of one file at a time
- MultipleFiles = false;
- };
- // Launch the open file dialog
- %result = %openFileDlg.Execute();
- // Obtain the chosen file name and path
- if ( %result )
- {
- %seletedFile = %openFileDlg.file;
- }
- else
- {
- %selectedFile = "";
- }
- // Cleanup
- %openFileDlg.delete();
- // Create a dialog dedicated to saving a file
- %saveFileDlg = new SaveFileDialog()
- {
- // Only allow for saving of COLLADA files
- Filters = "COLLADA Files (*.dae)|*.dae|";
- // Default save path to where the WorldEditor last saved
- DefaultPath = $pref::WorldEditor::LastPath;
- // No default file specified
- DefaultFile = "";
- // Do not allow the user to change to a new directory
- ChangePath = false;
- // Prompt the user if they are going to overwrite an existing file
- OverwritePrompt = true;
- };
- // Launch the save file dialog
- %result = %saveFileDlg.Execute();
- // Obtain the file name
- %selectedFile = "";
- if ( %result )
- %selectedFile = %saveFileDlg.file;
- // Cleanup
- %saveFileDlg.delete();
- @endtsexample
- @return True if the file was selected was successfully found (opened) or declared (saved). */
- virtual bool Execute(()) {}
- /*!
- The default directory path when the dialog is shown.
- */
- string defaultPath;
- /*!
- The default file path when the dialog is shown.
- */
- string defaultFile;
- /*!
- The default file name when the dialog is shown.
- */
- string fileName;
- /*!
- The filter string for limiting the types of files visible in the dialog. It makes use of the pipe symbol '|' as a delimiter. For example:
- 'All Files|*.*'
- 'Image Files|*.png;*.jpg|Png Files|*.png|Jepg Files|*.jpg'
- */
- string filters;
- /*!
- The title for the dialog.
- */
- string title;
- /*!
- True/False whether to set the working directory to the directory returned by the dialog.
- */
- bool changePath;
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief Derived from FileDialog, this class is responsible for opening a file browser with the intention of opening a file.
- The core usage of this dialog is to locate a file in the OS and return the path and name. This does not handle the actual file parsing or data manipulation. That functionality is left up to the FileObject class.
- @tsexample
- // Create a dialog dedicated to opening files
- %openFileDlg = new OpenFileDialog()
- {
- // Look for jpg image files
- // First part is the descriptor|second part is the extension
- Filters = "Jepg Files|*.jpg";
- // Allow browsing through other folders
- ChangePath = true;
- // Only allow opening of one file at a time
- MultipleFiles = false;
- };
- // Launch the open file dialog
- %result = %openFileDlg.Execute();
- // Obtain the chosen file name and path
- if ( %result )
- {
- %seletedFile = %openFileDlg.file;
- }
- else
- {
- %selectedFile = "";
- }
- // Cleanup
- %openFileDlg.delete();
- @endtsexample
- @note FileDialog and its related classes are only availble in a Tools build of Torque.
- @see FileDialog
- @see SaveFileDialog
- @see FileObject
- @ingroup FileSystem
- */
- class OpenFileDialog : public FileDialog {
- public:
- /*!
- True/False whether the file returned must exist or not
- */
- bool MustExist;
- /*!
- True/False whether multiple files may be selected and returned or not
- */
- bool MultipleFiles;
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief Derived from FileDialog, this class is responsible for opening a file browser with the intention of saving a file.
- The core usage of this dialog is to locate a file in the OS and return the path and name. This does not handle the actual file writing or data manipulation. That functionality is left up to the FileObject class.
- @tsexample
- // Create a dialog dedicated to opening file
- %saveFileDlg = new SaveFileDialog()
- {
- // Only allow for saving of COLLADA files
- Filters = "COLLADA Files (*.dae)|*.dae|";
- // Default save path to where the WorldEditor last saved
- DefaultPath = $pref::WorldEditor::LastPath;
- // No default file specified
- DefaultFile = "";
- // Do not allow the user to change to a new directory
- ChangePath = false;
- // Prompt the user if they are going to overwrite an existing file
- OverwritePrompt = true;
- };
- // Launch the save file dialog
- %saveFileDlg.Execute();
- if ( %result )
- {
- %seletedFile = %openFileDlg.file;
- }
- else
- {
- %selectedFile = "";
- }
- // Cleanup
- %saveFileDlg.delete();
- @endtsexample
- @note FileDialog and its related classes are only availble in a Tools build of Torque.
- @see FileDialog
- @see OpenFileDialog
- @see FileObject
- @ingroup FileSystem
- */
- class SaveFileDialog : public FileDialog {
- public:
- /*!
- True/False whether the dialog should prompt before accepting an existing file name
- */
- bool OverwritePrompt;
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief OS level dialog used for browsing folder structures.
- This is essentially an OpenFileDialog, but only used for returning directory paths, not files.
- @note FileDialog and its related classes are only availble in a Tools build of Torque.
- @see OpenFileDialog for more details on functionality.
- @ingroup FileSystem
- */
- class OpenFolderDialog : public OpenFileDialog {
- public:
- /*!
- File that must be in selected folder for it to be valid
- */
- filename fileMustExist;
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A render bin for mesh rendering.
- This is the primary render bin in Torque which does most of the work of rendering DTS shapes and arbitrary mesh geometry. It knows how to render mesh instances using materials and supports hardware mesh instancing.
- @ingroup RenderBin
- */
- class RenderMeshMgr : public RenderBinManager {
- public:
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief Basically the same as RenderMeshMgr, but will override the material of the instance. Exists for backwards compatibility, not currently used, soon to be deprecated
- */
- class ForcedMaterialMeshMgr : public RenderMeshMgr {
- public:
- /*!
- Material used to draw all meshes in the render bin.
- */
- Material Material;
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A render bin for forest rendering.
- Do not mess with it if you value your life.@ingroup RenderBin
- */
- class RenderForestMgr : public RenderBinManager {
- public:
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A render bin for batch rendering imposters.
- This render bin gathers imposter render instances and renders them in large batches.
- You can type 'metrics( imposter )' in the console to see rendering statistics.
- @ingroup RenderBin
- */
- class RenderImposterMgr : public RenderBinManager {
- public:
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A render bin which renders occlusion query requests.
- This render bin gathers occlusion query render instances and renders them. It is currently used by light flares and ShapeBase reflection cubemaps.
- You can type '$RenderOcclusionMgr::debugRender = true' in the console to see debug rendering of the occlusion geometry.
- @ingroup RenderBin
- */
- class RenderOcclusionMgr : public RenderBinManager {
- public:
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A render bin which renders particle geometry.
- This render bin gathers particle render instances, sorts, and renders them. It is currently used by ParticleEmitter and LightFlareData.
- @ingroup RenderBin
- */
- class RenderParticleMgr : public RenderTexTargetBinManager {
- public:
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A non-rendering render bin used to enable/disable a RenderPassStateToken.
- This is a utility RenderBinManager which does not render any render instances. Its only used to define a point in the render bin order at which a RenderPassStateToken is triggered.
- @see RenderPassStateToken
- @ingroup RenderBin
- */
- class RenderPassStateBin : public RenderBinManager {
- public:
- /*!
- */
- RenderPassStateToken stateToken;
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class RenderSelectionMgr : public RenderTexTargetBinManager {
- public:
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A render bin for terrain mesh rendering.
- This bin renders terrain render instances from a TerrainBlock. Normally a mesh would render via the RenderMeshMgr, but terrain uses a TerrainMaterial designed for multi-layered surfaces which this bin can processs.
- @ingroup RenderBin
- */
- class RenderTerrainMgr : public RenderBinManager {
- public:
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A render bin for rendering translucent meshes.
- This bin is used to render translucent render mesh instances and render object instances. It is generally ordered late in the RenderPassManager after all opaque geometry bins.
- @ingroup RenderBin
- */
- class RenderTranslucentMgr : public RenderBinManager {
- public:
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A datablock which defines performance and quality properties for dynamic reflections.
- ReflectorDesc is not itself a reflection and does not render reflections. It is a dummy class for holding and exposing to the user a set of reflection related properties. Objects which support dynamic reflections may then reference a ReflectorDesc.
- @tsexample
- datablock ReflectorDesc( ExampleReflectorDesc )
- {
- texSize = 256;
- nearDist = 0.1;
- farDist = 500;
- objectTypeMask = 0xFFFFFFFF;
- detailAdjust = 1.0;
- priority = 1.0;
- maxRateMs = 0;
- useOcclusionQuery = true;
- };
- @endtsexample
- @see ShapeBaseData::cubeReflectorDesc
- */
- class ReflectorDesc : public SimDataBlock {
- public:
- /*! @name ReflectorDesc
- @{ */
- /*! */
- /*!
- Size in pixels of the (square) reflection texture. For a cubemap this value is interpreted as size of each face.
- */
- int texSize;
- /*!
- Near plane distance to use when rendering this reflection. Adjust this to limit self-occlusion artifacts.
- */
- float nearDist;
- /*!
- Far plane distance to use when rendering reflections.
- */
- float farDist;
- /*!
- Object types which render into this reflection.
- */
- int objectTypeMask;
- /*!
- Scale applied to lod calculation of objects rendering into this reflection ( modulates $pref::TS::detailAdjust ).
- */
- float detailAdjust;
- /*!
- Priority for updating this reflection, relative to others.
- */
- float priority;
- /*!
- If less than maxRateMs has elapsed since this relfection was last updated, then do not update it again. This 'skip' can be disabled by setting maxRateMs to zero.
- */
- int maxRateMs;
- /*!
- If available on the device use HOQs to determine if the reflective object is visible before updating its reflection.
- */
- bool useOcclusionQuery;
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A datablock describing a playback pattern of sounds.
- Playlists allow to define intricate playback patterns of invidual tracks and thus allow the sound system to be easily used for playing multiple sounds in single operations.
- As playlists are %SFXTracks, they can thus be used anywhere in the engine where sound data can be assigned.
- Each playlist can hold a maximum of 16 tracks. Longer playlists may be constructed by cascading lists, i.e. by creating a playlist that references other playlists.
- Processing of a single playlist slot progresses in a fixed set of steps that are invariably iterated through for each slot (except the slot is assigned a state and its state is deactivated; in this case, the controller will exit out of the slot directly):
- <ol>
- <li><b>delayIn:</b><p>Waits a set amount of time before processing the slot. This is 0 by default and is determined by the #delayTimeIn (seconds to wait) and #delayTimeInVariance (bounds on randomization) properties.</p></li>
- <li><b>#transitionIn:</b><p>Decides what to do @b before playing the slot. Defaults to @c None which makes this stage a no-operation. Alternatively, the slot can be configured to wait for playback of other slots to finish (@c Wait and @c WaitAll) or to stop playback of other slots (@c Stop and @c StopAll). Note that @c Wait and @c Stop always refer to the source that was last started by the list.</p></li>
- <li><b>play:</b><p><p>Finally, the #track attached to the slot is played. However, this will only @b start playback of the track and then immediately move on to the next stage. It will @b not wait for the track to finish playing. Note also that depending on the @c replay setting for the slot, this stage may pick up a source that is already playing on the slot rather than starting a new one.</p> <p>Several slot properties (fade times, min/max distance, and volume/pitch scale) are used in this stage.</p></li>
- <li><b>delayOut:</b><p>Waits a set amount of time before transitioning out of the slot. This works the same as @c delayIn and is set to 0 by default (i.e. no delay).</p></li>
- <li><b>#transitionOut:</b><p>Decides what to do @b after playing the slot. This works like #transitionIn.</p></li>
- </ol>
- This is a key difference to playlists in normal music players where upon reaching a certain slot, the slot will immediately play and the player then wait for playback to finish before moving on to the next slot.
- @note Be aware that time limits set on slot delays are soft limits. The sound system updates sound sources in discrete (and equally system update frequency dependent) intervals which thus determines the granularity at which time-outs can be handled.
- @section SFXPlayList_randomization Value Randomization
- For greater variety, many of the values for individual slots may be given a randomization limit that will trigger a dynamic variance of the specified base value.
- Any given field @c xyz that may be randomized has a corresponding field @c xyzVariance which is a two-dimensional vector. The first number specifies the greatest value that may be subtracted from the given base value (i.e. the @c xyz field) whereas the second number specifies the greatest value that may be added to the base value. Between these two limits, a random number is generated.
- The default variance settings of "0 0" will thus not allow to add or subtract anything from the base value and effectively disable randomization.
- Randomization is re-evaluated on each cycle through a list.
- @section SFXPlayList_states Playlists and States
- A unique aspect of playlists is that they allow their playback to be tied to the changing set of active sound states. This feature enables playlists to basically connect to an extensible state machine that can be leveraged by the game code to signal a multitude of different gameplay states with the audio system then automatically reacting to state transitions.
- Playlists react to states in three ways:
- - Before a controller starts processing a slot it checks whether the slot is assigned a #state. If this is the case, the controller checks whether the particular state is active. If it is not, the entire slot is skipped. If it is, the controller goes on to process the slot.
- - If a controller is in one of the delay stages for a slot that has a #state assigned and the state is deactivated, the controller will stop the delay and skip any of the remaining processing stages for the slot.
- - Once the play stage has been processed for a slot that has a #state assigned, the slot's #stateMode will determine what happens with the playing sound source if the slot's state is deactivated while the sound is still playing.
- A simple example of how to make use of states in combination with playlists would be to set up a playlist for background music that reacts to the mood of the current gameplay situation. For example, during combat, tenser music could play than during normal exploration. To set this up, different %SFXStates would represent different moods in the game and the background music playlist would have one slot set up for each such mood. By making use of volume fades and the @c PauseWhenDeactivated #stateMode, smooth transitions between the various audio tracks can be produced.
- @tsexample
- // Create a play list from two SFXProfiles.
- %playList = new SFXPlayList()
- {
- // Use a looped description so the list playback will loop.
- description = AudioMusicLoop2D;
- track[ 0 ] = Profile1;
- track[ 1 ] = Profile2;
- };
- // Play the list.
- sfxPlayOnce( %playList );
- @endtsexample
- @ref SFX_interactive
- */
- class SFXPlayList : public SFXTrack {
- public:
- /*! @name Sound
- @{ */
- /*! */
- /*!
- Slot playback order randomization pattern.
- By setting this field to something other than "NotRandom" to order in which slots of the playlist are processed can be changed from sequential to a random pattern. This allows to to create more varied playback patterns.
- Defaults to "NotRandom".
- */
- SFXPlayListRandomMode random;
- /*!
- Behavior when description has looping enabled.
- The loop mode determines whether the list will loop over a single slot or loop over all the entire list of slots being played.
- @see SFXDescription::isLooping
- */
- SFXPlayListLoopMode loopMode;
- /*!
- Number of slots to play.
- Up to a maximum of 16, this field determines the number of slots that are taken from the list for playback. Only slots that have a valid #track assigned will be considered for this.
- */
- int numSlotsToPlay;
- /*!
- Track to play in this slot.
- This must be set for the slot to be considered for playback. Other settings for a slot will not take effect except this field is set.
- */
- SFXTrack track;
- /*!
- Behavior when an already playing sound is encountered on this slot from a previous cycle.
- Each slot can have an arbitrary number of sounds playing on it from previous cycles. This field determines how SFXController will handle these sources.
- */
- SFXPlayListReplayMode replay;
- /*!
- Behavior when moving into this slot.
- After the delayIn time has expired (if any), this slot determines what the controller will do before actually playing the slot.
- */
- SFXPlayListTransitionMode transitionIn;
- /*!
- Behavior when moving out of this slot.
- After the #detailTimeOut has expired (if any), this slot determines what the controller will do before moving on to the next slot.
- */
- SFXPlayListTransitionMode transitionOut;
- /*!
- Seconds to wait after moving into slot before #transitionIn.
- */
- float delayTimeIn;
- /*!
- Bounds on randomization of #delayTimeIn.
- @ref SFXPlayList_randomization
- */
- Point2F delayTimeInVariance;
- /*!
- Seconds to wait before moving out of slot after #transitionOut.
- */
- float delayTimeOut;
- /*!
- Bounds on randomization of #delayTimeOut.
- @ref SFXPlayList_randomization
- */
- Point2F delayTimeOutVariance;
- /*!
- Seconds to fade sound in (-1 to use the track's own fadeInTime.)
- @see SFXDescription::fadeTimeIn
- */
- float fadeTimeIn;
- /*!
- Bounds on randomization of #fadeInTime.
- @ref SFXPlayList_randomization
- */
- Point2F fadeTimeInVariance;
- /*!
- Seconds to fade sound out (-1 to use the track's own fadeOutTime.)
- @see SFXDescription::fadeTimeOut
- */
- float fadeTimeOut;
- /*!
- Bounds on randomization of #fadeOutTime
- @ref SFXPlayList_randomization
- */
- Point2F fadeTimeOutVariance;
- /*!
- @c referenceDistance to set for 3D sounds in this slot (<1 to use @c referenceDistance of track's own description).
- @see SFXDescription::referenceDistance
- */
- float referenceDistance;
- /*!
- Bounds on randomization of #referenceDistance.
- @ref SFXPlayList_randomization
- */
- Point2F referenceDistanceVariance;
- /*!
- @c maxDistance to apply to 3D sounds in this slot (<1 to use @c maxDistance of track's own description).
- @see SFXDescription::maxDistance
- */
- float maxDistance;
- /*!
- Bounds on randomization of #maxDistance.
- @ref SFXPlayList_randomization
- */
- Point2F maxDistanceVariance;
- /*!
- Scale factor to apply to volume of sounds played on this list slot.
- This value will scale the actual volume level set on the track assigned to the slot, i.e. a value of 0.5 will cause the track to play at half-volume.
- */
- float volumeScale;
- /*!
- Bounds on randomization of #volumeScale.
- @ref SFXPlayList_randomization
- */
- Point2F volumeScaleVariance;
- /*!
- Scale factor to apply to pitch of sounds played on this list slot.
- This value will scale the actual pitch set on the track assigned to the slot, i.e. a value of 0.5 will cause the track to play at half its assigned speed.
- */
- float pitchScale;
- /*!
- Bounds on randomization of #pitchScale.
- @ref SFXPlayList_randomization
- */
- Point2F pitchScaleVariance;
- /*!
- Number of times to loop this slot.
- */
- int repeatCount;
- /*!
- State that must be active for this slot to play.
- @ref SFXPlayList_states
- */
- SFXState state;
- /*!
- Behavior when assigned state is deactivated while slot is playing.
- @ref SFXPlayList_states
- */
- SFXPlayListStateMode stateMode;
- /// @}
- /*! @name Debug
- @{ */
- /*! */
- /*!
- Enable/disable execution tracing for this playlist (local only).
- If this is true, SFXControllers attached to the list will automatically run in trace mode.
- */
- bool trace;
- /// @}
- /*! @name Sound
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A playable sound event in an FMOD Designer audio project.
- @ingroup SFXFMOD
- */
- class SFXFMODEvent : public SFXTrack {
- public:
- /*! @name DO NOT MODIFY!!
- @{ */
- /*! */
- /*!
- DO NOT MODIFY!!
- */
- SFXFMODEventGroup fmodGroup;
- /*!
- DO NOT MODIFY!!
- */
- string fmodName;
- /*!
- DO NOT MODIFY!!
- */
- Point2F fmodParameterRanges;
- /*!
- DO NOT MODIFY!!
- */
- float fmodParameterValues;
- /// @}
- /*! @name Sound
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A sound source controller playing an %FMOD Designer event (SFXFMODEvent).
- %FMOD event sources are internally created by the sound system to play events from imported %FMOD Designer projects.
- @note This class cannot be instantiated directly by the user. Instead, instances of SFXFMODEventSource will be implicitly created by the sound system when playing an SFXFMODEvent.
- @ingroup SFXFMOD
- */
- class SFXFMODEventSource : public SFXSource {
- public:
- /*! @name Sound
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief An FMOD Designer project loaded into Torque.
- @section SFXFMODProject_resources Resource Loading
- @ingroup SFXFMOD
- */
- class SFXFMODProject : public SimDataBlock {
- public:
- /*! @name FMOD
- @{ */
- /*! */
- /*!
- The compiled .fev file from FMOD Designer.
- */
- filename fileName;
- /*!
- Path to the media files; if unset, defaults to project directory.
- */
- filename mediaPath;
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief Internal event used for transmitting strings across the server.
- For internal use only, not intended for TorqueScript or game development
- @internal
- */
- class NetStringEvent {
- public:
- };
- class UnitToClientEvent {
- public:
- };
- /*!
- @brief This event is used inside by the connection and subclasses to message itself when sequencing events occur.
- Not intended for game development, for editors or internal use only.
- */
- class ConnectionMessageEvent {
- public:
- };
- /*!
- @brief Legacy or soon to be locked down object.
- Not intended for game development, for editors or internal use only.
- */
- class GhostAlwaysObjectEvent {
- public:
- };
- class HouseConvexShape : public ConvexShape {
- public:
- /*! @name Rendering
- @{ */
- /*! */
- /// @}
- /*! @name Internal
- @{ */
- /*! */
- /// @}
- /*! @name AFX
- @{ */
- /*! */
- /// @}
- /*! @name Transform
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Mounting
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class TerFallEvent {
- public:
- };
- /*!
- @brief The TerrainMaterial class orginizes the material settings for a single terrain material layer.
- @note You should not be creating TerrainMaterials by hand in code. All TerrainMaterials should be created in the editors, as intended by the system.
- @tsexample
- // Created by the Terrain Painter tool in the World Editor
- new TerrainMaterial()
- {
- internalName = "grass1";
- diffuseMap = "art/terrains/Test/grass1";
- detailMap = "art/terrains/Test/grass1_d";
- detailSize = "10";
- isManaged = "1";
- detailBrightness = "1";
- Enabled = "1";
- diffuseSize = "200";
- };
- @endtsexample
- @see Materials
- @ingroup enviroMisc
- */
- class TerrainMaterial : public SimObject {
- public:
- /*!
- Base texture for the material
- */
- filename diffuseMap;
- /*!
- Used to scale the diffuse map to the material square
- */
- float diffuseSize;
- /*!
- Bump map for the material
- */
- filename normalMap;
- /*!
- Detail map for the material
- */
- filename detailMap;
- /*!
- Used to scale the detail map to the material square
- */
- float detailSize;
- /*!
- Exponentially sharpens or lightens the detail map rendering on the material
- */
- float detailStrength;
- /*!
- Changes how far camera can see the detail map rendering on the material
- */
- float detailDistance;
- /*!
- Makes that terrain material project along the sides of steep slopes instead of projected downwards
- */
- bool useSideProjection;
- /*!
- Used to scale the height from the normal map to give some self occlusion effect (aka parallax) to the terrain material
- */
- float parallaxScale;
- /*!
- */
- ColorI proxyColor;
- /*!
- */
- ColorI mapColor;
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief An event which signals the editors to undo the last action
- Not intended for game development, for editors or internal use only.
- */
- class UndoAction : public SimObject {
- public:
- /*! action.addToManager([undoManager]) */
- virtual void addToManager() {}
- /*! Undo action contained in undo. */
- virtual void undo(()) {}
- /*! Reo action contained in undo. */
- virtual void redo(()) {}
- /*!
- A brief description of the action, for UI representation of this undo/redo action.
- */
- string actionName;
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief Undo actions which can be created as script objects.
- Not intended for game development, for editors or internal use only.
- */
- class UndoScriptAction : public UndoAction {
- public:
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class AwShape : public TSStatic {
- public:
- virtual void execJavaScript(( string script )) {}
- /*! @name Media
- @{ */
- /*! */
- /// @}
- /*! @name Rendering
- @{ */
- /*! */
- /// @}
- /*! @name Collision
- @{ */
- /*! */
- /// @}
- /*! @name Debug
- @{ */
- /*! */
- /// @}
- /*! @name AFX
- @{ */
- /*! */
- /// @}
- /*! @name Transform
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Mounting
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class AwTextureTarget : public SimObject {
- public:
- virtual void execJavaScript(( string script )) {}
- virtual void reload(()) {}
- /*!
- The URL which is loaded initially.
- */
- string StartURL;
- /*!
- Name of the texture target. The texture name can be used in materials to reference this AwTextureTarget.
- */
- string TextureTargetName;
- /*!
- The amount of frames per second to render. 0 means unlimited.
- */
- char Framerate;
- /*!
- Resolution. Defaults to (640, 480).
- */
- Point2I Resolution;
- /*!
- The bitmap which is used as a cursor. A default cursor will be used if none is set.
- */
- string CursorBitmap;
- /*!
- Tells this AwTextureTarget to only generate a single frame. This consumes much less resources than a regular AwTextureTarget. Default: Disabled
- */
- bool IsSingleFrame;
- /*!
- If set, enables the bitmap cache. This cache is useful when the webpage is loading and you want the user to see something right away.
- */
- bool UseBitmapCache;
- /*!
- Forces the BitmapCache filename instead of letting the system chose a filename automatically.
- */
- string BitmapCachePath;
- /*!
- The sound profile to play when gaining mouse input.
- */
- SFXTrack OnGainMouseInputSound;
- /*!
- The sound profile to play when losing mouse input.
- */
- SFXTrack OnLoseMouseInputSound;
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class ERenderMan {
- public:
- /*! const char* GFXFormat */
- virtual void setFormat() {}
- };
- class EnvInterpolator : public SceneObject {
- public:
- virtual void setInterpolationEnabled((bool enabled)) {}
- virtual void toggleInterpolationEnabled() {}
- virtual void toggleApplyMode() {}
- virtual void reset() {}
- virtual void setCurrentValuesToGlobalObjects() {}
- /*! SimId envDataBlock */
- virtual void createSampleFromGlobalObjectValue() {}
- /*! S32 elevation */
- virtual void debugOverrideElevation() {}
- virtual void debugDisableElevationOverride() {}
- /*! const char* weather */
- virtual void debugSetWeather() {}
- virtual void debugPrintCurrentWeather() {}
- /*! @name Transform
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Mounting
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class GuiColorCurveEditor : public GuiControl {
- public:
- virtual void colorPickerApply() {}
- virtual void colorPickerUpdate() {}
- virtual void colorPickerCancel() {}
- virtual void setField((S32 EnvDataBlockId, U32 field)) {}
- /*!
- Range of domain
- */
- Point2F domainRange;
- /*!
- Size of handles in pixels.
- */
- int sampleSize;
- /*!
- Precision of text output
- */
- int precision;
- /*!
- Cycle edge sample
- */
- bool cycleSample;
- /*!
- Color for current position handle.
- */
- ColorI positionHandleColor;
- /*!
- Color for current position handle.
- */
- ColorI activeSampleColor;
- /*!
- */
- string positionVariable;
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class GuiCurveEditor : public GuiControl {
- public:
- virtual void sampleEditorApply() {}
- virtual void sampleEditorCancel() {}
- virtual void setField((S32 EnvDataBlockId, U32 field)) {}
- /*!
- Range of domain
- */
- Point2F domainRange;
- /*!
- Range of value.
- */
- Point2F valueRange;
- /*!
- x - domain step, y - value step
- */
- Point2F gridStep;
- /*!
- Size of handles in pixels.
- */
- int sampleSize;
- /*!
- Precision of output
- */
- Point2I precision;
- /*!
- Cycle edge sample
- */
- bool cycleSample;
- /*!
- Color for grid axis line.
- */
- ColorI gridCenterColor;
- /*!
- Color for grid line.
- */
- ColorI gridColor;
- /*!
- Color for samples.
- */
- ColorI sampleColor;
- /*!
- Color for active samples.
- */
- ColorI activeSampleColor;
- /*!
- Color for curve.
- */
- ColorI curveColor;
- /*!
- Color for current position handle.
- */
- ColorI positionHandleColor;
- /*!
- */
- string positionVariable;
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class GuiMapCtrl : public GuiControl {
- public:
- virtual void centerToPlayer() {}
- virtual void zoomIn() {}
- virtual void zoomOut() {}
- /*! @name Lighting
- @{ */
- /*! */
- /*!
- */
- float sunAzimuth;
- /*!
- */
- float sunElevation;
- /*!
- */
- ColorF sunColor;
- /*!
- */
- float sunBrightness;
- /*!
- */
- ColorF ambientColor;
- /*!
- */
- float ambientBrightness;
- /// @}
- /*! @name Limits
- @{ */
- /*! */
- /*!
- */
- float minZoom;
- /*!
- */
- float maxZoom;
- /*!
- */
- float minHorScroll;
- /*!
- */
- float maxHorScroll;
- /*!
- */
- float minVertScroll;
- /*!
- */
- float maxVertScroll;
- /*!
- */
- float maxPositionChange;
- /// @}
- /*! @name Paths
- @{ */
- /*! */
- /*!
- */
- filename terrainPath;
- /// @}
- /*! @name PlayerIcon
- @{ */
- /*! */
- /*!
- */
- filename playerIcon;
- /*!
- */
- Point2I playerIconSize;
- /// @}
- /*! @name Misc
- @{ */
- /*! */
- /*!
- */
- float terrainHeightScale;
- /*!
- */
- float terrainZBase;
- /*!
- */
- int terrainSize;
- /*!
- */
- float unloadZoneTickRate;
- /*!
- */
- ColorF waterColor;
- /*!
- */
- float waterHeight;
- /*!
- */
- ColorF overlayColor;
- /// @}
- /*! @name LastDetails
- @{ */
- /*! */
- /*!
- */
- int maxZoneCount;
- /*!
- */
- filename lastDetailFile;
- /*!
- */
- Point2I lastDetailSize;
- /// @}
- /*! @name Gradient
- @{ */
- /*! */
- /*!
- */
- bool useGradientTex;
- /*!
- */
- filename gradientTexPath;
- /*!
- */
- float minGradientHeight;
- /*!
- */
- float maxGradientHeight;
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class ZoneGroup : public SimGroup {
- public:
- virtual int getZoneId() {}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- /*! @name Geo
- @{ */
- /*! */
- /*!
- */
- int zoneID;
- /// @}
- };
- /*!
- @ingroup gameObjects
- */
- class Player : public ShapeBase {
- public:
- virtual Script onUnmount(( string this, string obj )) {}
- virtual Script onHitOccured(( string this, string direction )) {}
- virtual Script playDeathAnimation(( string this )) {}
- virtual Script playPain(( string this )) {}
- virtual Script playDeathCry(( string this )) {}
- virtual int getGuildID(()) {}
- virtual void finishDismount(()) {}
- virtual void startDismount(()) {}
- virtual void forceDismount(()) {}
- /*! @brief Get the name of the player's current state.
- The state is one of the following:
- <ul><li>Dead - The Player is dead.</li><li>Mounted - The Player is mounted to an object such as a vehicle.</li><li>Move - The Player is free to move. The usual state.</li><li>Recover - The Player is recovering from a fall. See PlayerData::recoverDelay.</li></ul>
- @return The current state; one of: "Dead", "Mounted", "Move", "Recover"
- */
- virtual string getState(()) {}
- /*! @brief Set the sequence that controls the player's arms (dynamically adjusted to match look direction).
- @param name Name of the sequence to play on the player's arms.
- @return true if successful, false if failed.
- @note By default the 'look' sequence is used, if available.
- */
- virtual bool setArmThread(( string name )) {}
- /*! @brief Set the main action sequence to play for this player.
- @param name Name of the action sequence to set
- @param hold Set to false to get a callback on the datablock when the sequence ends (PlayerData::animationDone()). When set to true no callback is made.
- @param fsp True if first person and none of the spine nodes in the shape should animate. False will allow the shape's spine nodes to animate.
- @return True if succesful, false if failed
- @note The spine nodes for the Player's shape are named as follows:
- <ul><li>Bip01 Pelvis</li><li>Bip01 Spine</li><li>Bip01 Spine1</li><li>Bip01 Spine2</li><li>Bip01 Neck</li><li>Bip01 Head</li></ul>
- You cannot use setActionThread() to have the Player play one of the motion determined action animation sequences. These sequences are chosen based on how the Player moves and the Player's current pose. The names of these sequences are:
- <ul><li>root</li><li>run</li><li>side</li><li>side_right</li><li>swim_root</li><li>swim_forward</li><li>swim_backward</li><li>swim_left</li><li>swim_right</li><li>fall</li><li>jump</li><li>standjump</li><li>land</li><li>jet</li></ul>
- If the player moves in any direction then the animation sequence set using this method will be cancelled and the chosen mation-based sequence will take over. This makes great for times when the Player cannot move, such as when mounted, or when it doesn't matter if the action sequence changes, such as waving and saluting.
- @tsexample
- // Place the player in a sitting position after being mounted
- %player.setActionThread( "sitting", true, true );
- @endtsexample
- */
- virtual bool setActionThread(( string name, bool hold=false, bool fsp=true )) {}
- /*! @brief Set the object to be controlled by this player
- It is possible to have the moves sent to the Player object from the GameConnection to be passed along to another object. This happens, for example when a player is mounted to a vehicle. The move commands pass through the Player and on to the vehicle (while the player remains stationary within the vehicle). With setControlObject() you can have the Player pass along its moves to any object. One possible use is for a player to move a remote controlled vehicle. In this case the player does not mount the vehicle directly, but still wants to be able to control it.
- @param obj Object to control with this player
- @return True if the object is valid, false if not
- @see getControlObject()
- @see clearControlObject()
- @see GameConnection::setControlObject() */
- virtual bool setControlObject(( ShapeBase obj )) {}
- /*! @brief Get the current object we are controlling.
- @return ID of the ShapeBase object we control, or 0 if not controlling an object.
- @see setControlObject()
- @see clearControlObject() */
- virtual int getControlObject(()) {}
- /*! @brief Clears the player's current control object.
- Returns control to the player. This internally calls Player::setControlObject(0).
- @tsexample
- %player.clearControlObject();
- echo(%player.getControlObject()); //<-- Returns 0, player assumes control
- %player.setControlObject(%vehicle);
- echo(%player.getControlObject()); //<-- Returns %vehicle, player controls the vehicle now.
- @endtsexample
- @note If the player does not have a control object, the player will receive all moves from its GameConnection. If you're looking to remove control from the player itself (i.e. stop sending moves to the player) use GameConnection::setControlObject() to transfer control to another object, such as a camera.
- @see setControlObject()
- @see getControlObject()
- @see GameConnection::setControlObject()
- */
- virtual void clearControlObject(()) {}
- /*! @brief Check if it is safe to dismount at this position.
- Internally this method casts a ray from oldPos to pos to determine if it hits the terrain, an interior object, a water object, another player, a static shape, a vehicle (exluding the one currently mounted), or physical zone. If this ray is in the clear, then the player's bounding box is also checked for a collision at the pos position. If this displaced bounding box is also in the clear, then checkDismountPoint() returns true.
- @param oldPos The player's current position
- @param pos The dismount position to check
- @return True if the dismount position is clear, false if not
- @note The player must be already mounted for this method to not assert.
- */
- virtual bool checkDismountPoint(( Point3F oldPos, Point3F pos )) {}
- /*! isAnimationLocked() */
- virtual bool isAnimationLocked() {}
- /*! setLookAnimationOverride(flag) */
- virtual void setLookAnimationOverride() {}
- /*! copyHeadRotation(other_player) */
- virtual void copyHeadRotation() {}
- /*! setMovementSpeedBias(F32 bias) */
- virtual void setMovementSpeedBias() {}
- virtual void dumpCharacterDataStr(()) {}
- /*! */
- void onHitOccured( VectorF direction );
- /*! @name Game
- @{ */
- /*! */
- /// @}
- /*! @name Transform
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Mounting
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief AI_Animal controls the behavior of all animals in the game.
- The AI_Animal provides an object that may be controlled from script. The AI_Animal class does not have a datablock of its own. It makes use of the PlayerData datablock to define how it looks, etc. As the AI_Animal is an extension of the Player class it can mount objects and fire weapons, or mount vehicles and drive them.
- @see AI_Animal for a list of all inherited functions, variables, and base description
- @ingroup AI
- @ingroup gameObjects
- */
- class AI_Animal : public Player {
- public:
- /*! @brief Tells the AI to move to the location provided
- @param goal Coordinates in world space representing location to move to.
- @note Upon reaching a move destination, the bot will clear its move destination and calls to getMoveDestination will return "0 0 0".@see getMoveDestination()
- */
- virtual void addMoveDestination(( Point3F goal )) {}
- /*! @brief Tells the AI to move to the location provided
- @param goal Coordinates in world space representing location to move to.
- @note Upon reaching a move destination, the bot will clear its move destination and calls to getMoveDestination will return "0 0 0".@see getMoveDestination()
- */
- virtual void moveTo(( Point3F goal )) {}
- /*! @brief Tells the AI to follow the default Player
- */
- virtual void followPlayer(()) {}
- /*! @brief Tells the AI to stop following anybody
- */
- virtual void unfollow(()) {}
- /*! @brief Tells the AI to follow the default Player
- */
- virtual void huntPlayer(()) {}
- /*! @brief Tells the AI to follow the default Player
- */
- virtual void Intimidate(()) {}
- /*! @brief Tells the AI to print its status
- */
- virtual void printStatus(()) {}
- /*! @brief Set_state
- */
- virtual void Set_state(( int state_number )) {}
- /*! @name Game
- @{ */
- /*! */
- /// @}
- /*! @name Transform
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Mounting
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A Player object not controlled by conventional input, but by an AI engine.
- The AIPlayer provides a Player object that may be controlled from script. You control where the player moves and how fast. You may also set where the AIPlayer is aiming at -- either a location or another game object.
- The AIPlayer class does not have a datablock of its own. It makes use of the PlayerData datablock to define how it looks, etc. As the AIPlayer is an extension of the Player class it can mount objects and fire weapons, or mount vehicles and drive them.
- While the PlayerData datablock is used, there are a number of additional callbacks that are implemented by AIPlayer on the datablock. These are listed here:
- void onReachDestination(AIPlayer obj)
- Called when the player has reached its set destination using the setMoveDestination() method. The actual point at which this callback is called is when the AIPlayer is within the mMoveTolerance of the defined destination.
- void onMoveStuck(AIPlayer obj)
- While in motion, if an AIPlayer has moved less than moveStuckTolerance within a single tick, this callback is called. From here you could choose an alternate destination to get the AIPlayer moving again.
- void onTargetEnterLOS(AIPlayer obj)
- When an object is being aimed at (following a call to setAimObject()) and the targeted object enters the AIPlayer's line of sight, this callback is called. The LOS test is a ray from the AIPlayer's eye position to the center of the target's bounding box. The LOS ray test only checks against interiors, statis shapes, and terrain.
- void onTargetExitLOS(AIPlayer obj)
- When an object is being aimed at (following a call to setAimObject()) and the targeted object leaves the AIPlayer's line of sight, this callback is called. The LOS test is a ray from the AIPlayer's eye position to the center of the target's bounding box. The LOS ray test only checks against interiors, statis shapes, and terrain.
- @tsexample
- // Create the demo player object
- %player = new AiPlayer()
- {
- dataBlock = DemoPlayer;
- path = "";
- };
- @endtsexample
- @see Player for a list of all inherited functions, variables, and base description
- @ingroup AI
- @ingroup gameObjects
- */
- class AIPlayer : public Player {
- public:
- /*! @brief Tells the AIPlayer to stop moving.
- */
- virtual void stop(()) {}
- /*! @brief Use this to stop aiming at an object or a point.
- @see setAimLocation()
- @see setAimObject()
- */
- virtual void clearAim(()) {}
- /*! @brief Sets the move speed for an AI object.
- @param speed A speed multiplier between 0.0 and 1.0. This is multiplied by the AIPlayer's base movement rates (as defined in its PlayerData datablock)
- @see getMoveDestination()
- */
- virtual void setMoveSpeed(( float speed )) {}
- /*! @brief Tells the AI to move to the location provided
- @param goal Coordinates in world space representing location to move to.
- @param slowDown A boolean value. If set to true, the bot will slow down when it gets within 5-meters of its move destination. If false, the bot will stop abruptly when it reaches the move destination. By default, this is true.
- @note Upon reaching a move destination, the bot will clear its move destination and calls to getMoveDestination will return "0 0 0".@see getMoveDestination()
- */
- virtual void setMoveDestination(( Point3F goal, bool slowDown=true )) {}
- /*! @brief Get the AIPlayer's current destination.
- @return Returns a point containing the "x y z" position of the AIPlayer's current move destination. If no move destination has yet been set, this returns "0 0 0".@see setMoveDestination()
- */
- virtual string getMoveDestination(()) {}
- /*! @brief Tells the AIPlayer to aim at the location provided.
- @param target An "x y z" position in the game world to target.
- @see getAimLocation()
- */
- virtual void setAimLocation(( Point3F target )) {}
- /*! @brief Returns the point the AIPlayer is aiming at.
- This will reflect the position set by setAimLocation(), or the position of the object that the bot is now aiming at. If the bot is not aiming at anything, this value will change to whatever point the bot's current line-of-sight intercepts.@return World space coordinates of the object AI is aiming at. Formatted as "X Y Z".
- @see setAimLocation()
- @see setAimObject()
- */
- virtual string getAimLocation(()) {}
- /*! Sets the bot's target object. Optionally set an offset from target location.@hide */
- virtual void setAimObject(( GameBase obj, [Point3F offset] )) {}
- /*! @brief Gets the object the AIPlayer is targeting.
- @return Returns -1 if no object is being aimed at, or the SimObjectID of the object the AIPlayer is aiming at.
- @see setAimObject()
- */
- virtual int getAimObject(()) {}
- /*! @name AI
- @{ */
- /*! */
- /*!
- @brief Distance from destination before stopping.
- When the AIPlayer is moving to a given destination it will move to within this distance of the destination and then stop. By providing this tolerance it helps the AIPlayer from never reaching its destination due to minor obstacles, rounding errors on its position calculation, etc. By default it is set to 0.25.
- */
- float mMoveTolerance;
- /*!
- @brief Distance tolerance on stuck check.
- When the AIPlayer is moving to a given destination, if it ever moves less than this tolerance during a single tick, the AIPlayer is considered stuck. At this point the onMoveStuck() callback is called on the datablock.
- */
- float moveStuckTolerance;
- /*!
- @brief The number of ticks to wait before testing if the AIPlayer is stuck.
- When the AIPlayer is asked to move, this property is the number of ticks to wait before the AIPlayer starts to check if it is stuck. This delay allows the AIPlayer to accelerate to full speed without its initial slow start being considered as stuck.
- @note Set to zero to have the stuck test start immediately.
- */
- int moveStuckTestDelay;
- /// @}
- /*! @name Game
- @{ */
- /*! */
- /// @}
- /*! @name Transform
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Mounting
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief Represents a position, direction and field of view to render a scene from.
- A camera is typically manipulated by a GameConnection. When set as the connection's control object, the camera handles all movement actions ($mvForwardAction, $mvPitch, etc.) just like a Player.
- @tsexample
- // Set an already created camera as the GameConnection's control object
- %connection.setControlObject(%camera);
- @endtsexample
- <h3>Methods of Operation</h3>
- The camera has two general methods of operation. The first is the standard mode where the camera starts and stops its motion and rotation instantly. This is the default operation of the camera and is used by most games. It may be specifically set with Camera::setFlyMode() for 6 DoF motion. It is also typically the method used with Camera::setOrbitMode() or one of its helper methods to orbit about a specific object (such as the Player's dead body) or a specific point.
- The second method goes under the name of Newton as it follows Newton's 2nd law of motion: F=ma. This provides the camera with an ease-in and ease-out feel for both movement and rotation. To activate this method for movement, either use Camera::setNewtonFlyMode() or set the Camera::newtonMode field to true. To activate this method for rotation, set the Camera::newtonRotation to true. This method of operation is not typically used in games, and was developed to allow for a smooth fly through of a game level while recording a demo video. But with the right force and drag settings, it may give a more organic feel to the camera to games that use an overhead view, such as a RTS.
- There is a third, minor method of operation but it is not generally used for games. This is when the camera is used with Torque's World Editor in Edit Orbit Mode. When set, this allows the camera to rotate about a specific point in the world, and move towards and away from this point. See Camera::setEditOrbitMode() and Camera::setEditOrbitPoint(). While in this mode, Camera::autoFitRadius() may also be used.
- @tsexample
- // Create a camera in the level and set its position to a given spawn point.
- // Note: The camera starts in the standard fly mode.
- %cam = new Camera() {
- datablock = "Observer";
- };
- MissionCleanup.add( %cam );
- %cam.setTransform( %spawnPoint.getTransform() );
- @endtsexample
- @tsexample
- // Create a camera at the given spawn point for the specified
- // GameConnection i.e. the client. Uses the standard
- // Sim::spawnObject() function to create the camera using the
- // defined default settings.
- // Note: The camera starts in the standard fly mode.
- function GameConnection::spawnCamera(%this, %spawnPoint)
- {
- // Set the control object to the default camera
- if (!isObject(%this.camera))
- {
- if (isDefined("$Game::DefaultCameraClass"))
- %this.camera = spawnObject($Game::DefaultCameraClass, $Game::DefaultCameraDataBlock);
- }
- // If we have a camera then set up some properties
- if (isObject(%this.camera))
- {
- // Make sure we're cleaned up when the mission ends
- MissionCleanup.add( %this.camera );
- // Make sure the camera is always in scope for the connection
- %this.camera.scopeToClient(%this);
- // Send all user input from the connection to the camera
- %this.setControlObject(%this.camera);
- if (isDefined("%spawnPoint"))
- {
- // Attempt to treat %spawnPoint as an object, such as a
- // SpawnSphere class.
- if (getWordCount(%spawnPoint) == 1 && isObject(%spawnPoint))
- {
- %this.camera.setTransform(%spawnPoint.getTransform());
- }
- else
- {
- // Treat %spawnPoint as an AngleAxis transform
- %this.camera.setTransform(%spawnPoint);
- }
- }
- }
- }
- @endtsexample
- <h3>Motion Modes</h3>
- Beyond the different operation methods, the Camera may be set to one of a number of motion modes. These motion modes determine how the camera will respond to input and may be used to constrain how the Camera moves. The CameraMotionMode enumeration defines the possible set of modes and the Camera's current may be obtained by using getMode().
- Some of the motion modes may be set using specific script methods. These often provide additional parameters to set up the mode in one go. Otherwise, it is always possible to set a Camera's motion mode using the controlMode property. Just pass in the name of the mode enum. The following table lists the motion modes, how to set them up, and what they offer:
- <table border='1' cellpadding='1'><tr><th>Mode</th><th>Set From Script</th><th>Input Move</th><th>Input Rotate</th><th>Can Use Newton Mode?</th></tr><tr><td>Stationary</td><td>controlMode property</td><td>No</td><td>No</td><td>No</td></tr><tr><td>FreeRotate</td><td>controlMode property</td><td>No</td><td>Yes</td><td>Rotate Only</td></tr><tr><td>Fly</td><td>setFlyMode()</td><td>Yes</td><td>Yes</td><td>Yes</td></tr><tr><td>OrbitObject</td><td>setOrbitMode()</td><td>Orbits object</td><td>Points to object</td><td>Move only</td></tr><tr><td>OrbitPoint</td><td>setOrbitPoint()</td><td>Orbits point</td><td>Points to location</td><td>Move only</td></tr><tr><td>TrackObject</td><td>setTrackObject()</td><td>No</td><td>Points to object</td><td>Yes</td></tr><tr><td>Overhead</td><td>controlMode property</td><td>Yes</td><td>No</td><td>Yes</td></tr><tr><td>EditOrbit (object selected)</td><td>setEditOrbitMode()</td><td>Orbits object</td><td>Points to object</td><td>Move only</td></tr><tr><td>EditOrbit (no object)</td><td>setEditOrbitMode()</td><td>Yes</td><td>Yes</td><td>Yes</td></tr></table>
- <h3>%Trigger Input</h3>
- Passing a move trigger ($mvTriggerCount0, $mvTriggerCount1, etc.) on to a Camera performs different actions depending on which mode the camera is in. While in Fly, Overhead or EditOrbit mode, either trigger0 or trigger1 will cause a camera to move twice its normal movement speed. You can see this in action within the World Editor, where holding down the left mouse button while in mouse look mode (right mouse button is also down) causes the Camera to move faster.
- Passing along trigger2 will put the camera into strafe mode. While in this mode a Fly, FreeRotate or Overhead Camera will not rotate from the move input. Instead the yaw motion will be applied to the Camera's x motion, and the pitch motion will be applied to the Camera's z motion. You can see this in action within the World Editor where holding down the middle mouse button allows the user to move the camera up, down and side-to-side.
- While the camera is operating in Newton Mode, trigger0 and trigger1 behave slightly differently. Here trigger0 activates a multiplier to the applied acceleration force as defined by speedMultiplier. This has the affect of making the camera move up to speed faster. trigger1 has the opposite affect by acting as a brake. When trigger1 is active a multiplier is added to the Camera's drag as defined by brakeMultiplier.
- @see CameraData
- @see CameraMotionMode
- @see Camera::movementSpeed
- @ingroup BaseCamera
- */
- class Camera : public ShapeBase {
- public:
- /*! Returns the current camera control mode.
- @see CameraMotionMode */
- virtual string getMode(()) {}
- /*! Get the camera's position in the world.
- @returns The position in the form of "x y z". */
- virtual string getPosition(()) {}
- /*! Get the camera's Euler rotation in radians.
- @returns The rotation in radians in the form of "x y z". */
- virtual string getRotation(()) {}
- /*! Set the camera's Euler rotation in radians.
- @param rot The rotation in radians in the form of "x y z".@note Rotation around the Y axis is ignored */
- virtual void setRotation(( Point3F rot )) {}
- /*! Get the camera's offset from its orbit or tracking point.
- The offset is added to the camera's position when set to CameraMode::OrbitObject.
- @returns The offset in the form of "x y z". */
- virtual string getOffset(()) {}
- /*! Set the camera's offset.
- The offset is added to the camera's position when set to CameraMode::OrbitObject.
- @param offset The distance to offset the camera by in the form of "x y z". */
- virtual void setOffset(( Point3F offset )) {}
- /*! Set the camera to orbit around the given object, or if none is given, around the given point.
- @param orbitObject The object to orbit around. If no object is given (0 or blank string is passed in) use the orbitPoint instead
- @param orbitPoint The point to orbit around when no object is given. In the form of "x y z ax ay az aa" such as returned by SceneObject::getTransform().
- @param minDistance The minimum distance allowed to the orbit object or point.
- @param maxDistance The maximum distance allowed from the orbit object or point.
- @param initDistance The initial distance from the orbit object or point.
- @param ownClientObj [optional] Are we orbiting an object that is owned by us? Default is false.
- @param offset [optional] An offset added to the camera's position. Default is no offset.
- @param locked [optional] Indicates the camera does not receive input from the player. Default is false.
- @see Camera::setOrbitObject()
- @see Camera::setOrbitPoint()
- */
- virtual void setOrbitMode(( GameBase orbitObject, TransformF orbitPoint, float minDistance, float maxDistance, float initDistance, bool ownClientObj=false, Point3F offset=Point3F(0.0f, 0.0f, 0.0f), bool locked=false )) {}
- /*! Set the camera to orbit around a given object.
- @param orbitObject The object to orbit around.
- @param rotation The initial camera rotation about the object in radians in the form of "x y z".
- @param minDistance The minimum distance allowed to the orbit object or point.
- @param maxDistance The maximum distance allowed from the orbit object or point.
- @param initDistance The initial distance from the orbit object or point.
- @param ownClientObject [optional] Are we orbiting an object that is owned by us? Default is false.
- @param offset [optional] An offset added to the camera's position. Default is no offset.
- @param locked [optional] Indicates the camera does not receive input from the player. Default is false.
- @returns false if the given object could not be found.
- @see Camera::setOrbitMode()
- */
- virtual bool setOrbitObject(( GameBase orbitObject, VectorF rotation, float minDistance, float maxDistance, float initDistance, bool ownClientObject=false, Point3F offset=Point3F(0.0f, 0.0f, 0.0f), bool locked=false )) {}
- /*! Set the camera to orbit around a given point.
- @param orbitPoint The point to orbit around. In the form of "x y z ax ay az aa" such as returned by SceneObject::getTransform().
- @param minDistance The minimum distance allowed to the orbit object or point.
- @param maxDistance The maximum distance allowed from the orbit object or point.
- @param initDistance The initial distance from the orbit object or point.
- @param offset [optional] An offset added to the camera's position. Default is no offset.
- @param locked [optional] Indicates the camera does not receive input from the player. Default is false.
- @see Camera::setOrbitMode()
- */
- virtual void setOrbitPoint(( TransformF orbitPoint, float minDistance, float maxDistance, float initDistance, Point3F offset=Point3F(0.0f, 0.0f, 0.0f), bool locked=false )) {}
- /*! Set the camera to track a given object.
- @param trackObject The object to track.
- @param offset [optional] An offset added to the camera's position. Default is no offset.
- @returns false if the given object could not be found.
- */
- virtual bool setTrackObject(( GameBase trackObject, Point3F offset=Point3F(0.0f, 0.0f, 0.0f) )) {}
- /*! Set the camera to fly freely.
- Allows the camera to have 6 degrees of freedom. Provides for instantaneous motion and rotation unless one of the Newton fields has been set to true. See Camera::newtonMode and Camera::newtonRotation.
- */
- virtual void setFlyMode(()) {}
- /*! Set the camera to fly freely, but with ease-in and ease-out.
- This method allows for the same 6 degrees of freedom as Camera::setFlyMode() but activates the ease-in and ease-out on the camera's movement. To also activate Newton mode for the camera's rotation, set Camera::newtonRotation to true. */
- virtual void setNewtonFlyMode(()) {}
- /*! Is this a Newton Fly mode camera with damped rotation?
- @returns true if the camera uses a damped rotation. i.e. Camera::newtonRotation is set to true.
- */
- virtual bool isRotationDamped(()) {}
- /*! Get the angular velocity for a Newton mode camera.
- @returns The angular velocity in the form of "x y z".
- @note Only returns useful results when Camera::newtonRotation is set to true. */
- virtual string getAngularVelocity(()) {}
- /*! Set the angular velocity for a Newton mode camera.
- @param velocity The angular velocity infor form of "x y z".
- @note Only takes affect when Camera::newtonRotation is set to true. */
- virtual void setAngularVelocity(( VectorF velocity )) {}
- /*! Set the angular force for a Newton mode camera.
- @param force The angular force applied when attempting to rotate the camera.@note Only takes affect when Camera::newtonRotation is set to true. */
- virtual void setAngularForce(( float force )) {}
- /*! Set the angular drag for a Newton mode camera.
- @param drag The angular drag applied while the camera is rotating.@note Only takes affect when Camera::newtonRotation is set to true. */
- virtual void setAngularDrag(( float drag )) {}
- /*! Set the mass for a Newton mode camera.
- @param mass The mass used during ease-in and ease-out calculations.@note Only used when Camera is in Newton mode. */
- virtual void setMass(( float mass )) {}
- /*! Get the velocity for the camera.
- @returns The camera's velocity in the form of "x y z".@note Only useful when the Camera is in Newton mode. */
- virtual string getVelocity(()) {}
- /*! Set the velocity for the camera.
- @param velocity The camera's velocity in the form of "x y z".@note Only affects the Camera when in Newton mode. */
- virtual void setVelocity(( VectorF velocity )) {}
- /*! Set the drag for a Newton mode camera.
- @param drag The drag applied to the camera while moving.@note Only used when Camera is in Newton mode. */
- virtual void setDrag(( float drag )) {}
- /*! Set the force applied to a Newton mode camera while moving.
- @param force The force applied to the camera while attempting to move.@note Only used when Camera is in Newton mode. */
- virtual void setFlyForce(( float force )) {}
- /*! Set the Newton mode camera speed multiplier when trigger[sImageTrigger0] is active.
- @param multiplier The speed multiplier to apply.@note Only used when Camera is in Newton mode. */
- virtual void setSpeedMultiplier(( float multiplier )) {}
- /*! Set the Newton mode camera brake multiplier when trigger[sImageTrigger1] is active.
- @param multiplier The brake multiplier to apply.@note Only used when Camera is in Newton mode. */
- virtual void setBrakeMultiplier(( float multiplier )) {}
- /*! Point the camera at the specified position. Does not work in Orbit or Track modes.
- @param point The position to point the camera at. */
- virtual void lookAt(( Point3F point )) {}
- /*! @name Camera
- @{ */
- /*! */
- /*!
- The current camera control mode.
- */
- CameraMotionMode controlMode;
- /*!
- @brief Camera movement speed in units/s (typically m/s), with a base value of 40.
- Used in the following camera modes:
- - Edit Orbit Mode
- - Fly Mode
- - Overhead Mode
- @ingroup BaseCamera
- */
- float movementSpeed;
- /// @}
- /*! @name Camera: Newton Mode
- @{ */
- /*! */
- /*!
- Apply smoothing (acceleration and damping) to camera movements.
- */
- bool newtonMode;
- /*!
- Apply smoothing (acceleration and damping) to camera rotations.
- */
- bool newtonRotation;
- /*!
- The camera's mass (Newton mode only). Default value is 10.
- */
- float mass;
- /*!
- Drag on camera when moving (Newton mode only). Default value is 2.
- */
- float drag;
- /*!
- Force applied on camera when asked to move (Newton mode only). Default value is 500.
- */
- float force;
- /*!
- Drag on camera when rotating (Newton mode only). Default value is 2.
- */
- float angularDrag;
- /*!
- Force applied on camera when asked to rotate (Newton mode only). Default value is 100.
- */
- float angularForce;
- /*!
- Speed multiplier when triggering the accelerator (Newton mode only). Default value is 2.
- */
- float SpeedMultiplier;
- /*!
- Speed multiplier when triggering the brake (Newton mode only). Default value is 2.
- */
- float brakeMultiplier;
- /// @}
- /*! @name Game
- @{ */
- /*! */
- /// @}
- /*! @name Transform
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Mounting
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief Base debris class. Uses the DebrisData datablock for properties of individual debris objects.
- Debris is typically made up of a shape and up to two particle emitters. In most cases Debris objects are not created directly. They are usually produced automatically by other means, such as through the Explosion class. When an explosion goes off, its ExplosionData datablock determines what Debris to emit.
- @tsexample
- datablock ExplosionData(GrenadeLauncherExplosion)
- {
- // Assiging debris data
- debris = GrenadeDebris;
- // Adjust how debris is ejected
- debrisThetaMin = 10;
- debrisThetaMax = 60;
- debrisNum = 4;
- debrisNumVariance = 2;
- debrisVelocity = 25;
- debrisVelocityVariance = 5;
- // Note: other ExplosionData properties are not listed for this example
- };
- @endtsexample
- @note Debris are client side only objects.
- @see DebrisData
- @see ExplosionData
- @see Explosion
- @ingroup FX
- */
- class Debris : public GameBase {
- public:
- /*! @brief Manually set this piece of debris at the given position with the given velocity.
- Usually you do not manually create Debris objects as they are generated through other means, such as an Explosion. This method exists when you do manually create a Debris object and want to have it start moving.
- @param inputPosition Position to place the debris.
- @param inputVelocity Velocity to move the debris after it has been placed.
- @return Always returns true.
- @tsexample
- // Define the position
- %position = "1.0 1.0 1.0";
- // Define the velocity
- %velocity = "1.0 0.0 0.0";
- // Inform the debris object of its new position and velocity
- %debris.init(%position,%velocity);
- @endtsexample
- */
- virtual bool init(( string inputPosition="1.0 1.0 1.0", string inputVelocity="1.0 0.0 0.0" )) {}
- /*! @name Debris
- @{ */
- /*! */
- /*!
- @brief Length of time for this debris object to exist. When expired, the object will be deleted.
- The initial lifetime value comes from the DebrisData datablock.
- @see DebrisData::lifetime
- @see DebrisData::lifetimeVariance
- */
- float lifetime;
- /// @}
- /*! @name Game
- @{ */
- /*! */
- /// @}
- /*! @name Transform
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Mounting
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief GUI control which displays a 3D model.
- Model displayed in the control can have other objects mounted onto it, and the light settings can be adjusted.
- @tsexample
- new GuiObjectView(ObjectPreview)
- {
- shapeFile = "art/shapes/items/kit/healthkit.dts";
- mountedNode = "mount0";
- lightColor = "1 1 1 1";
- lightAmbient = "0.5 0.5 0.5 1";
- lightDirection = "0 0.707 -0.707";
- orbitDiststance = "2";
- minOrbitDiststance = "0.917688";
- maxOrbitDiststance = "5";
- cameraSpeed = "0.01";
- cameraZRot = "0";
- forceFOV = "0";
- reflectPriority = "0";
- };
- @endtsexample
- @see GuiControl
- @ingroup Gui3D
- */
- class GuiObjectView : public GuiTSCtrl {
- public:
- /*! @brief Called whenever the mouse enters the control.
- @tsexample
- // The mouse has entered the control, causing the callback to occur
- GuiObjectView::onMouseEnter(%this)
- {
- // Code to run when the mouse enters this control
- }
- @endtsexample
- @see GuiControl
- */
- void onMouseEnter();
- /*! @brief Called whenever the mouse leaves the control.
- @tsexample
- // The mouse has left the control, causing the callback to occur
- GuiObjectView::onMouseLeave(%this)
- {
- // Code to run when the mouse leaves this control
- }
- @endtsexample
- @see GuiControl
- */
- void onMouseLeave();
- /*! @brief Return the model displayed in this view.
- @tsexample
- // Request the displayed model name from the GuiObjectView object.
- %modelName = %thisGuiObjectView.getModel();
- @endtsexample
- @return Name of the displayed model.
- @see GuiControl */
- virtual string getModel(()) {}
- /*! @brief Sets the model to be displayed in this control.
- @param shapeName Name of the model to display.
- @tsexample
- // Define the model we want to display
- %shapeName = "gideon.dts";
- // Tell the GuiObjectView object to display the defined model
- %thisGuiObjectView.setModel(%shapeName);
- @endtsexample
- @see GuiControl */
- virtual void setModel(( string shapeName )) {}
- /*! @brief Return the name of the mounted model.
- @tsexample
- // Request the name of the mounted model from the GuiObjectView object
- %mountedModelName = %thisGuiObjectView.getMountedModel();
- @endtsexample
- @return Name of the mounted model.
- @see GuiControl */
- virtual string getMountedModel(()) {}
- /*! @brief Sets the model to be mounted on the primary model.
- @param shapeName Name of the model to mount.
- @tsexample
- // Define the model name to mount
- %modelToMount = "GideonGlasses.dts";
- // Inform the GuiObjectView object to mount the defined model to the existing model in the control
- %thisGuiObjectView.setMountedModel(%modelToMount);
- @endtsexample
- @see GuiControl */
- virtual void setMountedModel(( string shapeName )) {}
- /*! @brief Return the name of skin used on the primary model.
- @tsexample
- // Request the name of the skin used on the primary model in the control
- %skinName = %thisGuiObjectView.getSkin();
- @endtsexample
- @return Name of the skin used on the primary model.
- @see GuiControl */
- virtual string getSkin(()) {}
- /*! @brief Sets the skin to use on the model being displayed.
- @param skinName Name of the skin to use.
- @tsexample
- // Define the skin we want to apply to the main model in the control
- %skinName = "disco_gideon";
- // Inform the GuiObjectView control to update the skin the to defined skin
- %thisGuiObjectView.setSkin(%skinName);
- @endtsexample
- @see GuiControl */
- virtual void setSkin(( string skinName )) {}
- /*! @brief Return the name of skin used on the mounted model.
- @tsexample
- // Request the skin name from the model mounted on to the main model in the control
- %mountModelSkin = %thisGuiObjectView.getMountSkin();
- @endtsexample
- @return Name of the skin used on the mounted model.
- @see GuiControl */
- virtual string getMountSkin(( int param1, int param2 )) {}
- /*! @brief Sets the skin to use on the mounted model.
- @param skinName Name of the skin to set on the model mounted to the main model in the control
- @tsexample
- // Define the name of the skin
- %skinName = "BronzeGlasses";
- // Inform the GuiObjectView Control of the skin to use on the mounted model
- %thisGuiObjectViewCtrl.setMountSkin(%skinName);
- @endtsexample
- @see GuiControl */
- virtual void setMountSkin(( string skinName )) {}
- /*! @brief Sets the animation to play for the viewed object.
- @param indexOrName The index or name of the animation to play.
- @tsexample
- // Set the animation index value, or animation sequence name.
- %indexVal = "3";
- //OR:
- %indexVal = "idle";
- // Inform the GuiObjectView object to set the animation sequence of the object in the control.
- %thisGuiObjectVew.setSeq(%indexVal);
- @endtsexample
- @see GuiControl */
- virtual void setSeq(( string indexOrName )) {}
- /*! @brief Mounts the given model to the specified mount point of the primary model displayed in this control.
- Detailed description
- @param shapeName Name of the model to mount.
- @param mountNodeIndexOrName Index or name of the mount point to be mounted to. If index, corresponds to "mountN" in your shape where N is the number passed here.
- @tsexample
- // Set the shapeName to mount
- %shapeName = "GideonGlasses.dts"
- // Set the mount node of the primary model in the control to mount the new shape at
- %mountNodeIndexOrName = "3";
- //OR:
- %mountNodeIndexOrName = "Face";
- // Inform the GuiObjectView object to mount the shape at the specified node.
- %thisGuiObjectView.setMount(%shapeName,%mountNodeIndexOrName);
- @endtsexample
- @see GuiControl */
- virtual void setMount(( string shapeName, string mountNodeIndexOrName )) {}
- /*! @brief Return the current distance at which the camera orbits the object.
- @tsexample
- // Request the current orbit distance
- %orbitDistance = %thisGuiObjectView.getOrbitDistance();
- @endtsexample
- @return The distance at which the camera orbits the object.
- @see GuiControl */
- virtual float getOrbitDistance(()) {}
- /*! @brief Sets the distance at which the camera orbits the object. Clamped to the acceptable range defined in the class by min and max orbit distances.
- Detailed description
- @param distance The distance to set the orbit to (will be clamped).
- @tsexample
- // Define the orbit distance value
- %orbitDistance = "1.5";
- // Inform the GuiObjectView object to set the orbit distance to the defined value
- %thisGuiObjectView.setOrbitDistance(%orbitDistance);
- @endtsexample
- @see GuiControl */
- virtual void setOrbitDistance(( float distance )) {}
- /*! @brief Return the current multiplier for camera zooming and rotation.
- @tsexample
- // Request the current camera zooming and rotation multiplier value
- %multiplier = %thisGuiObjectView.getCameraSpeed();
- @endtsexample
- @return Camera zooming / rotation multiplier value.
- @see GuiControl */
- virtual float getCameraSpeed(()) {}
- /*! @brief Sets the multiplier for the camera rotation and zoom speed.
- @param factor Multiplier for camera rotation and zoom speed.
- @tsexample
- // Set the factor value
- %factor = "0.75";
- // Inform the GuiObjectView object to set the camera speed.
- %thisGuiObjectView.setCameraSpeed(%factor);
- @endtsexample
- @see GuiControl */
- virtual void setCameraSpeed(( float factor )) {}
- /*! @brief Set the light color on the sun object used to render the model.
- @param color Color of sunlight.
- @tsexample
- // Set the color value for the sun
- %color = "1.0 0.4 0.5";
- // Inform the GuiObjectView object to change the sun color to the defined value
- %thisGuiObjectView.setLightColor(%color);
- @endtsexample
- @see GuiControl */
- virtual void setLightColor(( ColorF color )) {}
- /*! @brief Set the light ambient color on the sun object used to render the model.
- @param color Ambient color of sunlight.
- @tsexample
- // Define the sun ambient color value
- %color = "1.0 0.4 0.6";
- // Inform the GuiObjectView object to set the sun ambient color to the requested value
- %thisGuiObjectView.setLightAmbient(%color);
- @endtsexample
- @see GuiControl */
- virtual void setLightAmbient(( ColorF color )) {}
- /*! @brief Set the light direction from which to light the model.
- @param direction XYZ direction from which the light will shine on the model
- @tsexample
- // Set the light direction
- %direction = "1.0 0.2 0.4"
- // Inform the GuiObjectView object to change the light direction to the defined value
- %thisGuiObjectView.setLightDirection(%direction);
- @endtsexample
- @see GuiControl */
- virtual void setLightDirection(( Point3F direction )) {}
- /*! @name Model
- @{ */
- /*! */
- /*!
- The object model shape file to show in the view.
- */
- filename shapeFile;
- /*!
- The skin to use on the object model.
- */
- string skin;
- /// @}
- /*! @name Animation
- @{ */
- /*! */
- /*!
- The animation sequence to play on the model.
- */
- string animSequence;
- /// @}
- /*! @name Mounting
- @{ */
- /*! */
- /*!
- Optional shape file to mount on the primary model (e.g. weapon).
- */
- filename mountedShapeFile;
- /*!
- Skin name used on mounted shape file.
- */
- string mountedSkin;
- /*!
- Name of node on primary model to which to mount the secondary shape.
- */
- string mountedNode;
- /// @}
- /*! @name Lighting
- @{ */
- /*! */
- /*!
- Diffuse color of the sunlight used to render the model.
- */
- ColorF lightColor;
- /*!
- Ambient color of the sunlight used to render the model.
- */
- ColorF lightAmbient;
- /*!
- Direction from which the model is illuminated.
- */
- Point3F lightDirection;
- /// @}
- /*! @name Camera
- @{ */
- /*! */
- /*!
- Distance from which to render the model.
- */
- float orbitDiststance;
- /*!
- Maxiumum distance to which the camera can be zoomed out.
- */
- float minOrbitDiststance;
- /*!
- Minimum distance below which the camera will not zoom in further.
- */
- float maxOrbitDiststance;
- /*!
- Multiplier for mouse camera operations.
- */
- float cameraSpeed;
- /// @}
- /*! @name Camera
- @{ */
- /*! */
- /// @}
- /*! @name Rendering
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A helper datablock used by classes (such as shapebase) that submit lights to the scene but do not use actual "LightBase" objects.
- This datablock stores the properties of that light as fields that can be initialized from script.@tsexample
- // Declare a light description to be used on a rocket launcher projectile
- datablock LightDescription(RocketLauncherLightDesc)
- {
- range = 4.0;
- color = "1 1 0";
- brightness = 5.0;
- animationType = PulseLightAnim;
- animationPeriod = 0.25;
- };
- // Declare a ProjectileDatablock which uses the light description
- datablock ProjectileData(RocketLauncherProjectile)
- {
- lightDesc = RocketLauncherLightDesc;
- projectileShapeName = "art/shapes/weapons/SwarmGun/rocket.dts";
- directDamage = 30;
- radiusDamage = 30;
- damageRadius = 5;
- areaImpulse = 2500;
- // ... remaining ProjectileData fields not listed for this example
- };
- @endtsexample
- @see LightBase
- @ingroup Lighting
- */
- class LightDescription : public SimDataBlock {
- public:
- /*! @brief Force an inspectPostApply call for the benefit of tweaking via the console
- Normally this functionality is only exposed to objects via the World Editor, once changes have been made. Exposing apply to script allows you to make changes to it on the fly without the World Editor.
- @note This is intended for debugging and tweaking, not for game play
- @tsexample
- // Change a property of the light description
- RocketLauncherLightDesc.brightness = 10;
- // Make it so
- RocketLauncherLightDesc.apply();
- @endtsexample
- */
- virtual void apply(()) {}
- /*! @name Light
- @{ */
- /*! */
- /*!
- Changes the base color hue of the light.
- */
- ColorF color;
- /*!
- Adjusts the lights power, 0 being off completely.
- */
- float brightness;
- /*!
- Controls the size (radius) of the light
- */
- float range;
- /*!
- Enables/disabled shadow casts by this light.
- */
- bool castShadows;
- /// @}
- /*! @name Light Animation
- @{ */
- /*! */
- /*!
- Datablock containing light animation information (LightAnimData)
- */
- LightAnimData animationType;
- /*!
- The length of time in seconds for a single playback of the light animation
- */
- float animationPeriod;
- /*!
- The phase used to offset the animation start time to vary the animation of nearby lights.
- */
- float animationPhase;
- /// @}
- /*! @name Misc
- @{ */
- /*! */
- /*!
- Datablock containing light flare information (LightFlareData)
- */
- LightFlareData flareType;
- /*!
- Globally scales all features of the light flare
- */
- float flareScale;
- /// @}
- /*! @name Advanced Lighting
- @{ */
- /*! */
- /*!
- The proportions of constant, linear, and quadratic attenuation to use for the falloff for point and spot lights.
- */
- Point3F attenuationRatio;
- /*!
- The type of shadow to use on this light.
- */
- ShadowType shadowType;
- /*!
- A custom pattern texture which is projected from the light.
- */
- filename cookie;
- /*!
- The texture size of the shadow map.
- */
- int texSize;
- /*!
- The ESM shadow darkening factor
- */
- Point4F overDarkFactor;
- /*!
- The distance from the camera to extend the PSSM shadow.
- */
- float shadowDistance;
- /*!
- */
- float shadowSoftness;
- /*!
- The logrithmic PSSM split distance factor.
- */
- int numSplits;
- /*!
- The logrithmic PSSM split distance factor.
- */
- float logWeight;
- /*!
- Start fading shadows out at this distance. 0 = auto calculate this distance.
- */
- float fadeStartDistance;
- /*!
- This toggles only terrain being rendered to the last split of a PSSM shadow map.
- */
- bool lastSplitTerrainOnly;
- /// @}
- /*! @name Advanced Lighting Lightmap
- @{ */
- /*! */
- /*!
- This light is represented in lightmaps (static light, default: false)
- */
- bool representedInLightmap;
- /*!
- The color that should be used to multiply-blend dynamic shadows onto lightmapped geometry (ignored if 'representedInLightmap' is false)
- */
- ColorF shadowDarkenColor;
- /*!
- This light should render lightmapped geometry during its shadow-map update (ignored if 'representedInLightmap' is false)
- */
- bool includeLightmappedGeometryInShadow;
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief Level object which defines the boundaries of the level.
- This is a simple box with starting points, width, depth, and height. It does not have any default functionality. Instead, when objects hit the boundaries certain script callbacks will be made allowing you to control the reaction.
- @tsexample
- new MissionArea(GlobalMissionArea)
- {
- Area = "-152 -352 1008 864";
- flightCeiling = "300";
- flightCeilingRange = "20";
- canSaveDynamicFields = "1";
- enabled = "1";
- TypeBool locked = "false";
- };
- @endtsexample
- @ingroup enviroMisc
- */
- class MissionArea : public NetObject {
- public:
- /*! Returns 4 fields: starting x, starting y, extents x, extents y.
- */
- virtual string getArea(()) {}
- /*! @brief - Defines the size of the MissionArea
- param x Starting X coordinate position for MissionArea
- param y Starting Y coordinate position for MissionArea
- param width New width of the MissionArea
- param height New height of the MissionArea
- @note Only the server object may be set.
- */
- virtual void setArea(( int x, int y, int width, int height )) {}
- /*! Intended as a helper to developers and editor scripts.
- Force trigger an inspectPostApply. This will transmit material and other fields ( not including nodes ) to client objects. */
- virtual void postApply(()) {}
- /*! @name Dimensions
- @{ */
- /*! */
- /*!
- Four corners (X1, X2, Y1, Y2) that makes up the level's boundaries
- */
- RectI area;
- /*!
- Represents the top of the mission area, used by FlyingVehicle.
- */
- float flightCeiling;
- /*!
- Distance from ceiling before FlyingVehicle thrust is cut off.
- */
- float flightCeilingRange;
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief This class is used for creating any type of game object, assigning it a class, datablock, and even a function when it is spawned.
- Torque 3D uses a simple spawn system, which can be easily modified to spawn any kind of object (of any class). Each new level already contains at least one SpawnSphere, which is represented by a green octahedron in stock Torque 3D. The spawnClass will determine the object type, such as Player, AIPlayer, etc. The spawnDataBlock will provide this specific instance of the creation with a pre-defined datablock. The really powerful feature of this clas is utilize by the spawnScript field. Through this, you can define a simple script (multiple lines) that will be executed once the object has been spawned.
- @tsexample
- new SpawnSphere(DefaultSpawnSphere)
- {
- spawnClass = "Player";
- spawnDatablock = "DefaultPlayerData";
- spawnScript = "echo(\"Object Spawned\");"; // Note the escape sequence \ in front of quotes
- spawnProperties = "name = \"Bob\";lifeTotal = 3;"; // Note the escape sequence \ in front of quotes
- autoSpawn = "0";
- radius = "1";
- sphereWeight = "1";
- indoorWeight = "100";
- outdoorWeight = "100";
- dataBlock = "SpawnSphereMarker";
- position = "-0.77266 -19.882 17.8153";
- rotation = "1 0 0 0";
- scale = "1 1 1";
- canSave = "1";
- canSaveDynamicFields = "1";
- };
- // In the above example, the following two lines of code will execute after spawning
- echo("Object Spawned");
- echo("Hello World");
- @endtsexample
- @see MissionMarker
- @see MissionMarkerData
- @ingroup gameObjects
- @ingroup enviroMisc
- */
- class SpawnSphere : public MissionMarker {
- public:
- /*! Called when the SpawnSphere is being created.
- @param objectId The unique SimObjectId generated when SpawnSphere is created
- */
- void onAdd( int objectId );
- /*! Spawns the object based on the SpawnSphere's class, datablock, properties, and script settings. Allows you to pass in extra properties.@hide */
- virtual int spawnObject(([string additionalProps])) {}
- /*! @name Spawn
- @{ */
- /*! */
- /*!
- Class assigned to object when created, such as Player, or AIPlayer
- */
- string spawnClass;
- /*!
- Predefined datablock assigned to the object when created
- */
- string spawnDatablock;
- /*!
- String containing ; delimited properties that are set at the time of spawning
- */
- string spawnProperties;
- /*!
- Command to execute when spawning an object. New object id is stored in $SpawnObject. Max 255 characters.
- */
- string spawnScript;
- /*!
- Flag to spawn object as soon as SpawnSphere is created, true to enable or false to disabled
- */
- bool autoSpawn;
- /// @}
- /*! @name Dimensions
- @{ */
- /*! */
- /*!
- Determines the size of the sphere in which the object will spawn
- */
- float radius;
- /// @}
- /*! @name Weight
- @{ */
- /*! */
- /*!
- Deprecated
- */
- float sphereWeight;
- /*!
- Deprecated
- */
- float indoorWeight;
- /*!
- Deprecated
- */
- float outdoorWeight;
- /// @}
- /*! @name Game
- @{ */
- /*! */
- /// @}
- /*! @name Transform
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Mounting
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A camera that moves along a path. The camera can then be made to travel along this path forwards or backwards.
- A camera's path is made up of knots, which define a position, rotation and speed for the camera. Traversal from one knot to another may be either linear or using a Catmull-Rom spline. If the knot is part of a spline, then it may be a normal knot or defined as a kink. Kinked knots are a hard transition on the spline rather than a smooth one. A knot may also be defined as a position only. In this case the knot is treated as a normal knot but is ignored when determining how to smoothly rotate the camera while it is travelling along the path (the algorithm moves on to the next knot in the path for determining rotation).
- The datablock field for a PathCamera is a previously created PathCameraData, which acts as the interface between the script and the engine for this PathCamera object.
- @see PathCameraData
- @tsexample
- %newPathCamera = new PathCamera()
- {
- dataBlock = LoopingCam;
- position = "0 0 300 1 0 0 0";
- };
- @endtsexample
- @ingroup PathCameras
- */
- class PathCamera : public ShapeBase {
- public:
- /*! A script callback that indicates the path camera has arrived at a specific node in its path. Server side only.
- @param Node Unique ID assigned to this node.
- */
- void onNode( string node );
- /*! Set the current position of the camera along the path.
- @param position Position along the path, from 0.0 (path start) - 1.0 (path end), to place the camera.
- @tsexample
- // Set the camera on a position along its path from 0.0 - 1.0.
- %position = "0.35";
- // Force the pathCamera to its new position along the path.
- %pathCamera.setPosition(%position);
- @endtsexample
- */
- virtual void setPosition(( float position=0.0f )) {}
- /*! @brief Set the movement target for this camera along its path.
- The camera will attempt to move along the path to the given target in the direction provided by setState() (the default is forwards). Once the camera moves past this target it will come to a stop, and the target state will be cleared.
- @param position Target position, between 0.0 (path start) and 1.0 (path end), for the camera to move to along its path.
- @tsexample
- // Set the position target, between 0.0 (path start) and 1.0 (path end), for this camera to move to.
- %position = "0.50";
- // Inform the pathCamera of the new target position it will move to.
- %pathCamera.setTarget(%position);
- @endtsexample
- */
- virtual void setTarget(( float position=1.0f )) {}
- /*! Set the movement state for this path camera.
- @param newState New movement state type for this camera. Forward, Backward or Stop.
- @tsexample
- // Set the state type (forward, backward, stop).
- // In this example, the camera will travel from the first node
- // to the last node (or target if given with setTarget())
- %state = "forward";
- // Inform the pathCamera to change its movement state to the defined value.
- %pathCamera.setState(%state);
- @endtsexample
- */
- virtual void setState(( string newState="forward" )) {}
- /*! @brief Clear the camera's path and set the camera's current transform as the start of the new path.
- What specifically occurs is a new knot is created from the camera's current transform. Then the current path is cleared and the new knot is pushed onto the path. Any previous target is cleared and the camera's movement state is set to Forward. The camera is now ready for a new path to be defined.
- @param speed Speed for the camera to move along its path after being reset.
- @tsexample
- //Determine the new movement speed of this camera. If not set, the speed will default to 1.0.
- %speed = "0.50";
- // Inform the path camera to start a new path at// the camera's current position, and set the new // path's speed value.
- %pathCamera.reset(%speed);
- @endtsexample
- */
- virtual void reset(( float speed=1.0f )) {}
- /*! @brief Adds a new knot to the back of a path camera's path.
- @param transform Transform for the new knot. In the form of "x y z ax ay az aa" such as returned by SceneObject::getTransform()
- @param speed Speed setting for this knot.
- @param type Knot type (Normal, Position Only, Kink).
- @param path %Path type (Linear, Spline).
- @tsexample
- // Transform vector for new knot. (Pos_X Pos_Y Pos_Z Rot_X Rot_Y Rot_Z Angle)
- %transform = "15.0 5.0 5.0 1.4 1.0 0.2 1.0"
- // Speed setting for knot.
- %speed = "1.0"
- // Knot type. (Normal, Position Only, Kink)
- %type = "Normal";
- // Path Type. (Linear, Spline)
- %path = "Linear";
- // Inform the path camera to add a new knot to the back of its path
- %pathCamera.pushBack(%transform,%speed,%type,%path);
- @endtsexample
- */
- virtual void pushBack(( TransformF transform, float speed=1.0, string type="Normal", string path="Linear" )) {}
- /*! @brief Adds a new knot to the front of a path camera's path.
- @param transform Transform for the new knot. In the form of "x y z ax ay az aa" such as returned by SceneObject::getTransform()
- @param speed Speed setting for this knot.
- @param type Knot type (Normal, Position Only, Kink).
- @param path %Path type (Linear, Spline).
- @tsexample
- // Transform vector for new knot. (Pos_X,Pos_Y,Pos_Z,Rot_X,Rot_Y,Rot_Z,Angle)
- %transform = "15.0 5.0 5.0 1.4 1.0 0.2 1.0"
- // Speed setting for knot.
- %speed = "1.0";
- // Knot type. (Normal, Position Only, Kink)
- %type = "Normal";
- // Path Type. (Linear, Spline)
- %path = "Linear";
- // Inform the path camera to add a new knot to the front of its path
- %pathCamera.pushFront(%transform, %speed, %type, %path);
- @endtsexample
- */
- virtual void pushFront(( TransformF transform, float speed=1.0, string type="Normal", string path="Linear" )) {}
- /*! Removes the knot at the front of the camera's path.
- @tsexample
- // Remove the first knot in the camera's path.
- %pathCamera.popFront();
- @endtsexample
- */
- virtual void popFront(()) {}
- /*! @name Game
- @{ */
- /*! */
- /// @}
- /*! @name Transform
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Mounting
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief Physical Zones are areas that modify the player's gravity and/or velocity and/or applied force.
- The datablock properties determine how the physics, velocity and applied forces affect a player who enters this zone.
- @tsexample
- new PhysicalZone(Team1JumpPad) {
- velocityMod = "1";gravityMod = "0";
- appliedForce = "0 0 20000";
- polyhedron = "0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 0.0000000 -1.0000000 0.0000000 0.0000000 0.0000000 1.0000000";
- position = "273.559 -166.371 249.856";
- rotation = "0 0 1 13.0216";
- scale = "8 4.95 28.31";
- isRenderEnabled = "true";
- canSaveDynamicFields = "1";
- enabled = "1";
- };
- @endtsexample
- @ingroup enviroMisc
- */
- class PhysicalZone : public SceneObject {
- public:
- /*! Activate the physical zone's effects.
- @tsexample
- // Activate effects for a specific physical zone.
- %thisPhysicalZone.activate();
- @endtsexample
- @ingroup Datablocks
- */
- virtual void activate(()) {}
- /*! Deactivate the physical zone's effects.
- @tsexample
- // Deactivate effects for a specific physical zone.
- %thisPhysicalZone.deactivate();
- @endtsexample
- @ingroup Datablocks
- */
- virtual void deactivate(()) {}
- /*! @name Misc
- @{ */
- /*! */
- /*!
- Multiply velocity of objects entering zone by this value every tick.
- */
- float velocityMod;
- /*!
- Gravity in PhysicalZone. Multiplies against standard gravity.
- */
- float gravityMod;
- /*!
- Three-element floating point value representing forces in three axes to apply to objects entering PhysicalZone.
- */
- Point3F appliedForce;
- /*!
- The polyhedron type is really a quadrilateral and consists of a cornerpoint followed by three vectors representing the edges extending from the corner.
- */
- floatList polyhedron;
- /// @}
- /*! @name AFX
- @{ */
- /*! */
- /*!
- */
- PhysicalZone_ForceType forceType;
- /*!
- */
- bool orientForce;
- /// @}
- /*! @name Transform
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Mounting
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief An object that culls the rendering of everything contained within it.
- This is one of two objects used by the manual culling system Torque 3D provides, the other being Portal. When a Zone is placed in a level, all rendering within the zone is hidden from view when the camera is outside it. When inside, all rendering outside the zone is hidden. This is an excellent way to optimize large levels and complex geometry.
- You can attach a Portal a zone. This allows you to view what is rendered in the Zone (or what is rendered outside if you are in the zone), like a window. The larger the Portal, the more you can see through a zone.
- @tsexample
- // Example declaration of a Zone
- new Zone(TestZone)
- {
- soundAmbience = "AudioAmbienceInside";
- position = "3.61793 -1.01945 14.7442";
- rotation = "1 0 0 0";
- scale = "10 10 10";
- canSave = "1";
- canSaveDynamicFields = "1";
- };
- @endtsexample
- @see Portal
- @ingroup enviroMisc
- */
- class Zone : public SceneObject {
- public:
- /*! Get the unique numeric ID of the zone in its scene.
- @return The ID of the zone. */
- virtual int getZoneId(()) {}
- /*! Dump a list of all objects assigned to the zone to the console as well as a list of all connected zone spaces.
- @param updateFirst Whether to update the contents of the zone before dumping. Since zoning states of objects are updated on demand, the zone contents can be outdated. */
- virtual void dumpZoneState(( bool updateFirst=true )) {}
- /*! @name Sound
- @{ */
- /*! */
- /*!
- Ambient sound environment for the space.
- */
- SFXAmbience soundAmbience;
- /// @}
- /*! @name Internal
- @{ */
- /*! */
- /*!
- For internal use only.
- */
- string plane;
- /*!
- For internal use only.
- */
- string point;
- /*!
- For internal use only.
- */
- string edge;
- /// @}
- /*! @name Lighting
- @{ */
- /*! */
- /*!
- Whether to use #ambientLightColor for ambient lighting in this zone or the global ambient color.
- */
- bool useAmbientLightColor;
- /*!
- Color of ambient lighting in this zone.
- Only used if #useAmbientLightColor is true.
- */
- ColorF ambientLightColor;
- /// @}
- /*! @name Zoning
- @{ */
- /*! */
- /*!
- ID of group the zone is part of.
- */
- int ZoneGroup;
- /// @}
- /*! @name Transform
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Mounting
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief An object that provides a "window" into a zone, allowing a viewer to see what's rendered in the zone.
- This is one of two objects used by the manual culling system Torque 3D provides, the other being Zone. When a Zone is placed in a level, all rendering within the zone is hidden from view when the camera is outside it. When inside, all rendering outside the zone is hidden. This is an excellent way to optimize large levels and complex geometry.
- You can attach a Portal a zone. This allows you to view what is rendered in the Zone (or what is rendered outside if you are in the zone), like a window. The larger the Portal, the more you can see through a zone.
- @tsexample
- // Example declaration of a Portal
- new Portal( PortalToTestZone )
- {
- position = "12.8467 -4.02246 14.8017";
- rotation = "0 0 -1 97.5085";
- scale = "1 0.25 1";
- canSave = "1";
- canSaveDynamicFields = "1";
- };
- @endtsexample
- @see Zone
- @ingroup enviroMisc
- */
- class Portal : public Zone {
- public:
- /*! Test whether the portal connects interior zones only.
- @return True if the portal is an interior portal. */
- virtual bool isInteriorPortal(()) {}
- /*! Test whether the portal connects interior zones to the outdoor zone.
- @return True if the portal is an exterior portal. */
- virtual bool isExteriorPortal(()) {}
- /*! @name Zoning
- @{ */
- /*! */
- /*!
- Whether one can view through the front-side of the portal.
- */
- bool frontSidePassable;
- /*!
- Whether one can view through the back-side of the portal.
- */
- bool backSidePassable;
- /// @}
- /*! @name Sound
- @{ */
- /*! */
- /// @}
- /*! @name Internal
- @{ */
- /*! */
- /// @}
- /*! @name Lighting
- @{ */
- /*! */
- /// @}
- /*! @name Zoning
- @{ */
- /*! */
- /// @}
- /*! @name Transform
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Mounting
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A collection of arbitrary objects which can be allocated and manipulated as a group.
- %Prefab always points to a (.prefab) file which defines its objects. In fact more than one %Prefab can reference this file and both will update if the file is modified.
- %Prefab is a very simple object and only exists on the server. When it is created it allocates children objects by reading the (.prefab) file like a list of instructions. It then sets their transform relative to the %Prefab and Torque networking handles the rest by ghosting the new objects to clients. %Prefab itself is not ghosted.
- */
- class Prefab : public SceneObject {
- public:
- /*! Called when the prefab file is loaded and children objects are created.
- @param children SimGroup containing all children objects.
- */
- void onLoad( SimGroup children );
- /*! @name Prefab
- @{ */
- /*! */
- /*!
- (.prefab) File describing objects within this prefab.
- */
- filename fileName;
- /// @}
- /*! @name Transform
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Mounting
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A Trigger is a volume of space that initiates script callbacks when objects pass through the Trigger.
- TriggerData provides the callbacks for the Trigger when an object enters, stays inside or leaves the Trigger's volume.
- @see TriggerData
- @ingroup gameObjects
- */
- class Trigger : public GameBase {
- public:
- /*! @brief Called when the Trigger is being created.
- @param objectId the object id of the Trigger being created
- */
- void onAdd( int objectId );
- /*! @brief Called just before the Trigger is deleted.
- @param objectId the object id of the Trigger being deleted
- */
- void onRemove( int objectId );
- /*! @brief Get the number of objects that are within the Trigger's bounds.
- @see getObject()
- */
- virtual int getNumObjects(()) {}
- /*! @brief Retrieve the requested object that is within the Trigger's bounds.
- @param index Index of the object to get (range is 0 to getNumObjects()-1)
- @returns The SimObjectID of the object, or -1 if the requested index is invalid.
- @see getNumObjects()
- */
- virtual int getObject(( int index )) {}
- /*!
- @brief Defines a non-rectangular area for the trigger.
- Rather than the standard rectangular bounds, this optional parameter defines a quadrilateral trigger area. The quadrilateral is defined as a corner point followed by three vectors representing the edges extending from the corner.
- */
- floatList polyhedron;
- /*!
- The command to execute when an object enters this trigger. Object id stored in %%obj. Maximum 1023 characters.
- */
- string enterCommand;
- /*!
- The command to execute when an object leaves this trigger. Object id stored in %%obj. Maximum 1023 characters.
- */
- string leaveCommand;
- /*!
- The command to execute while an object is inside this trigger. Maximum 1023 characters.
- */
- string tickCommand;
- /*! @name Game
- @{ */
- /*! */
- /// @}
- /*! @name Transform
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Mounting
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief Basic HUD clock. Displays the current simulation time offset from some base.
- @tsexample
- new GuiClockHud(){
- fillColor = "0.0 1.0 0.0 1.0"; // Fills with a solid green color
- frameColor = "1.0 1.0 1.0 1.0"; // Solid white frame color
- textColor = "1.0 1.0 1.0 1.0"; // Solid white text Color
- showFill = "true";
- showFrame = "true";
- };
- @endtsexample
- @ingroup GuiGame
- */
- class GuiClockHud : public GuiControl {
- public:
- /*! Sets the current base time for the clock.
- @param timeInSeconds Time to set the clock, in seconds (IE: 00:02 would be 120)
- @tsexample
- // Define the time, in seconds
- %timeInSeconds = 120;
- // Change the time on the GuiClockHud control
- %guiClockHud.setTime(%timeInSeconds);
- @endtsexample
- */
- virtual void setTime(( float timeInSeconds=60 )) {}
- /*! Returns the current time, in seconds.
- @return timeInseconds Current time, in seconds
- @tsexample
- // Get the current time from the GuiClockHud control
- %timeInSeconds = %guiClockHud.getTime();
- @endtsexample
- */
- virtual float getTime(()) {}
- /*! @name Misc
- @{ */
- /*! */
- /*!
- If true, draws a background color behind the control.
- */
- bool showFill;
- /*!
- If true, draws a frame around the control.
- */
- bool showFrame;
- /*!
- Standard color for the background of the control.
- */
- ColorF fillColor;
- /*!
- Color for the control's frame.
- */
- ColorF frameColor;
- /*!
- Color for the text on this control.
- */
- ColorF textColor;
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief Manages timing update information for the assigned particleEmitter. Particles can be
- assigned to this emitter through the method setEmitterDataBlock(%particleEmitterDatablock).
- @ingroup FX
- */
- class ParticleEmitterNode : public GameBase {
- public:
- /*! Assigns the datablock for this emitter.
- @param datablockID Numerical reference to datablock ID
- @tsexample
- // Get the editor's current particle emitter
- %emitter = PE_EmitterEditor.currEmitter
- // Assign a new datablock value
- %emitter.setEmitterDatablock(%emitterDatablock);
- @endtsexample
- */
- virtual void setEmitterDataBlock(( ParticleEmitterData emitterDatablock=0 )) {}
- /*! Turns the emitter on or off.
- @param active New emitter state
- */
- virtual void setActive(( bool active )) {}
- /*! Store current emitter in the world.
- */
- virtual void storeEmitter(()) {}
- /*! Store current emitter in the world.
- */
- virtual void clearStoredEmitters(()) {}
- /*!
- Boolean which sets and determines if this EmitterNode is active or not.
- */
- bool active;
- /*!
- Particle emitter datablock to use.
- */
- ParticleEmitterData emitter;
- /*!
- Velocity to use when spawning the particles.
- */
- float velocity;
- /*! @name Game
- @{ */
- /*! */
- /// @}
- /*! @name Transform
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Mounting
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief Defines a precipitation based storm (IE: rain, snow, etc.).
- @tsexample
- // The following is added to a level file (.mis) by the World Editor
- new Precipitation(TheRain) {
- dropSize = "0.5";
- splashSize = "0.5";
- splashMS = "250";
- animateSplashes = "1";
- dropAnimateMS = "0";
- fadeDist = "0";
- fadeDistEnd = "0";
- useTrueBillboards = "0";
- useLighting = "0";
- glowIntensity = "0 0 0 0";
- reflect = "0";
- rotateWithCamVel = "1";
- doCollision = "1";
- hitPlayers = "0";
- hitVehicles = "0";
- followCam = "1";
- useWind = "0";
- minSpeed = "1.5";
- maxSpeed = "2";
- minMass = "0.75";
- maxMass = "0.85";
- useTurbulence = "0";
- maxTurbulence = "0.1";
- turbulenceSpeed = "0.2";
- numDrops = "1024";
- boxWidth = "200";
- boxHeight = "100";
- dataBlock = "HeavyRain";
- };
- @endtsexample
- @ingroup FX
- */
- class Precipitation : public GameBase {
- public:
- /*! Sets how many drops are present at once.
- @tsexample
- // The percentage, from 0.0f to 1.0f, of the drops to display at once.
- %percentage = 0.5f;
- // Set the percentage by calling the method.
- %Precipitation.setPercentage(%percentage);
- @endtsexample
- */
- virtual void setPercentage(( float percentage=1.0f )) {}
- /*! Adjusts the droplet count and overall length of the Precipitation effect.
- @tsexample
- // The percentage, from 0.0f to 1.0f, of the drops to display at once.
- %percentage = 0.5;
- // The length of time for the Precipitation effect to last. Will be multiplied by 1000 to get the milliseconds.
- %length = 5.0;
- // Set the percentage and time by calling the method.
- %Precipitation.modifyStorm(%percentage , %length);
- @endtsexample
- */
- virtual void modifyStorm(( float percentage=1.0f, float length=5.0f )) {}
- /*! This is used to smoothly change the turbulence
- over a desired time period. Setting ms to zero
- will cause the change to be instantaneous. Setting
- max zero will disable turbulence.
- @tsexample
- //Set the turbulence value. Set to 0 to disable turbulence.
- %turbulence = 0.5;
- // The speed of the turbulance effect.
- %speed = 5.0;
- // The length of time for the turbulence to last. Will be multiplied by 1000 to get the milliseconds.
- %seconds = 5.0;
- // Set the percentage and time by calling the method.
- %Precipitation.setTurbulence(%turbulence , %speed , %seconds);
- @endtsexample
- */
- virtual void setTurbulence(( float max=1.0f, float speed=5.0f, float seconds=5.0 )) {}
- /*! @name Precipitation
- @{ */
- /*! */
- /*!
- Number of drops allowed to exists in the precipitation box at any one time.
- */
- int numDrops;
- /*!
- Width of precipitation box.
- */
- float boxWidth;
- /*!
- Height of precipitation box.
- */
- float boxHeight;
- /// @}
- /*! @name Rendering
- @{ */
- /*! */
- /*!
- Size of each drop of precipitation. This will scale the texture.
- */
- float dropSize;
- /*!
- Size of each splash animation for when a drop collides.
- */
- float splashSize;
- /*!
- Life of splashes in milliseconds.
- */
- int splashMS;
- /*!
- Check to enable splash animation on collision.
- */
- bool animateSplashes;
- /*!
- If greater than zero, will animate the drops from the frames in the texture.
- */
- int dropAnimateMS;
- /*!
- The distance at which fading of the drops begins.
- */
- float fadeDist;
- /*!
- The distance at which fading of the particles ends.
- */
- float fadeDistEnd;
- /*!
- Check to make drops true (non axis-aligned) billboards.
- */
- bool useTrueBillboards;
- /*!
- Check to enable shading of the drops and splashes by the sun color.
- */
- bool useLighting;
- /*!
- Set to 0 to disable the glow or or use it to control the intensity of each channel.
- */
- ColorF glowIntensity;
- /*!
- This enables the precipitation to be rendered during reflection passes. This is expensive.
- */
- bool reflect;
- /*!
- Enables drops to rotate to face camera.
- */
- bool rotateWithCamVel;
- /// @}
- /*! @name Collision
- @{ */
- /*! */
- /*!
- Allow collision with world objects.
- */
- bool doCollision;
- /*!
- Allow collision on player objects.
- */
- bool hitPlayers;
- /*!
- Allow collision on vehicles.
- */
- bool hitVehicles;
- /// @}
- /*! @name Movement
- @{ */
- /*! */
- /*!
- Enables system to follow the camera or stay where it is placed.
- */
- bool followCam;
- /*!
- Check to have the Sky property windSpeed affect precipitation.
- */
- bool useWind;
- /*!
- Minimum speed that a drop will fall.
- */
- float minSpeed;
- /*!
- Maximum speed that a drop will fall.
- */
- float maxSpeed;
- /*!
- Minimum mass of a drop.
- */
- float minMass;
- /*!
- Maximum mass of a drop.
- */
- float maxMass;
- /// @}
- /*! @name Turbulence
- @{ */
- /*! */
- /*!
- Check to enable turbulence. This causes precipitation drops to spiral while falling.
- */
- bool useTurbulence;
- /*!
- Radius at which precipitation drops spiral when turbulence is enabled.
- */
- float maxTurbulence;
- /*!
- Speed at which precipitation drops spiral when turbulence is enabled.
- */
- float turbulenceSpeed;
- /// @}
- /*! @name Game
- @{ */
- /*! */
- /// @}
- /*! @name Transform
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Mounting
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief Defines the properties of a type of PhysicsDebrisData.
- @see PhysicsDebris.
- */
- class PhysicsDebrisData : public GameBaseData {
- public:
- virtual void preload() {}
- /*! @name Display
- @{ */
- /*! */
- /*!
- Path to the shape file.
- */
- filename shapeFile;
- /*!
- Enable/Disable rendering into shadows.
- */
- bool castShadows;
- /// @}
- /*! @name Physical Properties
- @{ */
- /*! */
- /*!
- Base time in seconds that debris persists after time of creation.
- */
- float lifetime;
- /*!
- Range of variation randomly applied to lifetime when debris is created.
- */
- float lifetimeVariance;
- /*!
- Mass of each physical body.
- */
- float mass;
- /*!
- Friction of each physical body, slowing motion when in contact with a surface.
- */
- float friction;
- /*!
- Friction of each physical body, resisting motion when starting at rest.
- */
- float staticFriction;
- /*!
- Bounciness of each physical body in response to collisions. Normal range is zero to one.
- */
- float restitution;
- /*!
- Larger values cause linear velocity to decay over time more quickly
- */
- float linearDamping;
- /*!
- Larger values cause rotational velocity to decay over time more quickly.
- */
- float angularDamping;
- /*!
- Linear velocity threshold below which the shape may be put to sleep to save simulation time.
- */
- float linearSleepThreshold;
- /*!
- Angular velocity threshold below which the shape may be put to sleep to save simulation time.
- */
- float angularSleepThreshold;
- /*!
- While the shape is in water linear and angular dampening will be scaled by this value. It is expected that this value will usually be greater than one.
- */
- float waterDampingScale;
- /*!
- The density of this shape for purposes of calculating buoyancy forces. The result of a particular value is relative to the density of the WaterObject it is within.
- */
- float buoyancyDensity;
- /// @}
- /*! @name Scripting
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief Represents a destructible physical object simulated through the plugin system.
- @see PhysicsShapeData.
- */
- class PhysicsShape : public GameBase {
- public:
- /*! Returns true if the shape is currently destroyed. */
- virtual bool isDestroyed(()) {}
- /*! Disables rendering and physical simulation of the shape and spawns the explosion, debri, and destroyedShape if any are specified. Note that this does not actually delete the PhysicsShape. */
- virtual void destroy(()) {}
- /*! Restore to un-destroyed state: enables rendering and physical simulation. */
- virtual void restore(()) {}
- /*! @name PhysicsShape
- @{ */
- /*! */
- /*!
- Enables automatic playing of the animation named "ambient" (if it exists) when the PhysicsShape is loaded.
- */
- bool playAmbient;
- /// @}
- /*! @name Game
- @{ */
- /*! */
- /// @}
- /*! @name Transform
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Mounting
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief An invisible 3D object that emits sound.
- Sound emitters are used to place sounds in the level. They are full 3D objects with their own position and orientation and when assigned 3D sounds, the transform and velocity of the sound emitter object will be applied to the 3D sound.
- Sound emitters can be set up of in either of two ways:
- <ul>
- <li><p>By assigning an existing SFXTrack to the emitter's #track property.</p>
- <p>In this case the general sound setup (3D, streaming, looping, etc.) will be taken from #track. However, the emitter's own properties will still override their corresponding properties in the #track's SFXDescription.</p></li>
- <li><p>By directly assigning a sound file to the emitter's #fileName property.</p>
- <p>In this case, the sound file will be set up for playback according to the properties defined on the emitter.</p>
- </ul>
- Using #playOnAdd emitters can be configured to start playing immediately when they are added to the system (e.g. when the level objects are loaded from the mission file).
- @note A sound emitter need not necessarily emit a 3D sound. Instead, sound emitters may also be used to play non-positional sounds. For placing background audio to a level, however, it is usually easier to use LevelInfo::soundAmbience.
- @section SFXEmitter_networking Sound Emitters and Networking
- It is important to be aware of the fact that sounds will only play client-side whereas SFXEmitter objects are server-side entities. This means that a server-side object has no connection to the actual sound playing on the client. It is thus not possible for the server-object to perform queries about playback status and other source-related properties as these may in fact differ from client to client.
- @ingroup SFX
- */
- class SFXEmitter : public SceneObject {
- public:
- /*! Manually start playback of the emitter's sound.
- If this is called on the server-side object, the play command will be related to all client-side ghosts.
- */
- virtual void play(()) {}
- /*! Manually stop playback of the emitter's sound.
- If this is called on the server-side object, the stop command will be related to all client-side ghosts.
- */
- virtual void stop(()) {}
- /*! Get the sound source object from the emitter.
- @return The sound source used by the emitter or null.@note This method will return null when called on the server-side SFXEmitter object. Only client-side ghosts actually hold on to %SFXSources.
- */
- virtual string getSource(()) {}
- /*! @name Media
- @{ */
- /*! */
- /*!
- The track which the emitter should play.
- @note If assigned, this field will take precedence over a #fileName that may also be assigned to the emitter.
- */
- SFXTrack track;
- /*!
- The sound file to play.
- Use @b either this property @b or #track. If both are assigned, #track takes precendence. The primary purpose of this field is to avoid the need for the user to define SFXTrack datablocks for all sounds used in a level.
- */
- filename fileName;
- /// @}
- /*! @name Sound
- @{ */
- /*! */
- /*!
- Whether playback of the emitter's sound should start as soon as the emitter object is added to the level.
- If this is true, the emitter will immediately start to play when the level is loaded.
- */
- bool playOnAdd;
- /*!
- If this is true, all fields except for #playOnAdd and #track are ignored on the emitter object.
- This is useful to prevent fields in the #track's description from being overridden by emitter fields.
- */
- bool useTrackDescriptionOnly;
- /*!
- Whether to play #fileName in an infinite loop.
- If a #track is assigned, the value of this field is ignored.
- @see SFXDescription::isLooping
- */
- bool isLooping;
- /*!
- Whether to use streamed playback for #fileName.
- If a #track is assigned, the value of this field is ignored.
- @see SFXDescription::isStreaming
- @ref SFX_streaming
- */
- bool isStreaming;
- /*!
- The SFXSource to which to assign the sound of this emitter as a child.
- @note This field is ignored if #useTrackDescriptionOnly is true.
- @see SFXDescription::sourceGroup
- */
- SFXSource sourceGroup;
- /*!
- Volume level to apply to the sound.
- @note This field is ignored if #useTrackDescriptionOnly is true.
- @see SFXDescription::volume
- */
- float volume;
- /*!
- Pitch shift to apply to the sound. Default is 1 = play at normal speed.
- @note This field is ignored if #useTrackDescriptionOnly is true.
- @see SFXDescription::pitch
- */
- float pitch;
- /*!
- Number of seconds to gradually fade in volume from zero when playback starts.
- @note This field is ignored if #useTrackDescriptionOnly is true.
- @see SFXDescription::fadeInTime
- */
- float fadeInTime;
- /*!
- Number of seconds to gradually fade out volume down to zero when playback is stopped or paused.
- @note This field is ignored if #useTrackDescriptionOnly is true.
- @see SFXDescription::fadeOutTime
- */
- float fadeOutTime;
- /// @}
- /*! @name 3D Sound
- @{ */
- /*! */
- /*!
- Whether to play #fileName as a positional (3D) sound or not.
- If a #track is assigned, the value of this field is ignored.
- @see SFXDescription::is3D
- */
- bool is3D;
- /*!
- Distance at which to start volume attenuation of the 3D sound.
- @note This field is ignored if #useTrackDescriptionOnly is true.
- @see SFXDescription::referenceDistance
- */
- float referenceDistance;
- /*!
- Distance at which to stop volume attenuation of the 3D sound.
- @note This field is ignored if #useTrackDescriptionOnly is true.
- @see SFXDescription::maxDistance
- */
- float maxDistance;
- /*!
- Bounds on random offset to apply to initial 3D sound position.
- @note This field is ignored if #useTrackDescriptionOnly is true.
- @see SFXDescription::scatterDistance
- */
- Point3F scatterDistance;
- /*!
- Angle of inner volume cone of 3D sound in degrees.
- @note This field is ignored if #useTrackDescriptionOnly is true.
- @see SFXDescription::coneInsideAngle
- */
- int coneInsideAngle;
- /*!
- Angle of outer volume cone of 3D sound in degrees
- @note This field is ignored if #useTrackDescriptionOnly is true.
- @see SFXDescription::coneOutsideAngle
- */
- int coneOutsideAngle;
- /*!
- Volume scale factor of outside of outer volume 3D sound cone.
- @note This field is ignored if #useTrackDescriptionOnly is true.
- @see SFXDescription::coneOutsideVolume
- */
- float coneOutsideVolume;
- /// @}
- /*! @name Transform
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Mounting
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class Horse : public Vehicle {
- public:
- virtual void setThreadPos(( float pos )) {}
- virtual void animate(( int animation )) {}
- /*! @brief Get the name of the player's current state.
- The state is one of the following:
- <ul><li>Dead - The Player is dead.</li><li>Mounted - The Player is mounted to an object such as a vehicle.</li><li>Move - The Player is free to move. The usual state.</li></ul>
- @return The current state; one of: "Dead", "Mounted", "Move"
- */
- virtual string getState(()) {}
- /*! @name Game
- @{ */
- /*! */
- /// @}
- /*! @name Transform
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Mounting
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A 3rd person camera object.
- @ingroup afxMisc
- @ingroup AFX
- */
- class afxCamera : public ShapeBase {
- public:
- /*! Set the camera to orbit around some given object.
- @param orbitObject Object we want to orbit.
- @param mat A set of fields: posX posY posZ aaX aaY aaZ aaTheta
- @param minDistance Minimum distance to keep from object.
- @param maxDistance Maximum distance to keep from object.
- @param curDistance Distance to set initially from object.
- @param ownClientObj Are we observing an object owned by us? */
- virtual void setOrbitMode((GameBase orbitObject, transform mat, float minDistance, float maxDistance, float curDistance, bool ownClientObject)) {}
- /*! Set the camera to be able to fly freely. */
- virtual void setFlyMode(()) {}
- /*! Get the position of the camera.
- @returns A string of form "x y z". */
- virtual string getPosition(()) {}
- virtual bool setCameraSubject() {}
- virtual bool setThirdPersonDistance() {}
- virtual float getThirdPersonDistance() {}
- virtual bool setThirdPersonAngle() {}
- virtual float getThirdPersonAngle() {}
- virtual void setThirdPersonOffset((Point3F offset [, Point3f coi_offset])) {}
- virtual string getThirdPersonOffset(()) {}
- virtual string getThirdPersonCOIOffset(()) {}
- virtual void setThirdPersonMode(()) {}
- virtual void setThirdPersonSnap(()) {}
- virtual string getMode(()) {}
- /*! @name Game
- @{ */
- /*! */
- /// @}
- /*! @name Transform
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Mounting
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief Base class used by choreographers.
- @ingroup afxChoreographers
- @ingroup AFX
- */
- class afxChoreographer : public GameBase {
- public:
- /*! Set a ranking value (0-255) for the choreographer.
- */
- virtual void setRanking(( unsigned int ranking )) {}
- /*! Set a level-of-detail value (0-255) for the choreographer.
- */
- virtual void setLevelOfDetail(( unsigned int lod )) {}
- /*! Set a bitmask to specifiy the state of exec-conditions.
- */
- virtual void setExecConditions(( int mask )) {}
- /*! Add a dynamic constraint consistiing of a source and name. The source can be a SceneObject, a 3-valued position, or a 7-valued transform.
- */
- virtual void addConstraint(( string source, string name )) {}
- /*! Add an explicit client.
- */
- virtual void addExplicitClient(( NetConnection client )) {}
- /*! Set a bit of the trigger-mask.
- */
- virtual void setTriggerBit(( int bit_num )) {}
- /*! Unset a bit of the trigger-mask.
- */
- virtual void clearTriggerBit(( int bit_num )) {}
- /*! Test state of a trigger-mask bit.
- */
- virtual bool testTriggerBit(( int bit_num )) {}
- /*! Remap a dynamic constraint to use a new source. The source can be a SceneObject, a 3-valued position, or a 7-valued transform. but must match type of existing source.
- */
- virtual void remapConstraint(( string source, string name )) {}
- /*!
- ...
- */
- SimObject extra;
- /*!
- ...
- */
- bool postponeActivation;
- /*! @name Game
- @{ */
- /*! */
- /// @}
- /*! @name Transform
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Mounting
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A datablock that describes an Effect Group.
- afxEffectGroupData provides a way for adding several effects to a choreographer as a group and can be used wherever an afxEffectWrapperData is used. Basically, an effect-group is a simple list of effect-wrappers. When an effect-group is added to a choreographer, the end result is almost the same as adding all of the group's effect-wrappers directly to the choreographer. The main difference is that the grouped effects can be turned on and off collectively and created in multiples. Effect-groups can also contain other effect-groups, forming a hierarchy of effects.
- A great strength of effect-groups is that they have a count setting that multiplies the number of times the effects in the group are added to the owning choreographer and this doesn't happen until the choreographer instance is created and launched. This makes a big difference for certain kinds of effects, such as fireworks, that tend to consist of small groupings of effects that are repeated many times with slight variations. With groups, an effect like this has a very compact representation for transmitting from server to clients, that only expands when actually used.
- Effect-groups with a count greater than one are extremely useful when some of the effects use field substitutions. When an effect-group is expanded, it essentially runs through a for-loop from 0 to count-1 and creates a new set of effect instances each time through the loop. For each new set of effects, their group-index is set to the index of this for-loop, which in turn replaces the ## token used in any field substitutions in the child effects. In essence, the for-loop index becomes a parameter of the child effects which can be used to vary the effects created in each loop.
- @see afxEffectBaseData
- @see afxEffectWrapperData
- @ingroup afxEffects
- @ingroup AFX
- @ingroup Datablocks
- */
- class afxEffectGroupData : public afxEffectBaseData {
- public:
- /*! Resets an effect-group datablock during reload.
- @ingroup AFX */
- virtual void reset(()) {}
- /*! Adds an effect (wrapper or group) to an effect-group.
- @ingroup AFX */
- virtual void addEffect(( afxEffectBaseData effect )) {}
- /*!
- ...
- */
- bool groupEnabled;
- /*!
- ...
- */
- int count;
- /*!
- ...
- */
- char indexOffset;
- /*!
- ...
- */
- bool assignIndices;
- /*!
- ...
- */
- float delay;
- /*!
- ...
- */
- float lifetime;
- /*!
- ...
- */
- float fadeInTime;
- /*!
- ...
- */
- float fadeOutTime;
- /*!
- ...
- */
- afxEffectBaseData addEffect;
- /*! @name Scripting
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief Defines the properties of an afxEffectron.
- @ingroup afxChoreographers
- @ingroup AFX
- @ingroup Datablocks
- */
- class afxEffectronData : public afxChoreographerData {
- public:
- /*! Resets an effectron datablock during reload.
- @ingroup AFX */
- virtual void reset(()) {}
- /*! Adds an effect (wrapper or group) to an effectron's phase.
- @ingroup AFX */
- virtual void addEffect(( afxEffectBaseData effect )) {}
- /*!
- ...
- */
- float Duration;
- /*!
- ...
- */
- int numLoops;
- /*!
- ...
- */
- afxEffectBaseData addEffect;
- /*! @name Scripting
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A basic effects choreographer.
- @ingroup afxChoreographers
- @ingroup AFX
- */
- class afxEffectron : public afxChoreographer {
- public:
- /*! Sets the time-factor for the effectron.
- @ingroup AFX */
- virtual void setTimeFactor(( float factor )) {}
- /*! Interrupts and deletes a running effectron.
- @ingroup AFX */
- virtual void interrupt(()) {}
- /*! Activates an effectron that was started with postponeActivation=true.
- @ingroup AFX */
- virtual void activate(()) {}
- /*! @name Game
- @{ */
- /*! */
- /// @}
- /*! @name Transform
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Mounting
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief Magic-missile class used internally by afxMagicSpell. Properties of individual missile types are defined using afxMagicMissileData.
- @ingroup AFX
- */
- class afxMagicMissile : public GameBase {
- public:
- /*! Set the starting velocity-vector for a magic-missile.
- @ingroup AFX */
- virtual void setStartingVelocityVector(( Point3F velocityVec )) {}
- /*! Set the starting velocity for a magic-missile.
- @ingroup AFX */
- virtual void setStartingVelocity(( float velocity )) {}
- /*! @name Physics
- @{ */
- /*! */
- /*!
- Initial starting position for this missile.
- */
- Point3F initialPosition;
- /*!
- Initial starting velocity for this missile.
- */
- Point3F initialVelocity;
- /// @}
- /*! @name Game
- @{ */
- /*! */
- /// @}
- /*! @name Transform
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Mounting
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief Defines the properties of an afxMagicSpell.
- @ingroup afxChoreographers
- @ingroup AFX
- @ingroup Datablocks
- */
- class afxMagicSpellData : public afxChoreographerData {
- public:
- /*! Called when the spell deals damage.
- @param spell the spell object
- */
- void onDamage( afxMagicSpell spell, string label, string flaver, int target_id, float amount, U8 n, Point3F pos, float ad_amount, float radius, float impulse );
- /*! Called when the spell ends naturally.
- @param spell the spell object
- */
- void onDeactivate( afxMagicSpell spell );
- /*! Called when the spell ends unnaturally due to an interruption.
- @param spell the spell object
- */
- void onInterrupt( afxMagicSpell spell, ShapeBase caster );
- /*! Called when the spell's casting stage ends and the delivery stage begins.
- @param spell the spell object
- */
- void onLaunch( afxMagicSpell spell, ShapeBase caster, SceneObject target, afxMagicMissile missile );
- /*! Called at the spell's missile impact marking the end of the deliver stage and the start of the linger stage.
- @param spell the spell object
- */
- void onImpact( afxMagicSpell spell, ShapeBase caster, SceneObject impacted, Point3F pos, Point3F normal );
- /*! Called during spell casting before spell instance is fully created.
- */
- bool onPreactivate( SimObject param_holder, ShapeBase caster, SceneObject target, SimObject extra );
- /*! Called when the spell starts.
- @param spell the spell object
- */
- void onActivate( afxMagicSpell spell, ShapeBase caster, SceneObject target );
- /*! Resets a spell datablock during reload.
- @ingroup AFX */
- virtual void reset(()) {}
- /*! Adds an effect (wrapper or group) to a spell's casting phase.
- @ingroup AFX */
- virtual void addCastingEffect(( afxEffectBaseData effect )) {}
- /*! Adds an effect (wrapper or group) to a spell's launch phase.
- @ingroup AFX */
- virtual void addLaunchEffect(( afxEffectBaseData effect )) {}
- /*! Adds an effect (wrapper or group) to a spell's delivery phase.
- @ingroup AFX */
- virtual void addDeliveryEffect(( afxEffectBaseData effect )) {}
- /*! Adds an effect (wrapper or group) to a spell's impact phase.
- @ingroup AFX */
- virtual void addImpactEffect(( afxEffectBaseData effect )) {}
- /*! Adds an effect (wrapper or group) to a spell's linger phase.
- @ingroup AFX */
- virtual void addLingerEffect(( afxEffectBaseData effect )) {}
- /*! @name Casting Stage
- @{ */
- /*! */
- /*!
- ...
- */
- float castingDur;
- /*!
- ...
- */
- int numCastingLoops;
- /*!
- ...
- */
- float extraCastingTime;
- /*!
- ...
- */
- afxEffectBaseData addCastingEffect;
- /// @}
- /*! @name Delivery Stage
- @{ */
- /*! */
- /*!
- ...
- */
- float deliveryDur;
- /*!
- ...
- */
- int numDeliveryLoops;
- /*!
- ...
- */
- float extraDeliveryTime;
- /*!
- ...
- */
- afxEffectBaseData addLaunchEffect;
- /*!
- ...
- */
- afxEffectBaseData addDeliveryEffect;
- /// @}
- /*! @name Linger Stage
- @{ */
- /*! */
- /*!
- ...
- */
- float lingerDur;
- /*!
- ...
- */
- int numLingerLoops;
- /*!
- ...
- */
- float extraLingerTime;
- /*!
- ...
- */
- afxEffectBaseData addImpactEffect;
- /*!
- ...
- */
- afxEffectBaseData addLingerEffect;
- /// @}
- /*!
- ...
- */
- bool allowMovementInterrupts;
- /*!
- ...
- */
- float movementInterruptSpeed;
- /*!
- ...
- */
- afxMagicMissileData missile;
- /*!
- ...
- */
- bool launchOnServerSignal;
- /*!
- ...
- */
- int primaryTargetTypes;
- /*! @name Scripting
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A magic spell effects choreographer.
- @ingroup afxChoreographers
- @ingroup AFX
- */
- class afxMagicSpell : public afxChoreographer {
- public:
- /*! Returns ID of the spell's caster object.
- @ingroup AFX */
- virtual int getCaster(()) {}
- /*! Returns ID of the spell's target object.
- @ingroup AFX */
- virtual int getTarget(()) {}
- /*! Returns ID of the spell's magic-missile object.
- @ingroup AFX */
- virtual int getMissile(()) {}
- /*! Returns ID of impacted-object for the spell.
- @ingroup AFX */
- virtual int getImpactedObject(()) {}
- /*! or (string phase, F32 factor)Sets the time-factor for the spell, either overall or for a specific phrase.
- @ingroup AFX */
- virtual void setTimeFactor((F32 factor)) {}
- /*! Interrupts the current stage of a magic spell causing it to move onto the next one.
- @ingroup AFX */
- virtual void interruptStage(()) {}
- /*! Interrupts and deletes a running magic spell.
- @ingroup AFX */
- virtual void interrupt(()) {}
- /*! Activates a magic spell that was started with postponeActivation=true.
- @ingroup AFX */
- virtual void activate(()) {}
- /*!
- ...
- */
- SimObject caster;
- /*!
- ...
- */
- SimObject target;
- /*! @name Game
- @{ */
- /*! */
- /// @}
- /*! @name Transform
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Mounting
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A choreographer for selection effects.
- @ingroup afxChoreographers
- @ingroup AFX
- */
- class afxSelectron : public afxChoreographer {
- public:
- /*! Sets the time factor of the selectron.
- @ingroup AFX */
- virtual void setTimeFactor(( float factor=1.0f )) {}
- /*! Interrupts and deletes a running selectron.
- @ingroup AFX */
- virtual void interrupt(()) {}
- /*! Stops and deletes a running selectron.
- @ingroup AFX */
- virtual void stopSelectron(()) {}
- /*! @name Game
- @{ */
- /*! */
- /// @}
- /*! @name Transform
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Mounting
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A spellbook datablock.
- @ingroup afxMisc
- @ingroup AFX
- @ingroup Datablocks
- */
- class afxSpellBookData : public GameBaseData {
- public:
- /*! ...
- @ingroup AFX */
- virtual int getPageSlotIndex(( Point2I bookSlot )) {}
- /*! Get the capacity (total number of spell slots) in a spellbook.
- @ingroup AFX */
- virtual int getCapacity(()) {}
- /*!
- ...
- */
- char spellsPerPage;
- /*!
- ...
- */
- char pagesPerBook;
- /*!
- ...
- */
- GameBaseData spells;
- /*!
- ...
- */
- GameBaseData rpgSpells;
- /*! @name Scripting
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A spellbook object.
- @ingroup afxMisc
- @ingroup AFX
- */
- class afxSpellBook : public GameBase {
- public:
- /*! ...
- @ingroup AFX */
- virtual int getPageSlotIndex(( Point2I bookSlot )) {}
- /*! Get spell datablock for spell stored at spellbook index, (page, slot).
- @ingroup AFX */
- virtual int getSpellData(( Point2I bookSlot )) {}
- /*! Get spell RPG datablock for spell stored at spellbook index, (page, slot).
- @ingroup AFX */
- virtual int getSpellRPGData(( Point2I bookSlot )) {}
- /*! ...
- @ingroup AFX */
- virtual void startAllSpellCooldown(()) {}
- /*! @name Game
- @{ */
- /*! */
- /// @}
- /*! @name Transform
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Mounting
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A datablock that specifies a Phrase Effect, a grouping of other effects.
- A Phrase Effect is a grouping or phrase of effects that do nothing until certain trigger events occur. It's like having a whole Effectron organized as an individual effect.
- Phrase effects can respond to a number of different kinds of triggers:
- -- Player triggers such as footsteps, jumps, landings, and idle triggers.
- -- Arbitrary animation triggers on dts-based scene objects.
- -- Arbitrary trigger bits assigned to active choreographer objects.
- @ingroup afxEffects
- @ingroup AFX
- @ingroup Datablocks
- */
- class afxPhraseEffectData : public GameBaseData {
- public:
- /*! Add a child effect to a phrase effect datablock. Argument can be an afxEffectWrappperData or an afxEffectGroupData.
- */
- virtual void addEffect(( afxEffectBaseData effectData )) {}
- /*!
- Specifies a duration for the phrase-effect. If set to infinity, the phrase-effect needs to have a phraseType of \93continuous. Set infinite duration using $AFX::INFINITE_TIME.
- */
- float Duration;
- /*!
- Specifies the number of times the phrase-effect should loop. If set to infinity, the phrase-effect needs to have a phraseType of \93continuous\94. Set infinite looping using $AFX::INFINITE_REPEATS.
- */
- int numLoops;
- /*!
- Sets which bits to consider in the current trigger-state which consists of 32 trigger-bits combined from (possibly overlapping) player trigger bits, constraint trigger bits, and choreographer trigger bits.
- */
- int triggerMask;
- /*!
- Selects what combination of bits in triggerMask lead to a trigger. When set to 'any', any bit in triggerMask matching the current trigger-state will cause a trigger. If set to 'all', every bit in triggerMask must match the trigger-state. Possible values: any or all.
- */
- afxPhraseEffect_MatchType matchType;
- /*!
- Selects which bit-state(s) of bits in the triggerMask to consider when comparing to the current trigger-state. Possible values: on, off, or both.
- */
- afxPhraseEffect_StateType matchState;
- /*!
- Selects between triggered and continuous types of phrases. When set to 'triggered', the phrase-effect is triggered when the relevant trigger-bits change state. When set to 'continuous', the phrase-effect will stay active as long as the trigger-bits remain in a matching state. Possible values: triggered or continuous.
- */
- afxPhraseEffect_PhraseType phraseType;
- /*!
- When true, trigger-bits on the choreographer will be ignored.
- */
- bool ignoreChoreographerTriggers;
- /*!
- When true, animation triggers from dts-based constraint source objects will be ignored.
- */
- bool ignoreConstraintTriggers;
- /*!
- When true, Player-specific triggers from Player-derived constraint source objects will be ignored.
- */
- bool ignorePlayerTriggers;
- /*!
- Like a field substitution statement without the leading '$$' token, this eval statement will be executed when a trigger occurs. Any '%%' and '##' tokens will be substituted.
- */
- string onTriggerCommand;
- /*!
- A field macro which adds an effect wrapper datablock to a list of effects associated with the phrase-effect's single phrase. Unlike other fields, addEffect follows an unusual syntax. Order is important since the effects will resolve in the order they are added to each list.
- */
- afxEffectBaseData addEffect;
- /*! @name Scripting
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A GUI button with some special features that are useful for casting AFX spells.
- @ingroup afxGUI
- @ingroup AFX
- */
- class afxSpellButton : public GuiButtonCtrl {
- public:
- /*! Notify an afxSpellButton when its associated spellbook has changed.
- */
- virtual void onSpellbookChange(( afxSpellBook spellbook, unsigned int page )) {}
- /*! Notify an afxSpellButton when the spellbook turns to a new page.
- */
- virtual void onTurnPage(( unsigned int page )) {}
- /*! Get the text description of a spell.
- */
- virtual string getSpellDescription(()) {}
- /*! Get the spell's datablock.
- */
- virtual int getSpellDataBlock(()) {}
- /*! Get the spell's RPG datablock.
- */
- virtual int getSpellRPGDataBlock(()) {}
- /*! Test if spell uses free targeting.
- */
- virtual bool useFreeTargeting(()) {}
- /*! Get the free targeting style used by the spell.
- */
- virtual int getFreeTargetStyle(()) {}
- /*!
- ...
- */
- filename bitmap;
- /*!
- ...
- */
- Point2I book_slot;
- /*! @name Button
- @{ */
- /*! */
- /// @}
- /*! @name Button
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A GUI progress bar useful as a spell casting bar.
- @ingroup afxGUI
- @ingroup AFX
- */
- class afxSpellCastBar : public GuiControl {
- public:
- /*! Set the progress percentage on the progress-bar.
- @ingroup AFX */
- virtual void setProgress(( float percentDone )) {}
- /*! @name Colors
- @{ */
- /*! */
- /*!
- ...
- */
- ColorF backgroundColor;
- /*!
- ...
- */
- ColorF borderColor;
- /*!
- ...
- */
- ColorF fillColor;
- /*!
- ...
- */
- ColorF fillColorFinal;
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A GUI status bar for tracking and displaying health and energy of ShapeBase objects.
- @ingroup afxGUI
- @ingroup AFX
- */
- class afxStatusBar : public GuiControl {
- public:
- /*! Set the progress percentage on the status-bar.
- @ingroup AFX */
- virtual void setProgress(( float percentDone )) {}
- /*! Associate a ShapeBase-derived object with the status-bar.
- @ingroup AFX */
- virtual void setShape(( ShapeBase shape )) {}
- /*! Clear out any ShapeBase-derived object associated with the status-bar.
- @ingroup AFX */
- virtual void clearShape(()) {}
- /*!
- ...
- */
- ColorF fillColor;
- /*!
- ...
- */
- bool displayEnergy;
- /*!
- ...
- */
- bool monitorPlayer;
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class CmServerSharedLoadingStatus : public SimObject {
- public:
- virtual void setOnServerLoadedCallback(( string callback )) {}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class CmInventory : public SimGroup {
- public:
- virtual Script onSplitStackItem(( string this, string root_id1, string container_id1, string item_id1, string quantity1, string max_stack_size1, string root_id2, string container_id2, string item_id2, string quantity2, string max_stack_size2, string bitmap )) {}
- /*! */
- void onSplitStackItem( int root_id1, int cont_id1, int item_id1, int quantity1, int max_stack_size1, int root_id2, int cont_id2, int item_id2, int quantity2, int max_stack_size2, string bitmap );
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief For static-field copying/pasting, editor use only
- */
- class FieldBrushObject : public SimObject {
- public:
- /*! Query available static-field groups for selected object./
- @param simObject Object to query static-field groups on.
- @return Space-seperated static-field group list. */
- virtual string queryGroups((simObject)) {}
- /*! Query available static-fields for selected object./
- @param simObject Object to query static-fields on.
- @param groupList groups to filter static-fields against.
- @return Space-seperated static-field list. */
- virtual string queryFields((simObject, [groupList])) {}
- /*! Copy selected static-fields for selected object./
- @param simObject Object to copy static-fields from.
- @param fieldList fields to filter static-fields against.
- @return No return value. */
- virtual void copyFields((simObject, [fieldList])) {}
- /*! Paste copied static-fields to selected object./
- @param simObject Object to paste static-fields to.
- @return No return value. */
- virtual void pasteFields((simObject)) {}
- /*!
- */
- caseString Description;
- /*!
- */
- string sortName;
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief this class manages updating SimObjects in the file they were created in non-destructively (mostly aimed at datablocks and materials).
- Basic scripting interface:
- - Creation: new PersistenceManager(FooManager);
- - Flag objects as dirty: FooManager.setDirty(<object name or id>);
- - Remove objects from dirty list: FooManager.removeDirty(<object name or id>);
- - List all currently dirty objects: FooManager.listDirty();
- - Check to see if an object is dirty: FooManager.isDirty(<object name or id>);
- - Save dirty objects to their files: FooManager.saveDirty();
- @note Dirty objects don't update their files until saveDirty() is called so you can change their properties after you flag them as dirty
- @note Currently only used by editors, not intended for actual game development
- @ingroup Console
- @ingroup Editors
- */
- class PersistenceManager : public SimObject {
- public:
- /*! Delete all of the objects that are created from the given file. */
- virtual void deleteObjectsFromFile(( fileName )) {}
- /*! Mark an existing SimObject as dirty (will be written out when saveDirty() is called). */
- virtual void setDirty((SimObject object, [filename])) {}
- /*! Remove a SimObject from the dirty list. */
- virtual void removeDirty((SimObject object)) {}
- /*! Returns true if the SimObject is on the dirty list. */
- virtual bool isDirty((SimObject object)) {}
- /*! Returns true if the manager has dirty objects to save. */
- virtual bool hasDirty(()) {}
- /*! Returns the number of dirty objects. */
- virtual int getDirtyObjectCount(()) {}
- /*! Returns the ith dirty object. */
- virtual int getDirtyObject(( index )) {}
- /*! Prints the dirty list to the console. */
- virtual void listDirty(()) {}
- /*! Saves all of the SimObject's on the dirty list to their respective files. */
- virtual bool saveDirty(()) {}
- /*! Save a dirty SimObject to it's file. */
- virtual bool saveDirtyObject((SimObject object)) {}
- /*! Clears all the tracked objects without saving them. */
- virtual void clearAll(()) {}
- /*! Remove an existing SimObject from a file (can optionally specify a different file than the one it was created in. */
- virtual void removeObjectFromFile((SimObject object, [filename])) {}
- /*! Remove a specific field from an object declaration. */
- virtual void removeField((SimObject object, string fieldName)) {}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A script-level OOP object which allows binding of a class, superClass and arguments along with declaration of methods.
- ScriptObjects are extrodinarily powerful objects that allow defining of any type of data required. They can optionally have
- a class and a superclass defined for added control of multiple ScriptObjects through a simple class definition.
- @tsexample
- new ScriptObject(Game)
- {
- class = "DeathMatchGame";
- superClass = GameCore;
- genre = "Action FPS"; // Note the new, non-Torque variable
- };
- @endtsexample
- @see SimObject
- @ingroup Console
- */
- class ScriptObject : public SimObject {
- public:
- /*! Called when this ScriptObject is added to the system.
- @param ID Unique object ID assigned when created (%this in script).
- */
- void onAdd( SimObjectId ID );
- /*! Called when this ScriptObject is removed from the system.
- @param ID Unique object ID assigned when created (%this in script).
- */
- void onRemove( SimObjectId ID );
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief Essentially a SimGroup, but with onAdd and onRemove script callbacks.
- @tsexample
- // First container, SimGroup containing a ScriptGroup
- new SimGroup(Scenes)
- {
- // Subcontainer, ScriptGroup containing variables
- // related to a cut scene and a starting WayPoint
- new ScriptGroup(WelcomeScene)
- {
- class = "Scene";
- pathName = "Pathx";
- description = "A small orc village set in the Hardesty mountains. This town and its surroundings will be used to illustrate some the Torque Game Engine's features.";
- pathTime = "0";
- title = "Welcome to Orc Town";
- new WayPoint(start)
- {
- position = "163.873 -103.82 208.354";
- rotation = "0.136165 -0.0544916 0.989186 44.0527";
- scale = "1 1 1";
- dataBlock = "WayPointMarker";
- team = "0";
- };
- };
- };
- @endtsexample
- @see SimGroup
- @ingroup Console
- */
- class ScriptGroup : public SimGroup {
- public:
- /*! Called when this ScriptGroup is added to the system.
- @param ID Unique object ID assigned when created (%this in script).
- */
- void onAdd( SimObjectId ID );
- /*! Called when this ScriptObject is removed from the system.
- @param ID Unique object ID assigned when created (%this in script).
- */
- void onRemove( SimObjectId ID );
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A SimSet that can be safely persisted.
- Uses SimPersistIDs to reference objects in the set while persisted on disk. This allows the set to resolve its references no matter whether they are loaded before or after the set is created.
- Not intended for game development, for editors or internal use only.
- */
- class SimPersistSet : public SimSet {
- public:
- /*! Try to bind unresolved persistent IDs in the set. */
- virtual void resolvePersistentIds(()) {}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief File I/O object used for creating, reading, and writing XML documents.
- A SimXMLDocument is a container of various XML nodes. The Document level may contain a header (sometimes called a declaration), comments and child Elements. Elements may contain attributes, data (or text) and child Elements.
- You build new Elements using addNewElement(). This makes the new Element the current one you're working with. You then use setAttribute() to add attributes to the Element. You use addData() or addText() to write to the text area of an Element.@tsexample
- // Thanks to Rex Hiebert for this example
- // Given the following XML
- <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
- <DataTables>
- <table tableName="2DShapes">
- <rec id="1">Triangle</rec>
- <rec id="2">Square</rec>
- <rec id="3">Circle</rec>
- </table>
- <table tableName="3DShapes">
- <rec id="1">Pyramid</rec>
- <rec id="2">Cube</rec>
- <rec id="3">Sphere</rec>
- </table>
- </DataTables>
- // Using SimXMLDocument by itself
- function readXmlExample(%filename)
- {
- %xml = new SimXMLDocument() {};
- %xml.loadFile(%filename);
- %xml.pushChildElement("DataTables");
- %xml.pushFirstChildElement("table");
- while(true)
- {
- echo("TABLE:" SPC %xml.attribute("tableName"));
- %xml.pushFirstChildElement("rec");
- while (true)
- {
- %id = %xml.attribute("id");
- %desc = %xml.getData();
- echo(" Shape" SPC %id SPC %desc);
- if (!%xml.nextSiblingElement("rec")) break;
- }
- %xml.popElement();
- if (!%xml.nextSiblingElement("table")) break;
- }
- }
- // Thanks to Scott Peal for this example
- // Using FileObject in conjunction with SimXMLDocument
- // This example uses an XML file with a format of:
- // <Models>
- // <Model category="" name="" path="" />
- // </Models>
- function getModelsInCatagory()
- {
- %file = "./Catalog.xml";
- %fo = new FileObject();
- %text = "";
- if(%fo.openForRead(%file))
- {
- while(!%fo.isEOF())
- {
- %text = %text @ %fo.readLine();
- if (!%fo.isEOF()) %text = %text @ "\n";
- }
- }
- else
- {
- echo("Unable to locate the file: " @ %file);
- }
- %fo.delete();
- %xml = new SimXMLDocument() {};
- %xml.parse(%text);
- // "Get" inside of the root element, "Models".
- %xml.pushChildElement(0);
- // "Get" into the first child element
- if (%xml.pushFirstChildElement("Model"))
- {
- while (true)
- {
- //
- // Here, i read the element's attributes.
- // You might want to save these values in an array or call the %xml.getElementValue()
- // if you have a different XML structure.
- %catagory = %xml.attribute("catagory");
- %name = %xml.attribute("name");
- %path = %xml.attribute("path");
- // now, read the next "Model"
- if (!%xml.nextSiblingElement("Model")) break;
- }
- }
- }
- @endtsexample
- @note SimXMLDocument is a wrapper around TinyXml, a standard XML library. If you're familiar with its concepts, you'll find they also apply here.
- @see FileObject
- @ingroup FileSystem
- */
- class SimXMLDocument : public SimObject {
- public:
- /*! @brief Set this document to its default state.
- Clears all Elements from the documents. Equivalent to using clear()
- @see clear() */
- virtual void reset(()) {}
- /*! @brief Load in given filename and prepare it for use.
- @note Clears the current document's contents.
- @param fileName Name and path of XML document
- @return True if the file was loaded successfully. */
- virtual bool loadFile(( string fileName )) {}
- /*! @brief Save document to the given file name.
- @param fileName Path and name of XML file to save to.
- @return True if the file was successfully saved. */
- virtual bool saveFile(( string fileName )) {}
- /*! @brief Create a document from a XML string.
- @note Clears the current document's contents.
- @param xmlString Valid XML to parse and store as a document. */
- virtual void parse(( string xmlString )) {}
- /*! @brief Set this document to its default state.
- Clears all Elements from the documents. Equivalent to using reset()
- @see reset() */
- virtual void clear(()) {}
- /*! @brief Get last error description.
- @return A string of the last error message. */
- virtual string getErrorDesc(()) {}
- /*! @brief Clear the last error description.
- */
- virtual void clearError(()) {}
- /*! @brief Push the first child Element with the given name onto the stack, making it the current Element.
- @param name String containing name of the child Element.
- @return True if the Element was found and made the current one.
- @tsexample
- // Using the following test.xml file as an example:
- // <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
- // <NewElement>Some text</NewElement>
- // Load in the file
- %x = new SimXMLDocument();
- %x.loadFile("test.xml");
- // Make the first Element the current one
- %x.pushFirstChildElement("NewElement");
- // Store the current Element's text ('Some text' in this example)
- // into 'result'
- %result = %x.getText();
- echo( %result );
- @endtsexample
- */
- virtual bool pushFirstChildElement(( string name )) {}
- /*! @brief Push the child Element at the given index onto the stack, making it the current one.
- @param index Numerical index of Element being pushed.@return True if the Element was found and made the current one.
- */
- virtual bool pushChildElement(( int index )) {}
- /*! @brief Put the next sibling Element with the given name on the stack, making it the current one.
- @param name String containing name of the next sibling.@return True if the Element was found and made the current one.
- */
- virtual bool nextSiblingElement(( string name )) {}
- /*! @brief Get the Element's value if it exists.
- Usually returns the text from the Element.
- @return The value from the Element, or an empty string if none is found. */
- virtual string elementValue(()) {}
- /*! @brief Pop the last Element off the stack.
- */
- virtual void popElement(()) {}
- /*! @brief Get a string attribute from the current Element on the stack.
- @param attributeName Name of attribute to retrieve.
- @return The attribute string if found. Otherwise returns an empty string.
- */
- virtual string attribute(( string attributeName )) {}
- /*! @brief Get float attribute from the current Element on the stack.
- @param attributeName Name of attribute to retrieve.
- @return The value of the given attribute in the form of a float.
- @deprecated Use attribute(). */
- virtual float attributeF32((string attributeName)) {}
- /*! @brief Get int attribute from the current Element on the stack.
- @param attributeName Name of attribute to retrieve.
- @return The value of the given attribute in the form of an integer.
- @deprecated Use attribute(). */
- virtual int attributeS32((string attributeName)) {}
- /*! @brief Tests if the requested attribute exists.
- @param attributeName Name of attribute being queried for.
- @return True if the attribute exists. */
- virtual bool attributeExists(( string attributeName )) {}
- /*! @brief Obtain the name of the current Element's first attribute.
- @return String containing the first attribute's name, or an empty string if none is found.
- @see nextAttribute()
- @see lastAttribute()
- @see prevAttribute() */
- virtual string firstAttribute(()) {}
- /*! @brief Obtain the name of the current Element's last attribute.
- @return String containing the last attribute's name, or an empty string if none is found.
- @see prevAttribute()
- @see firstAttribute()
- @see lastAttribute()
- */
- virtual string lastAttribute(()) {}
- /*! @brief Get the name of the next attribute for the current Element after a call to firstAttribute().
- @return String containing the next attribute's name, or an empty string if none is found.@see firstAttribute()
- @see lastAttribute()
- @see prevAttribute()
- */
- virtual string nextAttribute(()) {}
- /*! @brief Get the name of the previous attribute for the current Element after a call to lastAttribute().
- @return String containing the previous attribute's name, or an empty string if none is found.@see lastAttribute()
- @see firstAttribute()
- @see nextAttribute()
- */
- virtual string prevAttribute(()) {}
- /*! @brief Set the attribute of the current Element on the stack to the given value.
- @param attributeName Name of attribute being changed
- @param value New value to assign to the attribute
- */
- virtual void setAttribute(( string attributeName, string value )) {}
- /*! @brief Add the given SimObject's fields as attributes of the current Element on the stack.
- @param objectID ID of SimObject being copied. */
- virtual void setObjectAttributes(( string objectID )) {}
- /*! @brief Create a new element with the given name as child of current Element and push it onto the Element stack making it the current one.
- @note This differs from addNewElement() in that it adds the new Element as a child of the current Element (or a child of the document if no Element exists).
- @param name XML tag for the new Element.
- @see addNewElement() */
- virtual void pushNewElement(( string name )) {}
- /*! @brief Create a new element with the given name as child of current Element's parent and push it onto the Element stack making it the current one.
- @note This differs from pushNewElement() in that it adds the new Element to the current Element's parent (or document if there is no parent Element). This makes the new Element a sibling of the current one.
- @param name XML tag for the new Element.
- @see pushNewElement() */
- virtual void addNewElement(( string name )) {}
- /*! @brief Add a XML header to a document.
- Sometimes called a declaration, you typically add a standard header to the document before adding any elements. SimXMLDocument always produces the following header:
- <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
- @tsexample
- // Create a new XML document with just a header and single element.
- %x = new SimXMLDocument();
- %x.addHeader();
- %x.addNewElement("NewElement");
- %x.saveFile("test.xml");
- // Produces the following file:
- // <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
- // <NewElement />
- @endtsexample
- */
- virtual void addHeader(()) {}
- /*! @brief Add the given comment as a child of the document.
- @param comment String containing the comment.@tsexample
- // Create a new XML document with a header, a comment and single element.
- %x = new SimXMLDocument();
- %x.addHeader();
- %x.addComment("This is a test comment");
- %x.addNewElement("NewElement");
- %x.saveFile("test.xml");
- // Produces the following file:
- // <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
- // <!--This is a test comment-->
- // <NewElement />
- @endtsexample
- @see readComment() */
- virtual void addComment(( string comment )) {}
- /*! Gives the comment at the specified index, if any.
- Unlike addComment() that only works at the document level, readComment() may read comments from the document or any child Element. The current Element (or document if no Elements have been pushed to the stack) is the parent for any comments, and the provided index is the number of comments in to read back.@param index Comment index number to query from the current Element stack
- @return String containing the comment, or an empty string if no comment is found.
- @see addComment() */
- virtual string readComment(( int index )) {}
- /*! @brief Add the given text as a child of current Element.
- Use getText() to retrieve any text from the current Element and removeText() to clear any text.
- addText() and addData() may be used interchangeably.@param text String containing the text.
- @tsexample
- // Create a new XML document with a header and single element
- // with some added text.
- %x = new SimXMLDocument();
- %x.addHeader();
- %x.addNewElement("NewElement");
- %x.addText("Some text");
- %x.saveFile("test.xml");
- // Produces the following file:
- // <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
- // <NewElement>Some text</NewElement>
- @endtsexample
- @see getText()
- @see removeText()
- @see addData()
- @see getData() */
- virtual void addText(( string text )) {}
- /*! @brief Gets the text from the current Element.
- Use addText() to add text to the current Element and removeText() to clear any text.
- getText() and getData() may be used interchangeably.@return String containing the text in the current Element.@tsexample
- // Using the following test.xml file as an example:
- // <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
- // <NewElement>Some text</NewElement>
- // Load in the file
- %x = new SimXMLDocument();
- %x.loadFile("test.xml");
- // Make the first Element the current one
- %x.pushFirstChildElement("NewElement");
- // Store the current Element's text ('Some text' in this example)
- // into 'result'
- %result = %x.getText();
- echo( %result );
- @endtsexample
- @see addText()
- @see removeText()
- @see addData()
- @see getData()
- */
- virtual string getText(()) {}
- /*! @brief Remove any text on the current Element.
- Use getText() to retrieve any text from the current Element and addText() to add text to the current Element. As getData() and addData() are equivalent to getText() and addText(), removeText() will also remove any data from the current Element.
- @see addText()
- @see getText()
- @see addData()
- @see getData()
- */
- virtual void removeText(()) {}
- /*! @brief Add the given text as a child of current Element.
- Use getData() to retrieve any text from the current Element.
- addData() and addText() may be used interchangeably. As there is no difference between data and text, you may also use removeText() to clear any data from the current Element.
- @param text String containing the text.
- @tsexample
- // Create a new XML document with a header and single element
- // with some added data.
- %x = new SimXMLDocument();
- %x.addHeader();
- %x.addNewElement("NewElement");
- %x.addData("Some text");
- %x.saveFile("test.xml");
- // Produces the following file:
- // <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
- // <NewElement>Some text</NewElement>
- @endtsexample
- @see getData()@see addText()
- @see getText()
- @see removeText()
- */
- virtual void addData(( string text )) {}
- /*! @brief Gets the text from the current Element.
- Use addData() to add text to the current Element.
- getData() and getText() may be used interchangeably. As there is no difference between data and text, you may also use removeText() to clear any data from the current Element.
- @return String containing the text in the current Element.@tsexample
- // Using the following test.xml file as an example:
- // <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
- // <NewElement>Some data</NewElement>
- // Load in the file
- %x = new SimXMLDocument();
- %x.loadFile("test.xml");
- // Make the first Element the current one
- %x.pushFirstChildElement("NewElement");
- // Store the current Element's data ('Some data' in this example)
- // into 'result'
- %result = %x.getData();
- echo( %result );
- @endtsexample
- @see addData()
- @see addText()
- @see getText()
- @see removeText()
- */
- virtual string getData(()) {}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief This class is responsible opening, reading, creating, and saving file contents.
- FileObject acts as the interface with OS level files. You create a new FileObject and pass into it a file's path and name. The FileObject class supports three distinct operations for working with files:
- <table border='1' cellpadding='1'><tr><th>Operation</th><th>%FileObject Method</th><th>Description</th></tr><tr><td>Read</td><td>openForRead()</td><td>Open the file for reading</td></tr><tr><td>Write</td><td>openForWrite()</td><td>Open the file for writing to and replace its contents (if any)</td></tr><tr><td>Append</td><td>openForAppend()</td><td>Open the file and start writing at its end</td></tr></table>
- Before you may work with a file you need to use one of the three above methods on the FileObject.
- @tsexample
- // Create a file object for writing
- %fileWrite = new FileObject();
- // Open a file to write to, if it does not exist it will be created
- %result = %fileWrite.OpenForWrite("./test.txt");
- if ( %result )
- {
- // Write a line to the text files
- %fileWrite.writeLine("READ. READ CODE. CODE");
- }
- // Close the file when finished
- %fileWrite.close();
- // Cleanup the file object
- %fileWrite.delete();
- // Create a file object for reading
- %fileRead = new FileObject();
- // Open a text file, if it exists
- %result = %fileRead.OpenForRead("./test.txt");
- if ( %result )
- {
- // Read in the first line
- %line = %fileRead.readline();
- // Print the line we just read
- echo(%line);
- }
- // Close the file when finished
- %fileRead.close();
- // Cleanup the file object
- %fileRead.delete();
- @endtsexample
- @ingroup FileSystem
- */
- class FileObject : public SimObject {
- public:
- /*! @brief Open a specified file for reading
- There is no limit as to what kind of file you can read. Any format and data contained within is accessible, not just text
- @param filename Path, name, and extension of file to be read@tsexample
- // Create a file object for reading
- %fileRead = new FileObject();
- // Open a text file, if it exists
- %result = %fileRead.OpenForRead("./test.txt");
- @endtsexample
- @return True if file was successfully opened, false otherwise
- */
- virtual bool openForRead(( string filename )) {}
- /*! @brief Open a specified file for writing
- There is no limit as to what kind of file you can write. Any format and data is allowable, not just text
- @param filename Path, name, and extension of file to write to@tsexample
- // Create a file object for writing
- %fileWrite = new FileObject();
- // Open a file to write to, if it does not exist it will be created
- %result = %fileWrite.OpenForWrite("./test.txt");
- @endtsexample
- @return True if file was successfully opened, false otherwise
- */
- virtual bool openForWrite(( string filename )) {}
- /*! @brief Open a specified file for writing, adding data to the end of the file
- There is no limit as to what kind of file you can write. Any format and data is allowable, not just text. Unlike openForWrite(), which will erase an existing file if it is opened, openForAppend() preserves data in an existing file and adds to it.
- @param filename Path, name, and extension of file to append to@tsexample
- // Create a file object for writing
- %fileWrite = new FileObject();
- // Open a file to write to, if it does not exist it will be created
- // If it does exist, whatever we write will be added to the end
- %result = %fileWrite.OpenForAppend("./test.txt");
- @endtsexample
- @return True if file was successfully opened, false otherwise
- */
- virtual bool openForAppend(( string filename )) {}
- /*! @brief Determines if the parser for this FileObject has reached the end of the file
- @tsexample
- // Create a file object for reading
- %fileRead = new FileObject();
- // Open a text file, if it exists
- %fileRead.OpenForRead("./test.txt");
- // Keep reading until we reach the end of the file
- while( !%fileRead.isEOF() )
- {
- %line = %fileRead.readline();
- echo(%line);
- }
- // Made it to the end
- echo("Finished reading file");
- @endtsexample
- @return True if the parser has reached the end of the file, false otherwise
- */
- virtual bool isEOF(()) {}
- /*! @brief Read a line from file.
- Emphasis on *line*, as in you cannot parse individual characters or chunks of data. There is no limitation as to what kind of data you can read.
- @tsexample
- // Create a file object for reading
- %fileRead = new FileObject();
- // Open a text file, if it exists
- %fileRead.OpenForRead("./test.txt");
- // Read in the first line
- %line = %fileRead.readline();
- // Print the line we just read
- echo(%line);
- @endtsexample
- @return String containing the line of data that was just read
- */
- virtual string readLine(()) {}
- /*! @brief Read a line from the file without moving the stream position.
- Emphasis on *line*, as in you cannot parse individual characters or chunks of data. There is no limitation as to what kind of data you can read. Unlike readLine, the parser does not move forward after reading.
- @param filename Path, name, and extension of file to be read@tsexample
- // Create a file object for reading
- %fileRead = new FileObject();
- // Open a text file, if it exists
- %fileRead.OpenForRead("./test.txt");
- // Peek the first line
- %line = %fileRead.peekLine();
- // Print the line we just peeked
- echo(%line);
- // If we peek again...
- %line = %fileRead.peekLine();
- // We will get the same output as the first time
- // since the stream did not move forward
- echo(%line);
- @endtsexample
- @return String containing the line of data that was just peeked
- */
- virtual string peekLine(()) {}
- /*! @brief Write a line to the file, if it was opened for writing.
- There is no limit as to what kind of text you can write. Any format and data is allowable, not just text. Be careful of what you write, as whitespace, current values, and literals will be preserved.
- @param text The data we are writing out to file.@tsexample
- // Create a file object for writing
- %fileWrite = new FileObject();
- // Open a file to write to, if it does not exist it will be created
- %fileWrite.OpenForWrite("./test.txt");
- // Write a line to the text files
- %fileWrite.writeLine("READ. READ CODE. CODE");
- @endtsexample
- @return True if file was successfully opened, false otherwise
- */
- virtual void writeLine(( string text )) {}
- /*! @brief Close the file.
- It is EXTREMELY important that you call this function when you are finished reading or writing to a file. Failing to do so is not only a bad programming practice, but could result in bad data or corrupt files. Remember: Open, Read/Write, Close, Delete...in that order!
- @tsexample
- // Create a file object for reading
- %fileRead = new FileObject();
- // Open a text file, if it exists
- %fileRead.OpenForRead("./test.txt");
- // Peek the first line
- %line = %fileRead.peekLine();
- // Print the line we just peeked
- echo(%line);
- // If we peek again...
- %line = %fileRead.peekLine();
- // We will get the same output as the first time
- // since the stream did not move forward
- echo(%line);
- // Close the file when finished
- %fileWrite.close();
- // Cleanup the file object
- %fileWrite.delete();
- @endtsexample
- */
- virtual void close(()) {}
- /*! FileObject.writeObject(SimObject, object prepend)@hide */
- virtual void writeObject() {}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief Represents the sky with an artist-created cubemap.
- SkyBox is not a directional light and should be used in conjunction with a Sun object.
- */
- class SkyBox : public SceneObject {
- public:
- virtual void postApply() {}
- /*! @name Sky Box
- @{ */
- /*! */
- /*!
- The name of a cubemap material for the sky box.
- */
- string Material;
- /*!
- If false the bottom of the skybox is not rendered.
- */
- bool drawBottom;
- /*!
- The height (0-1) of the fog band from the horizon to the top of the SkyBox.
- */
- float fogBandHeight;
- /// @}
- /*! @name Transform
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Mounting
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief Environmental object that triggers a day/night cycle in level.
- @note TimeOfDay only works in Advanced Lighting with a Sub object or ScatterSky
- @tsexample
- new TimeOfDay(tod)
- {
- axisTilt = "23.44";
- dayLength = "120";
- startTime = "0.15";
- time = "0.15";
- play = "0";
- azimuthOverride = "572.958";
- dayScale = "1";
- nightScale = "1.5";
- position = "598.399 550.652 196.297";
- rotation = "1 0 0 0";
- scale = "1 1 1";
- canSave = "1";
- canSaveDynamicFields = "1";
- };
- @endtsexample
- */
- class TimeOfDay : public SceneObject {
- public:
- virtual void addTimeOfDayEvent(( float elevation, string identifier )) {}
- virtual void setTimeOfDay(( float time )) {}
- virtual void setPlay(( bool enabled )) {}
- virtual void setDayLength(( float seconds )) {}
- virtual void animate(( float elevation, float degreesPerSecond )) {}
- /*! @name TimeOfDay
- @{ */
- /*! */
- /*!
- The angle in degrees between global equator and tropic.
- */
- float axisTilt;
- /*!
- The length of a virtual day in real world seconds.
- */
- float dayLength;
- /*!
- */
- float startTime;
- /*!
- Current time of day.
- */
- float time;
- /*!
- True when the TimeOfDay object is operating.
- */
- bool play;
- /*!
- */
- float azimuthOverride;
- /*!
- Scalar applied to time that elapses while the sun is up.
- */
- float dayScale;
- /*!
- Scalar applied to time that elapses while the sun is down.
- */
- float nightScale;
- /// @}
- /*! @name Transform
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Mounting
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief Object responsible for simulating wind in a level.
- When placed in the level, a ForestWindEmitter will cause tree branches to bend and sway, leaves to flutter, and create vertical bending on the tree's trunk.
- @tsexample
- // The following is a full declaration of a wind emitter
- new ForestWindEmitter()
- {
- position = "497.739 765.821 102.395";
- windEnabled = "1";
- radialEmitter = "1";
- strength = "1";
- radius = "3";
- gustStrength = "0.5";
- gustFrequency = "1";
- gustYawAngle = "10";
- gustYawFrequency = "4";
- gustWobbleStrength = "2";
- turbulenceStrength = "1";
- turbulenceFrequency = "2";
- hasMount = "0";
- scale = "3 3 3";
- canSave = "1";
- canSaveDynamicFields = "1";
- rotation = "1 0 0 0";
- };
- @endtsexample
- @ingroup FX
- @ingroup Forest
- */
- class ForestWindEmitter : public SceneObject {
- public:
- /*! @brief Mounts the wind emitter to another scene object
- @param objectID Unique ID of the object wind emitter should attach to@tsexample
- // Wind emitter previously created and named %windEmitter
- // Going to attach it to the player, making him a walking wind storm
- %windEmitter.attachToObject(%player);
- @endtsexample
- */
- virtual void attachToObject(( int objectID )) {}
- /*! @name Transform
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Mounting
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- /*! @name ForestWind
- @{ */
- /*! */
- /*!
- Determines if the emitter will be counted in wind calculations.
- */
- bool windEnabled;
- /*!
- Determines if the emitter is a global direction or local radial emitter.
- */
- bool radialEmitter;
- /*!
- The strength of the wind force.
- */
- float strength;
- /*!
- The radius of the emitter for local radial emitters.
- */
- float radius;
- /*!
- The maximum strength of a gust.
- */
- float gustStrength;
- /*!
- The frequency of gusting in seconds.
- */
- float gustFrequency;
- /*!
- The amount of degrees the wind direction can drift (both positive and negative).
- */
- float gustYawAngle;
- /*!
- The frequency of wind yaw drift, in seconds.
- */
- float gustYawFrequency;
- /*!
- The amount of random wobble added to gust and turbulence vectors.
- */
- float gustWobbleStrength;
- /*!
- The strength of gust turbulence.
- */
- float turbulenceStrength;
- /*!
- The frequency of gust turbulence, in seconds.
- */
- float turbulenceFrequency;
- /*!
- Determines if the emitter is mounted to another object.
- */
- bool hasMount;
- /// @}
- };
- class GFXCardProfilerAPI {
- public:
- /*! Returns the driver version string. */
- virtual string getVersion(()) {}
- /*! Returns the card name. */
- virtual string getCard(()) {}
- /*! Returns the card vendor name. */
- virtual string getVendor(()) {}
- /*! Returns the renderer name. For example D3D9 or OpenGL. */
- virtual string getRenderer(()) {}
- /*! Returns the amount of video memory in megabytes. */
- virtual int getVideoMemoryMB(()) {}
- /*! Used to set the value for a specific card capability.
- @param name The name of the capability being set.
- @param value The value to set for that capability. */
- virtual void setCapability(( string name, int value )) {}
- /*! Used to query the value of a specific card capability.
- @param name The name of the capability being queried.
- @param defaultValue The value to return if the capability is not defined. */
- virtual int queryProfile(( string name, int defaultValue )) {}
- };
- class GFXInit {
- public:
- /*! Return the number of graphics adapters available. @ingroup GFX */
- virtual int getAdapterCount(()) {}
- /*! Returns the name of the graphics adapter.
- @param index The index of the adapter. */
- virtual string getAdapterName(( int index )) {}
- /*! Returns the type (D3D9, D3D8, GL, Null) of a graphics adapter.
- @param index The index of the adapter. */
- virtual string getAdapterType(( int index )) {}
- /*! Returns the supported shader model of the graphics adapter or -1 if the index is bad.
- @param index The index of the adapter. */
- virtual float getAdapterShaderModel(( int index )) {}
- /*! Returns the index of the default graphics adapter. This is the graphics device which will be used to initialize the engine. */
- virtual int getDefaultAdapterIndex(()) {}
- /*! Gets the number of modes available on the specified adapter.
- @param index Index of the adapter to get modes from.
- @return The number of video modes supported by the adapter or -1 if the given adapter was not found. */
- virtual int getAdapterModeCount(( int index )) {}
- /*! Gets the details of the specified adapter mode.
- @param index Index of the adapter to query.
- @param modeIndex Index of the mode to get data from.
- @return A video mode string in the format 'width height fullscreen bitDepth refreshRate aaLevel'.
- @see GuiCanvas::getVideoMode() */
- virtual string getAdapterMode(( int index, int modeIndex )) {}
- /*! Create the NULL graphics device used for testing or headless operation. */
- virtual void createNullDevice(()) {}
- };
- class CmHotBarTabBook : public GuiTabBookCtrl {
- public:
- virtual void onTabSelected(( String text, int index )) {}
- /*! @name TabBook
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class CmHotBarTab : public GuiTabPageCtrl {
- public:
- virtual void onThisControlDropped(( Point2I dropPoint )) {}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class CmHotBarWindow : public GuiWindowCtrl {
- public:
- virtual Script onSettings(( string obj )) {}
- virtual void onClose(()) {}
- virtual int getXCells(()) {}
- virtual void setXCells(( int num )) {}
- /*! @name Window
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class GuiCmIntegralBmpBtnCtrl {
- public:
- /*! Set the bitmap to show on the button.
- @param path Path to the texture file in any of the supported formats.
- */
- virtual void setBitmap(( string path )) {}
- };
- /*!
- @brief Draws the bitmap within a special button control. Only a single bitmap is used and the
- button will be drawn in a highlighted mode when the mouse hovers over it or when it
- has been clicked.
- @tsexample
- new GuiIconButtonCtrl(TestIconButton)
- {
- buttonMargin = "4 4";
- iconBitmap = "art/gui/lagIcon.png";
- iconLocation = "Center";
- sizeIconToButton = "0";
- makeIconSquare = "1";
- textLocation = "Bottom";
- textMargin = "-2";
- autoSize = "0";
- text = "Lag Icon";
- textID = ""STR_LAG"";
- buttonType = "PushButton";
- profile = "GuiIconButtonProfile";
- };
- @endtsexample
- @see GuiControl
- @see GuiButtonCtrl
- @ingroup GuiCore
- */
- class GuiIconButtonCtrl : public GuiButtonCtrl {
- public:
- /*! @brief Set the bitmap to use for the button portion of this control.
- @param buttonFilename Filename for the image
- @tsexample
- // Define the button filename
- %buttonFilename = "pearlButton";
- // Inform the GuiIconButtonCtrl control to update its main button graphic to the defined bitmap
- %thisGuiIconButtonCtrl.setBitmap(%buttonFilename);
- @endtsexample
- @see GuiControl
- @see GuiButtonCtrl
- */
- virtual void setBitmap(( string buttonFilename )) {}
- /*!
- Margin area around the button.
- */
- Point2I buttonMargin;
- /*!
- Bitmap file for the icon to display on the button.
- */
- filename iconBitmap;
- /*!
- Where to place the icon on the control. Options are 0 (None), 1 (Left), 2 (Right), 3 (Center).
- */
- GuiIconButtonIconLocation iconLocation;
- /*!
- If true, the icon will be scaled to be the same size as the button.
- */
- bool sizeIconToButton;
- /*!
- If true, will make sure the icon is square.
- */
- bool makeIconSquare;
- /*!
- Where to place the text on the control.
- Options are 0 (None), 1 (Bottom), 2 (Right), 3 (Top), 4 (Left), 5 (Center).
- */
- GuiIconButtonTextLocation textLocation;
- /*!
- Margin between the icon and the text.
- */
- int textMargin;
- /*!
- If true, the text and icon will be automatically sized to the size of the control.
- */
- bool autoSize;
- /*! @name Button
- @{ */
- /*! */
- /// @}
- /*! @name Button
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A button that is used to represent color; often used in correlation with a color picker.
- A swatch button is a push button that uses its color field to designate the color drawn over an image, on top of a button.
- The color itself is a float value stored inside the GuiSwatchButtonCtrl::color field. The texture path that represents
- the image underlying the color is stored inside the GuiSwatchButtonCtrl::bitmap field.
- The default value assigned toGuiSwatchButtonCtrl::color is "1 1 1 1"( White ). The default/fallback image assigned to
- GuiSwatchButtonCtrl::bitmap is "core/art/gui/images/transp_grid".
- @tsexample
- // Create a GuiSwatchButtonCtrl that calls randomFunction with its current color when clicked
- %swatchButton = new GuiSwatchButtonCtrl()
- {
- profile = "GuiInspectorSwatchButtonProfile";
- command = "randomFunction( $ThisControl.color );";
- };
- @endtsexample
- */
- class GuiSwatchButtonCtrl : public GuiButtonBaseCtrl {
- public:
- /*! Set the color of the swatch control.
- @param newColor The new color string given to the swatch control in float format "r g b a".
- @note It's also important to note that when setColor is called causes
- the control's altCommand field to be executed. */
- virtual void setColor(( string newColor )) {}
- /*!
- The foreground color of GuiSwatchButtonCtrl
- */
- ColorF color;
- /*! @name Button
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief Unimplemented GUI control meant to interact with Toolbox.
- For Torque 3D editors only, soon to be deprecated
- */
- class GuiToolboxButtonCtrl : public GuiButtonCtrl {
- public:
- /*! sets the bitmap that shows when the button is active */
- virtual void setNormalBitmap(( filepath name )) {}
- /*! sets the bitmap that shows when the button is disabled */
- virtual void setLoweredBitmap(( filepath name )) {}
- /*! sets the bitmap that shows when the button is disabled */
- virtual void setHoverBitmap(( filepath name )) {}
- /*!
- */
- filename normalBitmap;
- /*!
- */
- filename loweredBitmap;
- /*!
- */
- filename hoverBitmap;
- /*! @name Button
- @{ */
- /*! */
- /// @}
- /*! @name Button
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class GuiCharWindow : public GuiWindowCtrl {
- public:
- virtual void onClose(()) {}
- /*! @name Window
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class CmGuiChatTab : public GuiTabPageCtrl {
- public:
- virtual void onThisControlDropped(( Point2I dropPoint )) {}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class CmGuiChatTabBook : public GuiTabBookCtrl {
- public:
- virtual void onTabSelected(( String text, int index )) {}
- /*! @name TabBook
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class CmGuiChatWindow : public GuiWindowCtrl {
- public:
- virtual void onSettings(()) {}
- virtual void onClose(()) {}
- virtual void chatCommand(( String text )) {}
- virtual bool getShowTimestamps(()) {}
- virtual void setShowTimestamps(( bool showTimestamps )) {}
- /*!
- Show timestamps for messages?
- */
- bool showTimestamps;
- /*!
- Log chat to file?
- */
- bool logToFile;
- /*!
- Chat Log File Name
- */
- string logFileName;
- /*! @name Window
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief Brief Description.
- This Gui Control is designed to be subclassed to let people create controls which want to receive update ticks at a constant interval. This class was created to be the Parent class of a control which used a DynamicTexture along with a VectorField to create warping effects much like the ones found in visualization displays for iTunes or Winamp. Those displays are updated at the framerate frequency. This works fine for those effects, however for an application of the same type of effects for things like Gui transitions the framerate-driven update frequency is not desirable because it does not allow the developer to be able to have any idea of a consistent user-experience.
- Enter the ITickable interface. This lets the Gui control, in this case, update the dynamic texture at a constant rate of once per tick, even though it gets rendered every frame, thus creating a framerate-independent update frequency so that the effects are at a consistent speed regardless of the specifics of the system the user is on. This means that the screen-transitions will occur in the same time on a machine getting 300fps in the Gui shell as a machine which gets 150fps in the Gui shell.
- @ingroup GuiUtil
- */
- class GuiTickCtrl : public GuiControl {
- public:
- /*! This will set this object to either be processing ticks or not */
- virtual void setProcessTicks(( [tick = true] )) {}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A container that scrolls its child control up over time.
- This container can be used to scroll a single child control in either of the four directions.
- @tsexample
- // Create a GuiAutoScrollCtrl that scrolls a long text of credits.
- new GuiAutoScrollCtrl( CreditsScroller )
- {
- position = "0 0";
- extent = Canvas.extent.x SPC Canvas.extent.y;
- scrollDirection = "Up"; // Scroll upwards.
- startDelay = 4; // Wait 4 seconds before starting to scroll.
- isLooping = false; // Don't loop the credits.
- scrollOutOfSight = true; // Scroll up fully.
- new GuiMLTextCtrl()
- {
- text = $CREDITS;
- };
- };
- function CreditsScroller::onComplete( %this )
- {
- // Switch back to main menu after credits have rolled.
- Canvas.setContent( MainMenu );
- }
- // Start rolling credits.
- Canvas.setContent( CreditsScroller );
- @endtsexample
- @note Only the first child will be scrolled.
- */
- class GuiAutoScrollCtrl : public GuiTickCtrl {
- public:
- /*! Called every 32ms on the control. */
- void onTick();
- /*! Called when the control starts to scroll. */
- void onStart();
- /*! Called when the child control has been scrolled in entirety. */
- void onComplete();
- /*! Called when the child control is reset to its initial position and the cycle starts again. */
- void onReset();
- /*! Reset scrolling. */
- virtual void reset(()) {}
- /*! @name Scrolling
- @{ */
- /*! */
- /*!
- Direction in which the child control is moved.
- */
- GuiAutoScrollDirection scrollDirection;
- /*!
- Seconds to wait before starting to scroll.
- */
- float startDelay;
- /*!
- Seconds to wait after scrolling completes before resetting and starting over.
- @note Only takes effect if #isLooping is true.
- */
- float resetDelay;
- /*!
- Padding to put around child control (in pixels).
- */
- int childBorder;
- /*!
- Scrolling speed in pixels per second.
- */
- float scrollSpeed;
- /*!
- If true, the scrolling will reset to the beginning once completing a cycle.
- */
- bool isLooping;
- /*!
- If true, the child control will be completely scrolled out of sight; otherwise it will only scroll until the other end becomes visible.
- */
- bool scrollOutOfSight;
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A container control that can be used to implement drag&drop behavior.
- GuiDragAndDropControl is a special control that can be used to allow drag&drop behavior to be implemented where GuiControls may be dragged across the canvas and the dropped on other GuiControls.
- To start a drag operation, construct a GuiDragAndDropControl and add the control that should be drag&dropped as a child to it. Note that this must be a single child control. To drag multiple controls, wrap them in a new GuiControl object as a temporary container.
- Then, to initiate the drag, add the GuiDragAndDropControl to the canvas and call startDragging(). You can optionally supply an offset to better position the GuiDragAndDropControl on the mouse cursor.
- As the GuiDragAndDropControl is then moved across the canvas, it will call the onControlDragEnter(), onControlDragExit(), onControlDragged(), and finally onControlDropped() callbacks on the visible topmost controls that it moves across. onControlDropped() is called when the mouse button is released and the drag operation thus finished.
- @tsexample
- // The following example implements drag&drop behavior for GuiSwatchButtonCtrl so that
- // one color swatch may be dragged over the other to quickly copy its color.
- //
- // This code is taken from the stock scripts.
- //---------------------------------------------------------------------------------------------
- // With this method, we start the operation when the mouse is click-dragged away from a color swatch.
- function GuiSwatchButtonCtrl::onMouseDragged( %this )
- {
- // First we construct a new temporary swatch button that becomes the payload for our
- // drag operation and give it the properties of the swatch button we want to copy.
- %payload = new GuiSwatchButtonCtrl();
- %payload.assignFieldsFrom( %this );
- %payload.position = "0 0";
- %payload.dragSourceControl = %this; // Remember where the drag originated from so that we don't copy a color swatch onto itself.
- // Calculate the offset of the GuiDragAndDropControl from the mouse cursor. Here we center
- // it on the cursor.
- %xOffset = getWord( %payload.extent, 0 ) / 2;
- %yOffset = getWord( %payload.extent, 1 ) / 2;
- // Compute the initial position of the GuiDragAndDrop control on the cavas based on the current
- // mouse cursor position.
- %cursorpos = Canvas.getCursorPos();
- %xPos = getWord( %cursorpos, 0 ) - %xOffset;
- %yPos = getWord( %cursorpos, 1 ) - %yOffset;
- // Create the drag control.
- %ctrl = new GuiDragAndDropControl()
- {
- canSaveDynamicFields = "0";
- Profile = "GuiSolidDefaultProfile";
- HorizSizing = "right";
- VertSizing = "bottom";
- Position = %xPos SPC %yPos;
- extent = %payload.extent;
- MinExtent = "4 4";
- canSave = "1";
- Visible = "1";
- hovertime = "1000";
- // Let the GuiDragAndDropControl delete itself on mouse-up. When the drag is aborted,
- // this not only deletes the drag control but also our payload.
- deleteOnMouseUp = true;
- // To differentiate drags, use the namespace hierarchy to classify them.
- // This will allow a color swatch drag to tell itself apart from a file drag, for example.
- class = "GuiDragAndDropControlType_ColorSwatch";
- };
- // Add the temporary color swatch to the drag control as the payload.
- %ctrl.add( %payload );
- // Start drag by adding the drag control to the canvas and then calling startDragging().
- Canvas.getContent().add( %ctrl );
- %ctrl.startDragging( %xOffset, %yOffset );
- }
- //---------------------------------------------------------------------------------------------
- // This method receives the drop when the mouse button is released over a color swatch control
- // during a drag operation.
- function GuiSwatchButtonCtrl::onControlDropped( %this, %payload, %position )
- {
- // Make sure this is a color swatch drag operation.
- if( !%payload.parentGroup.isInNamespaceHierarchy( "GuiDragAndDropControlType_ColorSwatch" ) )
- return;
- // If dropped on same button whence we came from,
- // do nothing.
- if( %payload.dragSourceControl == %this )
- return;
- // If a swatch button control is dropped onto this control,
- // copy it's color.
- if( %payload.isMemberOfClass( "GuiSwatchButtonCtrl" ) )
- {
- // If the swatch button is part of a color-type inspector field,
- // remember the inspector field so we can later set the color
- // through it.
- if( %this.parentGroup.isMemberOfClass( "GuiInspectorTypeColorI" ) )
- %this.parentGroup.apply( ColorFloatToInt( %payload.color ) );
- else if( %this.parentGroup.isMemberOfClass( "GuiInspectorTypeColorF" ) )
- %this.parentGroup.apply( %payload.color );
- else
- %this.setColor( %payload.color );
- }
- }
- @endtsexample
- @see GuiControl::onControlDragEnter
- @see GuiControl::onControlDragExit
- @see GuiControl::onControlDragged
- @see GuiControl::onControlDropped
- */
- class GuiDragAndDropControl : public GuiControl {
- public:
- /*! Start the drag operation.
- @param x X coordinate for the mouse pointer offset which the drag control should position itself.
- @param y Y coordinate for the mouse pointer offset which the drag control should position itself. */
- virtual void startDragging(( int x=0, int y=0 )) {}
- /*!
- If true, the control deletes itself when the left mouse button is released.
- If at this point, the drag&drop control still contains its payload, it will be deleted along with the control.
- */
- bool deleteOnMouseUp;
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A gui control allowing a window to be subdivided into panes, each of which displays a gui control child of the GuiFrameSetCtrl.
- Each gui control child will have an associated FrameDetail through which frame-specific details can be assigned. Frame-specific values override the values specified for the entire frameset.
- Note that it is possible to have more children than frames, or more frames than children. In the former case, the extra children will not be visible (they are moved beyond the visible extent of the frameset). In the latter case, frames will be empty. For example, if a frameset had two columns and two rows but only three gui control children they would be assigned to frames as follows:
- <pre>
- 1 | 2
- -----
- 3 |
- </pre>
- The last frame would be blank.
- @tsexample
- new GuiFrameSetCtrl()
- {
- columns = "3";
- rows = "2";
- borderWidth = "1";
- borderColor = "128 128 128";
- borderEnable = "dynamic";
- borderMovable = "dynamic";
- autoBalance = "1";
- fudgeFactor = "0";
- //Properties not specific to this control have been omitted from this example.
- };
- @endtsexample
- */
- class GuiFrameSetCtrl : public GuiContainer {
- public:
- /*! Override the <i>borderEnable</i> setting for this frame.
- @param index Index of the frame to modify
- @param state New borderEnable state: "on", "off" or "dynamic"
- */
- virtual void frameBorder(( int index, string state="dynamic" )) {}
- /*! Override the <i>borderMovable</i> setting for this frame.
- @param index Index of the frame to modify
- @param state New borderEnable state: "on", "off" or "dynamic"
- */
- virtual void frameMovable(( int index, string state="dynamic" )) {}
- /*! Set the minimum width and height for the frame. It will not be possible for the user to resize the frame smaller than this.
- @param index Index of the frame to modify
- @param width Minimum width in pixels
- @param height Minimum height in pixels
- */
- virtual void frameMinExtent(( int index, int width, int height )) {}
- /*! Set the padding for this frame. Padding introduces blank space on the inside edge of the frame.
- @param index Index of the frame to modify
- @param padding Frame top, bottom, left, and right padding
- */
- virtual void framePadding(( int index, RectSpacingI padding )) {}
- /*! Get the padding for this frame.
- @param index Index of the frame to query
- */
- virtual string getFramePadding(( int index )) {}
- /*! Add a new column.
- */
- virtual void addColumn(()) {}
- /*! Add a new row.
- */
- virtual void addRow(()) {}
- /*! Remove the last (rightmost) column.
- */
- virtual void removeColumn(()) {}
- /*! Remove the last (bottom) row.
- */
- virtual void removeRow(()) {}
- /*! Get the number of columns.
- @return The number of columns
- */
- virtual int getColumnCount(()) {}
- /*! Get the number of rows.
- @return The number of rows
- */
- virtual int getRowCount(()) {}
- /*! Get the horizontal offset of a column.
- @param index Index of the column to query
- @return Column offset in pixels
- */
- virtual int getColumnOffset(( int index )) {}
- /*! Get the vertical offset of a row.
- @param index Index of the row to query
- @return Row offset in pixels
- */
- virtual int getRowOffset(( int index )) {}
- /*! Set the horizontal offset of a column.
- Note that column offsets must always be in increasing order, and therefore this offset must be between the offsets of the colunns either side.
- @param index Index of the column to modify
- @param offset New column offset
- */
- virtual void setColumnOffset(( int index, int offset )) {}
- /*! Set the vertical offset of a row.
- Note that row offsets must always be in increasing order, and therefore this offset must be between the offsets of the rows either side.
- @param index Index of the row to modify
- @param offset New row offset
- */
- virtual void setRowOffset(( int index, int offset )) {}
- /*! Recalculates child control sizes. */
- virtual void updateSizes(()) {}
- /*!
- A vector of column offsets (determines the width of each column).
- */
- intList columns;
- /*!
- A vector of row offsets (determines the height of each row).
- */
- intList rows;
- /*!
- Width of interior borders between cells in pixels.
- */
- int borderWidth;
- /*!
- Color of interior borders between cells.
- */
- ColorI borderColor;
- /*!
- Controls whether frame borders are enabled.
- Frames use this value unless overridden for that frame using <i>%ctrl.frameBorder(index)</i>
- */
- GuiFrameState borderEnable;
- /*!
- Controls whether borders can be dynamically repositioned with the mouse by the user.
- Frames use this value unless overridden for that frame using <i>%ctrl.frameMovable(index)</i>
- */
- GuiFrameState borderMovable;
- /*!
- If true, row and column offsets are automatically scaled to match the new extents when the control is resized.
- */
- bool autoBalance;
- /*!
- Offset for row and column dividers in pixels
- */
- int fudgeFactor;
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A collapsable pane control.
- This class wraps a single child control and displays a header with caption above it. If you click the header it will collapse or expand (if <i>collapsable</i> is enabled). The control resizes itself based on its collapsed/expanded size.<br>In the GUI editor, if you just want the header you can make <i>collapsable</i> false. The caption field lets you set the caption; it expects a bitmap (from the GuiControlProfile) that contains two images - the first is displayed when the control is expanded and the second is displayed when it is collapsed. The header is sized based on the first image.
- @tsexample
- new GuiPaneControl()
- {
- caption = "Example Pane";
- collapsable = "1";
- barBehindText = "1";
- //Properties not specific to this control have been omitted from this example.
- };
- @endtsexample
- */
- class GuiPaneControl : public GuiControl {
- public:
- /*! Collapse or un-collapse the control.
- @param collapse True to collapse the control, false to un-collapse it
- */
- virtual void setCollapsed(( bool collapse )) {}
- /*! @name Pane
- @{ */
- /*! */
- /*!
- Text label to display as the pane header.
- */
- string caption;
- /*!
- String table text ID to use as caption string (overrides 'caption').
- */
- string captionID;
- /*!
- Whether the pane can be collapsed by clicking its header.
- */
- bool collapsable;
- /*!
- Whether to draw the bitmapped pane bar behind the header text, too.
- */
- bool barBehindText;
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A container that shows a single child with an optional header bar that can be used to collapse and expand the rollout.
- A rollout is a container that can be collapsed and expanded using smooth animation. By default, rollouts will display a header with a caption along the top edge of the control which can be clicked by the user to toggle the collapse state of the rollout.
- Rollouts will automatically size themselves to exactly fit around their child control. They will also automatically position their child control in their upper left corner below the header (if present).
- @note GuiRolloutCtrls will only work correctly with a single child control. To put multiple controls in a rollout, put them in their own group using a new GuiControl which then can be put inside the rollout.
- */
- class GuiRolloutCtrl : public GuiControl {
- public:
- /*! Called when the user right-clicks on the rollout's header. This is useful for implementing context menus for rollouts. */
- void onHeaderRightClick();
- /*! Called when the rollout is expanded. */
- void onExpanded();
- /*! Called when the rollout is collapsed. */
- void onCollapsed();
- /*! Determine whether the rollout is currently expanded, i.e. whether the child control is visible.
- @return True if the rollout is expanded, false if not. */
- virtual bool isExpanded(()) {}
- /*! Collapse the rollout if it is currently expanded. This will make the rollout's child control invisible.
- @note The rollout will animate to collapsed state. To instantly collapse without animation, use instantCollapse(). */
- virtual void collapse(()) {}
- /*! Expand the rollout if it is currently collapsed. This will make the rollout's child control visible.
- @note The rollout will animate to expanded state. To instantly expand without animation, use instantExpand(). */
- virtual void expand(()) {}
- /*! Toggle the current collapse state of the rollout. If it is currently expanded, then collapse it. If it is currently collapsed, then expand it. */
- virtual void toggleCollapse(()) {}
- /*! Toggle the current expansion state of the rollout If it is currently expanded, then collapse it. If it is currently collapsed, then expand it.
- @param instant If true, the rollout will toggle its state without animation. Otherwise, the rollout will smoothly slide into the opposite state. */
- virtual void toggleExpanded(( bool instantly=false )) {}
- /*! Instantly collapse the rollout without animation. To smoothly slide the rollout to collapsed state, use collapse(). */
- virtual void instantCollapse(()) {}
- /*! Instantly expand the rollout without animation. To smoothly slide the rollout to expanded state, use expand(). */
- virtual void instantExpand(()) {}
- /*! Resize the rollout to exactly fit around its child control. This can be used to manually trigger a recomputation of the rollout size. */
- virtual void sizeToContents(()) {}
- /*! @name Rollout
- @{ */
- /*! */
- /*!
- Text label to display on the rollout header.
- */
- string caption;
- /*!
- Margin to put around child control.
- */
- RectI margin;
- /*!
- Default height of the client area. This is used when no child control has been added to the rollout.
- */
- int defaultHeight;
- /*!
- The current rollout expansion state.
- */
- bool expanded;
- /*!
- Whether the rollout can be collapsed by clicking its header.
- */
- bool clickCollapse;
- /*!
- Whether to render the rollout header.
- @note If this is false, the user cannot toggle the rollout state with the mouse.
- */
- bool hideHeader;
- /*!
- Whether to automatically collapse sibling rollouts.
- If this is true, the rollout will automatically collapse all sibling rollout controls when it is expanded. If this is false, the auto-collapse behavior can be triggered by CTRL (CMD on MAC) clicking the rollout header. CTRL/CMD clicking also works if this is false, in which case the auto-collapsing of sibling controls will be temporarily deactivated.
- */
- bool autoCollapseSiblings;
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief Editor GUI used for picking a ColorF from a palette.
- @note Editor use only.
- */
- class GuiColorPickerCtrl : public GuiControl {
- public:
- /*! Gets the current position of the selector */
- virtual string getSelectorPos() {}
- /*! Sets the current position of the selector */
- virtual void setSelectorPos() {}
- /*! Forces update of pick color */
- virtual void updateColor() {}
- /*! @name ColorPicker
- @{ */
- /*! */
- /*!
- */
- ColorF baseColor;
- /*!
- */
- ColorF pickColor;
- /*!
- */
- int selectorGap;
- /*!
- */
- GuiColorPickMode displayMode;
- /*!
- */
- bool actionOnMove;
- /*!
- */
- bool showReticle;
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A list of text items.
- A list of text items where each individual entry can have its own text value, text color and associated SimObject.
- @tsexample
- new GuiListBoxCtrl(GuiMusicPlayerMusicList)
- {
- allowMultipleSelections = "true";
- fitParentWidth = "true";
- mirrorSet = "AnotherGuiListBoxCtrl";
- makeNameCallback = "";
- colorBullet = "1";
- //Properties not specific to this control have been omitted from this example.
- };
- @endtsexample
- @see GuiControl
- @ingroup GuiCore
- */
- class GuiListBoxCtrl : public GuiControl {
- public:
- /*! @brief Called whenever the mouse is dragged across the control.
- @tsexample
- // Mouse is dragged across the control, causing the callback to occur.
- GuiListBoxCtrl::onMouseDragged(%this)
- {
- // Code to run whenever the mouse is dragged across the control
- }
- @endtsexample
- @see GuiControl
- */
- void onMouseDragged();
- /*! @brief Called whenever a selected item in the list is cleared.
- @tsexample
- // A selected item is cleared, causing the callback to occur.
- GuiListBoxCtrl::onClearSelection(%this)
- {
- // Code to run whenever a selected item is cleared
- }
- @endtsexample
- @see GuiControl
- */
- void onClearSelection();
- /*! @brief Called whenever a selected item in the list has been unselected.
- @param index Index id of the item that was unselected
- @param itemText Text for the list entry at the index id that was unselected
- @tsexample
- // A selected item is unselected, causing the callback to occur
- GuiListBoxCtrl::onUnSelect(%this, %indexId, %itemText)
- {
- // Code to run whenever a selected list item is unselected
- }
- @endtsexample
- @see GuiControl
- */
- void onUnselect( string index, string itemText );
- /*! @brief Called whenever an item in the list is selected.
- @param index Index id for the item in the list that was selected.
- @param itemText Text for the list item at the index that was selected.
- @tsexample
- // An item in the list is selected, causing the callback to occur
- GuiListBoxCtrl::onSelect(%this, %index, %itemText)
- {
- // Code to run whenever an item in the list is selected
- }
- @endtsexample
- @see GuiControl
- */
- void onSelect( string index, string itemText );
- /*! @brief Called whenever an item in the list has been double clicked.
- @tsexample
- // An item in the list is double clicked, causing the callback to occur.
- GuiListBoxCtrl::onDoubleClick(%this)
- {
- // Code to run whenever an item in the control has been double clicked
- }
- @endtsexample
- @see GuiControl
- */
- void onDoubleClick();
- /*! @brief Called whenever the mouse has previously been clicked down (onMouseDown) and has now been raised on the control.
- If an item in the list was hit during the click cycle, then the index id of the clicked object along with how many clicks occured are passed
- into the callback.
- Detailed description
- @param itemHit Index id for the list item that was hit
- @param mouseClickCount How many mouse clicks occured on this list item
- @tsexample
- // Mouse was previously clicked down, and now has been released, causing the callback to occur.
- GuiListBoxCtrl::onMouseUp(%this, %itemHit, %mouseClickCount)
- {
- // Code to call whenever the mouse has been clicked and released on the control
- }
- @endtsexample
- @see GuiControl
- */
- void onMouseUp( string itemHit, string mouseClickCount );
- /*! @brief Called whenever the Delete key on the keyboard has been pressed while in this control.
- @tsexample
- // The delete key on the keyboard has been pressed while this control is in focus, causing the callback to occur.
- GuiListBoxCtrl::onDeleteKey(%this)
- {
- // Code to call whenever the delete key is pressed
- }
- @endtsexample
- @see GuiControl
- */
- void onDeleteKey();
- /*! @brief Checks if a list item at a defined index id is mirrored, and returns the result.
- @param indexIdString Index id of the list to check.
- @tsexample
- // Engine has requested of the script level to determine if a list entry is mirrored or not.
- GuiListBoxCtrl::isObjectMirrored(%this, %indexIdString)
- {
- // Perform code required to check and see if the list item at the index id is mirrored or not.
- return %isMirrored;
- }
- @endtsexample
- @return A boolean value on if the list item is mirrored or not.
- @see GuiControl
- */
- bool isObjectMirrored( string indexIdString );
- /*! @brief Enable or disable multiple selections for this GuiListBoxCtrl object.
- @param allowMultSelections Boolean variable to set the use of multiple selections or not.
- @tsexample
- // Define the multiple selection use state.
- %allowMultSelections = "true";
- // Set the allow multiple selection state on the GuiListBoxCtrl object.
- %thisGuiListBoxCtrl.setMultipleSelection(%allowMultSelections);
- @endtsexample
- @see GuiControl
- */
- virtual void setMultipleSelection(( bool allowMultSelections )) {}
- /*! @brief Clears all the items in the listbox.
- @tsexample
- // Inform the GuiListBoxCtrl object to clear all items from its list.
- %thisGuiListBoxCtrl.clearItems();
- @endtsexample
- @see GuiControl */
- virtual void clearItems(()) {}
- /*! @brief Sets all currently selected items to unselected.
- Detailed description
- @tsexample
- // Inform the GuiListBoxCtrl object to set all of its items to unselected./n%thisGuiListBoxCtrl.clearSelection();
- @endtsexample
- @see GuiControl */
- virtual void clearSelection(()) {}
- /*! @brief Sets the item at the index specified to selected or not.
- Detailed description
- @param index Item index to set selected or unselected.
- @param setSelected Boolean selection state to set the requested item index.
- @tsexample
- // Define the index
- %index = "5";
- // Define the selection state
- %selected = "true"
- // Inform the GuiListBoxCtrl object of the new selection state for the requested index entry.
- %thisGuiListBoxCtrl.setSelected(%index,%selected);
- @endtsexample
- @see GuiControl */
- virtual void setSelected(( int index, bool setSelected=true )) {}
- /*! @brief Returns the number of items in the list.
- @tsexample
- // Request the number of items in the list of the GuiListBoxCtrl object.
- %listItemCount = %thisGuiListBoxCtrl.getItemCount();
- @endtsexample
- @return The number of items in the list.
- @see GuiControl */
- virtual int getItemCount(()) {}
- /*! @brief Returns the number of items currently selected.
- @tsexample
- // Request the number of currently selected items
- %selectedItemCount = %thisGuiListBoxCtrl.getSelCount();
- @endtsexample
- @return Number of currently selected items.
- @see GuiControl */
- virtual int getSelCount(()) {}
- /*! @brief Returns the selected items index or -1 if none selected. If multiple selections exist it returns the first selected item.
- @tsexample
- // Request the index id of the currently selected item
- %selectedItemId = %thisGuiListBoxCtrl.getSelectedItem();
- @endtsexample
- @return The selected items index or -1 if none selected.
- @see GuiControl */
- virtual int getSelectedItem(()) {}
- /*! @brief Returns a space delimited list of the selected items indexes in the list.
- @tsexample
- // Request a space delimited list of the items in the GuiListBoxCtrl object.
- %selectionList = %thisGuiListBoxCtrl.getSelectedItems();
- @endtsexample
- @return Space delimited list of the selected items indexes in the list
- @see GuiControl */
- virtual string getSelectedItems(()) {}
- /*! @brief Returns index of item with matching text or -1 if none found.
- @param findText Text in the list to find.
- @param isCaseSensitive If true, the search will be case sensitive.
- @tsexample
- // Define the text we wish to find in the list.
- %findText = "Hickory Smoked Gideon"/n/n// Define if this is a case sensitive search or not.
- %isCaseSensitive = "false";
- // Ask the GuiListBoxCtrl object what item id in the list matches the requested text.
- %matchingId = %thisGuiListBoxCtrl.findItemText(%findText,%isCaseSensitive);
- @endtsexample
- @return Index id of item with matching text or -1 if none found.
- @see GuiControl */
- virtual int findItemText(( string findText, bool bCaseSensitive=false )) {}
- /*! @brief Sets the currently selected item at the specified index.
- @param indexId Index Id to set selected.
- @tsexample
- // Define the index id that we wish to select.
- %selectId = "4";
- // Inform the GuiListBoxCtrl object to set the requested index as selected.
- %thisGuiListBoxCtrl.setCurSel(%selectId);
- @endtsexample
- @see GuiControl */
- virtual void setCurSel(( int indexId )) {}
- /*! @brief Sets the current selection range from index start to stop. If no stop is specified it sets from start index to the end of the list
- @param indexStart Index Id to start selection.
- @param indexStop Index Id to end selection.
- @tsexample
- // Set start id
- %indexStart = "3";
- // Set end id
- %indexEnd = "6";
- // Request the GuiListBoxCtrl object to select the defined range.
- %thisGuiListBoxCtrl.setCurSelRange(%indexStart,%indexEnd);
- @endtsexample
- @see GuiControl */
- virtual void setCurSelRange(( int indexStart, int indexStop=999999 )) {}
- /*! @brief Adds an item to the end of the list with an optional color.
- @param newItem New item to add to the list.
- @param color Optional color parameter to add to the new item.
- @tsexample
- // Define the item to add to the list.
- %newItem = "Gideon's Blue Coat";
- // Define the optional color for the new list item.
- %color = "0.0 0.0 1.0";
- // Inform the GuiListBoxCtrl object to add the item to the end of the list with the defined color.
- %thisGuiListBoxCtrl.addItem(%newItem,%color);
- @endtsexample
- @return If not void, return value and description
- @see GuiControl
- @hide */
- virtual int addItem(( string newItem, string color="" )) {}
- /*! @brief Sets the color of a single list entry at the specified index id.
- @param index Index id to modify the color of in the list.
- @param color Color value to set the list entry to.
- @tsexample
- // Define the index id value
- %index = "5";
- // Define the color value
- %color = "1.0 0.0 0.0";
- // Inform the GuiListBoxCtrl object to change the color of the requested index
- %thisGuiListBoxCtrl.setItemColor(%index,%color);
- @endtsexample
- @see GuiControl */
- virtual void setItemColor(( int index, ColorF color )) {}
- /*! @brief Removes any custom coloring from an item at the defined index id in the list.
- @param index Index id for the item to clear any custom color from.
- @tsexample
- // Define the index id
- %index = "4";
- // Request the GuiListBoxCtrl object to remove any custom coloring from the defined index entry
- %thisGuiListBoxCtrl.clearItemColor(%index);
- @endtsexample
- @see GuiControl */
- virtual void clearItemColor(( int index )) {}
- /*! @brief Inserts an item into the list at the specified index and returns the index assigned or -1 on error.
- @param text Text item to add.
- @param index Index id to insert the list item text at.
- @tsexample
- // Define the text to insert
- %text = "Secret Agent Gideon";
- // Define the index entry to insert the text at
- %index = "14";
- // In form the GuiListBoxCtrl object to insert the text at the defined index.
- %assignedId = %thisGuiListBoxCtrl.insertItem(%text,%index);
- @endtsexample
- @return If successful will return the index id assigned. If unsuccessful, will return -1.
- @see GuiControl */
- virtual void insertItem(( string text, int index )) {}
- /*! @brief Removes the list entry at the requested index id from the control and clears the memory associated with it.
- @param itemIndex Index id location to remove the item from.
- @tsexample
- // Define the index id we want to remove from the list
- %itemIndex = "8";
- // Inform the GuiListBoxCtrl object to remove the item at the defined index id.
- %thisGuiListBoxCtrl.deleteItem(%itemIndex);
- @endtsexample
- @see References */
- virtual void deleteItem(( int itemIndex )) {}
- /*! @brief Returns the text of the item at the specified index.
- @param index Index id to return the item text from.
- @tsexample
- // Define the index id entry to request the text from
- %index = "12";
- // Request the item id text from the GuiListBoxCtrl object.
- %text = %thisGuiListBoxCtrl.getItemText(%index);
- @endtsexample
- @return The text of the requested index id.
- @see GuiControl */
- virtual string getItemText(( int index )) {}
- /*! @brief Returns the object associated with an item. This only makes sense if you are mirroring a simset.
- @param index Index id to request the associated item from.
- @tsexample
- // Define the index id
- %index = "12";
- // Request the item from the GuiListBoxCtrl object
- %object = %thisGuiListBoxCtrl.getItemObject(%index);
- @endtsexample
- @return The object associated with the item in the list.
- @see References */
- virtual string getItemObject(( int index )) {}
- /*! @brief Sets the items text at the specified index.
- @param index Index id to set the item text at.
- @param newtext Text to change the list item at index id to.
- @tsexample
- // Define the index id/n%index = "12";
- // Define the text to set the list item to
- %newtext = "Gideon's Fancy Goggles";
- // Inform the GuiListBoxCtrl object to change the text at the requested index
- %thisGuiListBoxCtrl.setItemText(%index,%newText);
- @endtsexample
- @see GuiControl */
- virtual void setItemText(( int index, string newtext )) {}
- /*! @brief Set the tooltip text to display for the given list item.
- @param index Index id to change the tooltip text
- @param text Text for the tooltip.
- @tsexample
- // Define the index id
- %index = "12";
- // Define the tooltip text
- %tooltip = "Gideon's goggles can see through space and time."
- // Inform the GuiListBoxCtrl object to set the tooltop for the item at the defined index id
- %thisGuiListBoxCtrl.setItemToolTip(%index,%tooltip);
- @endtsexample
- @see GuiControl */
- virtual void setItemTooltip(( int index, string text )) {}
- /*! @brief Request the item index for the item that was last clicked.
- @tsexample
- // Request the item index for the last clicked item in the list
- %lastClickedIndex = %thisGuiListBoxCtrl.getLastClickItem();
- @endtsexample
- @return Index id for the last clicked item in the list.
- @see GuiControl */
- virtual int getLastClickItem(()) {}
- /*! @brief Informs the GuiListBoxCtrl object to mirror the contents of the GuiListBoxCtrl stored in the mirrorSet field.
- @tsexample
- \ Inform the object to mirror the object located at %thisGuiListBox.mirrorSet
- %thisGuiListBox.doMirror();
- @endtsexample
- @see GuiCore */
- virtual void doMirror(()) {}
- /*! @brief Checks if there is an item with the exact text of what is passed in, and if so
- the item is removed from the list and adds that item's data to the filtered list.
- @param itemName Name of the item that we wish to add to the filtered item list of the GuiListBoxCtrl.
- @tsexample
- // Define the itemName that we wish to add to the filtered item list.
- %itemName = "This Item Name";
- // Add the item name to the filtered item list.
- %thisGuiListBoxCtrl.addFilteredItem(%filteredItemName);
- @endtsexample
- @see GuiControl */
- virtual void addFilteredItem(( string newItem )) {}
- /*! @brief Removes an item of the entered name from the filtered items list.
- @param itemName Name of the item to remove from the filtered list.
- @tsexample
- // Define the itemName that you wish to remove.
- %itemName = "This Item Name";
- // Remove the itemName from the GuiListBoxCtrl
- %thisGuiListBoxCtrl.removeFilteredItem(%itemName);
- @endtsexample
- @see GuiControl */
- virtual void removeFilteredItem(( string itemName )) {}
- /*! @brief Returns the associated ID.
- */
- virtual int getItemData(( int index )) {}
- /*! @brief Returns the associated ID.
- */
- virtual int getItemIndexByData(( int data )) {}
- /*!
- If true, will allow the selection of multiple items in the listbox.
- */
- bool allowMultipleSelections;
- /*!
- If true, the width of the listbox will match the width of its parent control.
- */
- bool fitParentWidth;
- /*!
- If true, colored items will render a colored rectangular bullet next to the item text.
- */
- bool colorBullet;
- /*!
- If populated with the name of another GuiListBoxCtrl, then this list box will mirror the contents of the mirrorSet listbox.
- */
- string mirrorSet;
- /*!
- A script snippet to control what is displayed in the list for a SimObject. Within this snippet, $ThisControl is bound to the guiListBoxCtrl and $ThisObject to the contained object in question.
- */
- string makeNameCallback;
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A control that displays a list of files from within a single directory in the game file system.
- @tsexample
- new GuiDirectoryFileListCtrl()
- {
- filePath = "art/shapes";
- fileFilter = "*.dts" TAB "*.dae";
- //Properties not specific to this control have been omitted from this example.
- };
- @endtsexample
- @ingroup GuiControls
- */
- class GuiDirectoryFileListCtrl : public GuiListBoxCtrl {
- public:
- /*! Set the file filter.
- @param filter Tab-delimited list of file name patterns. Only matched files will be displayed.
- */
- virtual void setFilter(( string filter )) {}
- /*! Update the file list. */
- virtual void reload(()) {}
- /*! Set the search path and file filter.
- @param path Path in game directory from which to list files.
- @param filter Tab-delimited list of file name patterns. Only matched files will be displayed.
- */
- virtual bool setPath(( string path, string filter )) {}
- /*! Get the list of selected files.
- @return A space separated list of selected files */
- virtual string getSelectedFiles(()) {}
- /*! Get the currently selected filename.
- @return The filename of the currently selected file
- */
- virtual string getSelectedFile(()) {}
- /*!
- Path in game directory from which to list files.
- */
- string filePath;
- /*!
- Tab-delimited list of file name patterns. Only matched files will be displayed.
- */
- string fileFilter;
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief Hierarchical list of text items with optional icons.
- Can also be used to inspect SimObject hierarchies, primarily within editors.
- GuiTreeViewCtrls can either display arbitrary user-defined trees or can be used to display SimObject hierarchies where each parent node in the tree is a SimSet or SimGroup and each leaf node is a SimObject.
- Each item in the tree has a text and a value. For trees that display SimObject hierarchies, the text for each item is automatically derived from objects while the value for each item is the ID of the respective SimObject. For trees that are not tied to SimObjects, both text and value of each item are set by the user.
- Additionally, items in the tree can have icons.
- Each item in the tree has a distinct numeric ID that is unique within its tree. The ID of the root item, which is always present on a tree, is 0.
- @tsexample
- new GuiTreeViewCtrl(DatablockEditorTree)
- {
- tabSize = "16";
- textOffset = "2";
- fullRowSelect = "0";
- itemHeight = "21";
- destroyTreeOnSleep = "0";
- MouseDragging = "0";
- MultipleSelections = "1";
- DeleteObjectAllowed = "1";
- DragToItemAllowed = "0";
- ClearAllOnSingleSelection = "1";
- showRoot = "1";
- internalNamesOnly = "0";
- objectNamesOnly = "0";
- compareToObjectID = "0";
- Profile = "GuiTreeViewProfile";
- tooltipprofile = "GuiToolTipProfile";
- hovertime = "1000";
- };
- @endtsexample
- @ingroup GuiContainers
- */
- class GuiTreeViewCtrl : public GuiArrayCtrl {
- public:
- virtual Script handleRenameObject(( string this, string name, string obj )) {}
- virtual Script onDefineIcons(( string this )) {}
- /*! */
- bool onDeleteObject( SimObject object );
- /*! */
- bool isValidDragTarget( int id, string value );
- /*! */
- void onDefineIcons();
- /*! */
- void onAddGroupSelected( SimGroup group );
- /*! */
- void onAddSelection( int itemOrObjectId, bool isLastSelection );
- /*! */
- void onSelect( int itemOrObjectId );
- /*! */
- void onInspect( int itemOrObjectId );
- /*! */
- void onRemoveSelection( int itemOrObjectId );
- /*! */
- void onUnselect( int itemOrObjectId );
- /*! */
- void onDeleteSelection();
- /*! */
- void onObjectDeleteCompleted();
- /*! */
- void onKeyDown( int modifier, int keyCode );
- /*! */
- void onMouseUp( int hitItemId, int mouseClickCount );
- /*! */
- void onMouseDragged();
- /*! */
- void onRightMouseDown( int itemId, Point2I mousePos, SimObject object );
- /*! */
- void onRightMouseUp( int itemId, Point2I mousePos, SimObject object );
- /*! */
- void onBeginReparenting();
- /*! */
- void onEndReparenting();
- /*! */
- void onReparent( int itemOrObjectId, int oldParentItemOrObjectId, int newParentItemOrObjectId );
- /*! */
- void onDragDropped();
- /*! */
- void onAddMultipleSelectionBegin();
- /*! */
- void onAddMultipleSelectionEnd();
- /*! */
- bool canRenameObject( SimObject object );
- /*! */
- bool handleRenameObject( string newName, SimObject object );
- /*! */
- void onClearSelection();
- /*! Get the ID of the item whose text matches the given @a text.
- @param text Item text to match.
- @return ID of the item or -1 if no item matches the given text. */
- virtual int findItemByName(( string text )) {}
- /*! Get the ID of the item whose value matches @a value.
- @param value Value text to match.
- @return ID of the item or -1 if no item has the given value. */
- virtual int findItemByValue(( string value )) {}
- /*! Get the child item of the given parent item whose text matches @a childName.
- @param parentId Item ID of the parent in which to look for the child.
- @param childName Text of the child item to find.
- @return ID of the child item or -1 if no child in @a parentId has the given text @a childName.
- @note This method does not recurse, i.e. it only looks for direct children. */
- virtual int findChildItemByName(( int parentId, string childName )) {}
- /*! Add a new item to the tree.
- @param parentId Item ID of parent to which to add the item as a child. 0 is root item.
- @param text Text to display on the item in the tree.
- @param value Behind-the-scenes value of the item.
- @param icon
- @param normalImage
- @param expandedImage
- @return The ID of the newly added item. */
- virtual int insertItem(( int parentId, string text, string value="", string icon="", int normalImage=0, int expandedImage=0 )) {}
- /*! Call SimObject::setHidden( @a state ) on all objects in the current selection.
- @param state Visibility state to set objects in selection to. */
- virtual void hideSelection(( bool state=true )) {}
- /*! Toggle the hidden state of all objects in the current selection. */
- virtual void toggleHideSelection(()) {}
- /*! Unselect all currently selected items. */
- virtual void clearSelection(()) {}
- /*! Delete all items/objects in the current selection. */
- virtual void deleteSelection(()) {}
- /*! Add an item/object to the current selection.
- @param id ID of item/object to add to the selection.
- @param isLastSelection Whether there are more pending items/objects to be added to the selection. If false, the control will defer refreshing the tree and wait until addSelection() is called with this parameter set to true. */
- virtual void addSelection(( int id, bool isLastSelection=true )) {}
- /*! addChildSelectionByValue(TreeItemId parent, value) */
- virtual void addChildSelectionByValue() {}
- virtual void removeSelection((deselects an item)) {}
- /*! removeChildSelectionByValue(TreeItemId parent, value) */
- virtual void removeChildSelectionByValue() {}
- virtual bool selectItem((TreeItemId item, bool select=true)) {}
- virtual bool expandItem((TreeItemId item, bool expand=true)) {}
- virtual bool markItem((TreeItemId item, bool mark=true)) {}
- virtual void scrollVisible((TreeItemId item)) {}
- virtual bool buildIconTable((builds an icon table)) {}
- /*! Set the root of the tree view to the specified object, or to the root set. */
- virtual void open((SimSet obj, bool okToEdit=true)) {}
- /*! Set the tooltip to show for the given item. */
- virtual void setItemTooltip(( int id, string text )) {}
- /*! Sets the normal and expanded images to show for the given item. */
- virtual void setItemImages(( int id, int normalImage, int expandedImage )) {}
- /*! Returns true if the given item contains child items. */
- virtual bool isParentItem(( int id )) {}
- virtual string getItemText((TreeItemId item)) {}
- virtual string getItemValue((TreeItemId item)) {}
- virtual bool editItem((TreeItemId item, string newText, string newValue)) {}
- virtual bool removeItem((TreeItemId item)) {}
- /*! removeAllChildren(TreeItemId parent) */
- virtual void removeAllChildren() {}
- /*! empty tree */
- virtual void clear(()) {}
- /*! Get id for root item. */
- virtual int getFirstRootItem() {}
- virtual int getChild((TreeItemId item)) {}
- /*! Build the visible tree */
- virtual void buildVisibleTree() {}
- virtual int getParent((TreeItemId item)) {}
- virtual int getNextSibling((TreeItemId item)) {}
- virtual int getPrevSibling((TreeItemId item)) {}
- virtual int getItemCount() {}
- /*! Return the selected item at the given index. */
- virtual int getSelectedItem(( int index=0 )) {}
- /*! Return the currently selected SimObject at the given index in inspector mode or -1 */
- virtual int getSelectedObject(( int index=0 )) {}
- /*! Returns a space sperated list of all selected object ids. */
- virtual string getSelectedObjectList() {}
- virtual void moveItemUp((TreeItemId item)) {}
- virtual int getSelectedItemsCount() {}
- virtual void moveItemDown((TreeItemId item)) {}
- /*! gets the text from the current node to the root, concatenating at each branch upward, with a specified delimiter optionally */
- virtual string getTextToRoot((TreeItemId item,Delimiter=none)) {}
- /*! returns a space seperated list of mulitple item ids */
- virtual string getSelectedItemList() {}
- virtual int findItemByObjectId((find item by object id and returns the mId)) {}
- virtual int scrollVisibleByObjectId((show item by object id. returns true if sucessful.)) {}
- /*! Sorts all items of the given parent (or root). With 'hierarchy', traverses hierarchy. */
- virtual void sort(( int parent, bool traverseHierarchy=false, bool parentsFirst=false, bool caseSensitive=true )) {}
- /*! For internal use. */
- virtual void cancelRename() {}
- /*! For internal use. */
- virtual void onRenameValidate() {}
- /*! Show the rename text field for the given item (only one at a time). */
- virtual void showItemRenameCtrl(( TreeItemId id )) {}
- /*! Enable/disable debug output. */
- virtual void setDebug(( bool value=true )) {}
- /*! Check whether the given item is currently selected in the tree.
- @param id Item/object ID.
- @return True if the given item/object is currently selected in the tree. */
- virtual bool isItemSelected(( int id )) {}
- /*! Get the current filter expression. Only tree items whose text matches this expression are displayed. By default, the expression is empty and all items are shown.
- @return The current filter pattern or an empty string if no filter pattern is currently active.
- @see setFilterText
- @see clearFilterText */
- virtual string getFilterText(()) {}
- /*! Set the pattern by which to filter items in the tree. Only items in the tree whose text matches this pattern are displayed.
- @param pattern New pattern based on which visible items in the tree should be filtered. If empty, all items become visible.
- @see getFilterText
- @see clearFilterText */
- virtual void setFilterText(( string pattern )) {}
- /*! Clear the current item filtering pattern.
- @see setFilterText
- @see getFilterText */
- virtual void clearFilterText(()) {}
- /*! @name TreeView
- @{ */
- /*! */
- /*!
- */
- int tabSize;
- /*!
- */
- int textOffset;
- /*!
- */
- bool fullRowSelect;
- /*!
- */
- int itemHeight;
- /*!
- If true, the entire tree item hierarchy is deleted when the control goes to sleep.
- */
- bool destroyTreeOnSleep;
- /*!
- */
- bool mouseDragging;
- /*!
- If true, multiple items can be selected concurrently.
- */
- bool multipleSelections;
- /*!
- */
- bool deleteObjectAllowed;
- /*!
- */
- bool dragToItemAllowed;
- /*!
- */
- bool clearAllOnSingleSelection;
- /*!
- If true, the root item is shown in the tree.
- */
- bool showRoot;
- /*!
- */
- bool useInspectorTooltips;
- /*!
- */
- bool tooltipOnWidthOnly;
- /*!
- */
- string itemFilter;
- /*!
- */
- bool itemFilterEnable;
- /// @}
- /*! @name Inspector Trees
- @{ */
- /*! */
- /*!
- If true, item text labels for objects will include object IDs.
- */
- bool showObjectIds;
- /*!
- If true, item text labels for objects will include class names.
- */
- bool showClassNames;
- /*!
- If true, item text labels for objects will include object names.
- */
- bool showObjectNames;
- /*!
- If true, item text labels for obje ts will include internal names.
- */
- bool showInternalNames;
- /*!
- If true, class names will be used as object names for unnamed objects.
- */
- bool showClassNameForUnnamedObjects;
- /*!
- */
- bool compareToObjectID;
- /*!
- If true clicking on a selected item ( that is an object and not the root ) will allow you to rename it.
- */
- bool canRenameObjects;
- /*!
- If true then object renaming operates on the internalName rather than the object name.
- */
- bool renameInternal;
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A control that displays a hierarchical tree view of a path in the game file system.
- @note Currently not used, most likely existed for editors. Possibly deprecated.
- */
- class GuiFileTreeCtrl : public GuiTreeViewCtrl {
- public:
- /*! getSelectedPath() - returns the currently selected path in the tree */
- virtual string getSelectedPath() {}
- /*! setSelectedPath(path) - expands the tree to the specified path */
- virtual bool setSelectedPath() {}
- /*! Reread the directory tree hierarchy. */
- virtual void reload(()) {}
- /*! @name File Tree
- @{ */
- /*! */
- /*!
- Path in game directory that should be displayed in the control.
- */
- string rootPath;
- /*!
- Vector of file patterns. If not empty, only files matching the pattern will be shown in the control.
- */
- string fileFilter;
- /// @}
- /*! @name TreeView
- @{ */
- /*! */
- /// @}
- /*! @name Inspector Trees
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A base class for cross platform menu controls that are gamepad friendly.
- This class is used to build row-based menu GUIs that can be easily navigated using the keyboard, mouse or gamepad. The desired row can be selected using the mouse, or by navigating using the Up and Down buttons.
- @tsexample
- new GuiGameListMenuCtrl()
- {
- debugRender = "0";
- callbackOnA = "applyOptions();";
- callbackOnB = "Canvas.setContent(MainMenuGui);";
- callbackOnX = "";
- callbackOnY = "revertOptions();";
- //Properties not specific to this control have been omitted from this example.
- };
- @endtsexample
- @see GuiGameListMenuProfile
- */
- class GuiGameListMenuCtrl : public GuiControl {
- public:
- /*! Called when the selected row changes. */
- void onChange();
- /*! Add a row to the list control.
- @param label The text to display on the row as a label.
- @param callback Name of a script function to use as a callback when this row is activated.
- @param icon [optional] Index of the icon to use as a marker.
- @param yPad [optional] An extra amount of height padding before the row. Does nothing on the first row.
- @param useHighlightIcon [optional] Does this row use the highlight icon?.
- @param enabled [optional] If this row is initially enabled. */
- virtual void addRow(( string label, string callback, int icon=-1, int yPad=0, bool useHighlightIcon=true, bool enabled=true )) {}
- /*! Determines if the specified row is enabled or disabled.
- @param row The row to set the enabled status of.
- @return True if the specified row is enabled. False if the row is not enabled or the given index was not valid. */
- virtual bool isRowEnabled(( int row )) {}
- /*! Sets a row's enabled status according to the given parameters.
- @param row The index to check for validity.
- @param enabled Indicate true to enable the row or false to disable it. */
- virtual void setRowEnabled(( int row, bool enabled )) {}
- /*! Activates the current row. The script callback of the current row will be called (if it has one). */
- virtual void activateRow(()) {}
- /*! Gets the number of rows on the control.
- @return (int) The number of rows on the control. */
- virtual int getRowCount(()) {}
- /*! Gets the label displayed on the specified row.
- @param row Index of the row to get the label of.
- @return The label for the row. */
- virtual string getRowLabel(( int row )) {}
- /*! Sets the label on the given row.
- @param row Index of the row to set the label on.
- @param label Text to set as the label of the row.
- */
- virtual void setRowLabel(( int row, string label )) {}
- /*! Sets the selected row. Only rows that are enabled can be selected.
- @param row Index of the row to set as selected. */
- virtual void setSelected(( int row )) {}
- /*! Gets the index of the currently selected row.
- @return Index of the selected row. */
- virtual int getSelectedRow(()) {}
- /*!
- Enable debug rendering
- */
- bool debugRender;
- /*!
- Script callback when the 'A' button is pressed. 'A' inputs are Keyboard: A, Return, Space; Gamepad: A, Start
- */
- string callbackOnA;
- /*!
- Script callback when the 'B' button is pressed. 'B' inputs are Keyboard: B, Esc, Backspace, Delete; Gamepad: B, Back
- */
- string callbackOnB;
- /*!
- Script callback when the 'X' button is pressed. 'X' inputs are Keyboard: X; Gamepad: X
- */
- string callbackOnX;
- /*!
- Script callback when the 'Y' button is pressed. 'Y' inputs are Keyboard: Y; Gamepad: Y
- */
- string callbackOnY;
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A control for showing pages of options that are gamepad friendly.
- Each row in this control allows the selection of one value from a set of options using the keyboard, gamepad or mouse. The row is rendered as 2 columns: the first column contains the row label, the second column contains left and right arrows (for mouse picking) and the currently selected value.
- @see GuiGameListOptionsProfile
- */
- class GuiGameListOptionsCtrl : public GuiGameListMenuCtrl {
- public:
- /*! Add a row to the list control.
- @param label The text to display on the row as a label.
- @param options A tab separated list of options.
- @param wrapOptions Specify true to allow options to wrap at each end or false to prevent wrapping.
- @param callback Name of a script function to use as a callback when this row is activated.
- @param icon [optional] Index of the icon to use as a marker.
- @param yPad [optional] An extra amount of height padding before the row. Does nothing on the first row.
- @param enabled [optional] If this row is initially enabled. */
- virtual void addRow(( string label, string options, bool wrapOptions, string callback, int icon=-1, int yPad=0, bool enabled=true )) {}
- /*! Gets the text for the currently selected option of the given row.
- @param row Index of the row to get the option from.
- @return A string representing the text currently displayed as the selected option on the given row. If there is no such displayed text then the empty string is returned. */
- virtual string getCurrentOption(( int row )) {}
- /*! Set the row's current option to the one specified
- @param row Index of the row to set an option on.
- @param option The option to be made active.
- @return True if the row contained the option and was set, false otherwise. */
- virtual bool selectOption(( int row, string option )) {}
- /*! Sets the list of options on the given row.
- @param row Index of the row to set options on.@param optionsList A tab separated list of options for the control. */
- virtual void setOptions(( int row, string optionsList )) {}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief Swatch selector that appears inside the GuiGradientCtrl object. These objects are automatically created by GuiGradientCtrl.
- Currently only appears to be editor specific
- @see GuiSwatchButtonCtrl
- @see GuiGradientCtrl
- @ingroup GuiCore
- */
- class GuiGradientSwatchCtrl : public GuiSwatchButtonCtrl {
- public:
- /*! @brief Called whenever the left mouse button has entered the down state while in this control.
- @tsexample
- // The left mouse button is down on the control, causing the callback to occur.
- GuiGradientSwatchCtrl::onMouseDown(%this)
- {
- // Code to run when the callback occurs
- }
- @endtsexample
- @see GuiControl
- @see GuiSwatchButtonCtrl
- @internal */
- void onMouseDown();
- /*! @brief Called whenever the left mouse button performs a double click while in this control.
- @tsexample
- // The left mouse button has performed a double click on the control, causing the callback to occur.
- GuiGradientSwatchCtrl::onDoubleClick(%this)
- {
- // Code to run when the callback occurs
- }
- @endtsexample
- @see GuiControl
- @see GuiSwatchButtonCtrl
- @internal */
- void onDoubleClick();
- /*! @name Button
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief Visual representation of color box used with the GuiColorPickerCtrl
- Editor use only.
- */
- class GuiGradientCtrl : public GuiControl {
- public:
- /*! Get color count */
- virtual int getColorCount() {}
- /*! Get color value */
- virtual string getColor() {}
- /*! @name ColorPicker
- @{ */
- /*! */
- /*!
- */
- ColorF baseColor;
- /*!
- */
- ColorF pickColor;
- /*!
- */
- GuiGradientPickMode displayMode;
- /*!
- */
- bool actionOnMove;
- /*!
- */
- bool showReticle;
- /*!
- */
- int swatchFactor;
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief Container for GuiMaterialPreview
- Editor use only.
- */
- class GuiMaterialCtrl : public GuiContainer {
- public:
- /*! Set the material to be displayed in the control. */
- virtual bool setMaterial(( string materialName )) {}
- /*! @name Material
- @{ */
- /*! */
- /*!
- */
- filename materialName;
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class GuiSliderVerticalCtrl : public GuiControl {
- public:
- /*! Called when the left mouse button is dragged across the slider. */
- void onMouseDragged();
- /*! Get the current value of the slider based on the position of the thumb.
- @return Slider position (from range.x to range.y). */
- virtual float getValue(()) {}
- /*! Set position of the thumb on the slider.
- @param pos New slider position (from range.x to range.y)
- @param doCallback If true, the altCommand callback will be invoked
- */
- virtual void setValue(( float pos, bool doCallback=false )) {}
- virtual void setRange(( Point2F range )) {}
- /*! Returns true if the thumb is currently being dragged by the user. This method is mainly useful for scrubbing type sliders where the slider position is sync'd to a changing value. When the user is dragging the thumb, however, the sync'ing should pause and not get in the way of the user. */
- virtual bool isThumbBeingDragged(()) {}
- /*! @name Slider
- @{ */
- /*! */
- /*!
- Min and max values corresponding to left and right slider position.
- */
- Point2F range;
- /*!
- The value corresponding to the current slider position.
- */
- float value;
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class GuiClickTextCtrl : public GuiTextCtrl {
- public:
- /*! Called when the left mouse button is double-clicked on the text control. */
- void onDoubleClick();
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief GUI Control which displays a numerical value which can be increased or decreased using a pair of bitmap up/down buttons.
- This control uses the bitmap specified in it's profile (GuiControlProfile::bitmapName). It takes this image and breaks up aspects of it to render the up and down arrows. It is also important to set GuiControlProfile::hasBitmapArray to true on the profile as well.
- The bitmap referenced should be broken up into a 1 x 4 grid (using the top left color pixel as a border color between each of the images) in which it will map to the following places:
- <ol>
- <li>Up arrow active</li>
- <li>Up arrow inactive</li>
- <li>Down arrow active</li>
- <li>Down arrow inactive</li>
- </ol>
- <pre>
- 1
- 2
- 3
- 4</pre>
- @tsexample
- singleton GuiControlProfile (SliderBitmapGUIProfile)
- {
- bitmap = "core/art/gui/images/sliderArray";
- hasBitmapArray = true;
- opaque = false;
- };
- new GuiTextEditSliderBitmapCtrl()
- {
- profile = "SliderBitmapGUIProfile";
- format = "%3.2f";
- range = "-1e+03 1e+03";
- increment = "0.1";
- focusOnMouseWheel = "0";
- bitmap = "";
- //Properties not specific to this control have been omitted from this example.
- };
- @endtsexample
- @see GuiTextEditSliderCtrl
- @see GuiTextEditCtrl
- @ingroup GuiCore
- */
- class GuiTextEditSliderBitmapCtrl : public GuiTextEditCtrl {
- public:
- /*! Called when value changed */
- void onValueChanged();
- /*!
- Character format type to place in the control.
- */
- string format;
- /*!
- Maximum vertical and horizontal range to allow in the control.
- */
- Point2F range;
- /*!
- How far to increment the slider on each step.
- */
- float increment;
- /*!
- If true, the control will accept giving focus to the user when the mouse wheel is used.
- */
- bool focusOnMouseWheel;
- /*!
- Unused
- */
- filename bitmap;
- /*! @name Text Input
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A control which adds several reactions to other GUIs via callbacks.
- GuiScriptNotifyCtrl does not exist to render anything. When parented or made a child of other controls, you can toggle flags on or off to make use of its specialized callbacks. Normally these callbacks are used as utility functions by the GUI Editor, or other container classes. However, for very fancy GUI work where controls interact with each other constantly, this is a handy utility to make use of.
- @tsexample
- // Common member fields left out for sake of example
- new GuiScriptNotifyCtrl()
- {
- onChildAdded = "0";
- onChildRemoved = "0";
- onChildResized = "0";
- onParentResized = "0";
- };
- @endtsexample
- @ingroup GuiUtil
- */
- class GuiScriptNotifyCtrl : public GuiControl {
- public:
- /*! Called when this GUI is resized.
- @param ID Unique object ID assigned when created (%this in script).
- */
- void onResize( SimObjectId ID );
- /*! Called when a child is added to this GUI.
- @param ID Unique object ID assigned when created (%this in script).
- @param childID Unique object ID of child being added.
- */
- void onChildAdded( SimObjectId ID, SimObjectId childID );
- /*! Called when a child is removed from this GUI.
- @param ID Unique object ID assigned when created (%this in script).
- @param childID Unique object ID of child being removed.
- */
- void onChildRemoved( SimObjectId ID, SimObjectId childID );
- /*! Called when a child is of this GUI is being resized.
- @param ID Unique object ID assigned when created (%this in script).
- @param childID Unique object ID of child being resized.
- */
- void onChildResized( SimObjectId ID, SimObjectId childID );
- /*! Called when this GUI's parent is resized.
- @param ID Unique object ID assigned when created (%this in script).
- */
- void onParentResized( SimObjectId ID );
- /*! Called when this GUI loses focus.
- @param ID Unique object ID assigned when created (%this in script).
- */
- void onLoseFirstResponder( SimObjectId ID );
- /*! Called when this GUI gains focus.
- @param ID Unique object ID assigned when created (%this in script).
- */
- void onGainFirstResponder( SimObjectId ID );
- /*! @name Callbacks
- @{ */
- /*! */
- /*!
- Enables/disables onChildAdded callback
- */
- bool onChildAdded;
- /*!
- Enables/disables onChildRemoved callback
- */
- bool onChildRemoved;
- /*!
- Enables/disables onChildResized callback
- */
- bool onChildResized;
- /*!
- Enables/disables onParentResized callback
- */
- bool onParentResized;
- /*!
- Enables/disables onResize callback
- */
- bool onResize;
- /*!
- Enables/disables onLoseFirstResponder callback
- */
- bool onLoseFirstResponder;
- /*!
- Enables/disables onGainFirstResponder callback
- */
- bool onGainFirstResponder;
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A control that plots one or more curves in a chart.
- Up to 6 individual curves can be plotted in the graph. Each plotted curve can have its own display style including its own charting style (#plotType) and color (#plotColor).
- The data points on each curve can be added in one of two ways:
- - Manually by calling addDatum(). This causes new data points to be added to the left end of the plotting curve.
- - Automatically by letting the graph plot the values of a variable over time. This is achieved by calling addAutoPlot and specifying the variable and update frequency.
- @tsexample
- // Create a graph that plots a red polyline graph of the FPS counter in a 1 second (1000 milliseconds) interval.
- new GuiGraphCtrl( FPSGraph )
- {
- plotType[ 0 ] = "PolyLine";
- plotColor[ 0 ] = "1 0 0";
- plotVariable[ 0 ] = "fps::real";
- plotInterval[ 0 ] = 1000;
- };
- @endtsexample
- @note Each curve has a maximum number of 200 data points it can have at any one time. Adding more data points to a curve will cause older data points to be removed.
- */
- class GuiGraphCtrl : public GuiControl {
- public:
- /*! Add a data point to the plot's curve.
- @param plotId Index of the plotting curve to which to add the data point. Must be 0<=plotId<6.
- @param value Value of the data point to add to the curve.
- @note Data values are added to the @b left end of the plotting curve.
- @note A maximum number of 200 data points can be added to any single plotting curve at any one time. If this limit is exceeded, data points on the right end of the curve are culled. */
- virtual void addDatum(( int plotId, float value )) {}
- /*! Get a data point on the given plotting curve.
- @param plotId Index of the plotting curve from which to fetch the data point. Must be 0<=plotId<6.
- @param index Index of the data point on the curve.
- @return The value of the data point or -1 if @a plotId or @a index are out of range. */
- virtual float getDatum(( int plotId, int index )) {}
- /*! Sets up the given plotting curve to automatically plot the value of the @a variable with a frequency of @a updateFrequency.
- @param plotId Index of the plotting curve. Must be 0<=plotId<6.
- @param variable Name of the global variable.
- @param updateFrequency Frequency with which to add new data points to the plotting curve (in milliseconds).
- @tsexample
- // Plot FPS counter at 1 second intervals.
- %graph.addAutoPlot( 0, "fps::real", 1000 );
- @endtsexample */
- virtual void addAutoPlot(( int plotId, string variable, int updateFrequency )) {}
- /*! Stop automatic variable plotting for the given curve.
- @param plotId Index of the plotting curve. Must be 0<=plotId<6.
- */
- virtual void removeAutoPlot(( int plotId )) {}
- /*! Change the charting type of the given plotting curve.
- @param plotId Index of the plotting curve. Must be 0<=plotId<6.
- @param graphType Charting type to use for the curve.
- @note Instead of calling this method, you can directly assign to #plotType. */
- virtual void setGraphType(( int plotId, GuiGraphType graphType )) {}
- /*! Set the scale of all specified plots to the maximum scale among them.
- @param plotID1 Index of plotting curve.
- @param plotID2 Index of plotting curve. */
- virtual void matchScale(( int plotID1, int plotID2, ... )) {}
- virtual void setMax(( int plotId, float max )) {}
- virtual void clearPlot(( int plotId )) {}
- /*! @name Graph
- @{ */
- /*! */
- /*!
- Ratio of where to place the center coordinate of the graph on the Y axis. 0.5=middle height of control.
- This allows to account for graphs that have only positive or only negative data points, for example.
- */
- float centerY;
- /*!
- Color to use for the plotting curves in the graph.
- */
- ColorF plotColor;
- /*!
- Charting type of the plotting curves.
- */
- GuiGraphType plotType;
- /*!
- Name of the variable to automatically plot on the curves. If empty, auto-plotting is disabled for the respective curve.
- */
- string plotVariable;
- /*!
- Interval between auto-plots of #plotVariable for the respective curve (in milliseconds).
- */
- int plotInterval;
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class CmVersionBar : public GuiTextCtrl {
- public:
- virtual void updateText(()) {}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief GUI that will fade the current view in and out.
- Main difference between this and FadeinBitmap is this appears to fade based on the source texture.
- This is going to be deprecated, and any useful code ported to FadeinBitmap
- */
- class GuiIdleCamFadeBitmapCtrl : public GuiBitmapCtrl {
- public:
- /*! @internal */
- virtual void fadeIn(()) {}
- /*! @internal */
- virtual void fadeOut(()) {}
- /*!
- */
- int fadeInTime;
- /*!
- */
- int fadeOutTime;
- /*!
- */
- bool done;
- /*! @name Bitmap
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class GuiJoinWorldWindow : public GuiControl {
- public:
- virtual void connectToCurrentServer(( string password="" )) {}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A chat HUD control that displays messages from a MessageVector.
- This renders messages from a MessageVector; the important thing here is that the MessageVector holds all the messages we care about, while we can destroy and create these GUI controls as needed.
- @tsexample
- // Declare ChatHud, which is what will display the actual chat from a MessageVector
- new GuiMessageVectorCtrl(ChatHud) {
- profile = "ChatHudMessageProfile";
- horizSizing = "width";
- vertSizing = "height";
- position = "1 1";
- extent = "252 16";
- minExtent = "8 8";
- visible = "1";
- helpTag = "0";
- lineSpacing = "0";
- lineContinuedIndex = "10";
- matchColor = "0 0 255 255";
- maxColorIndex = "5";
- };
- // All messages are stored in this HudMessageVector, the actual
- // MainChatHud only displays the contents of this vector.
- new MessageVector(HudMessageVector);
- // Attach the MessageVector to the chat control
- chatHud.attach(HudMessageVector);
- @endtsexample
- @see MessageVector for more details on how this is used
- @ingroup GuiUtil
- */
- class GuiMessageVectorCtrl : public GuiControl {
- public:
- /*! @brief Push a line onto the back of the list.
- @param item The GUI element being pushed into the control
- @tsexample
- // All messages are stored in this HudMessageVector, the actual
- // MainChatHud only displays the contents of this vector.
- new MessageVector(HudMessageVector);
- // Attach the MessageVector to the chat control
- chatHud.attach(HudMessageVector);
- @endtsexample
- @return Value */
- virtual bool attach(( MessageVector item )) {}
- /*! @brief Stop listing messages from the MessageVector previously attached to, if any.
- Detailed description
- @param param Description
- @tsexample
- // Deatch the MessageVector from HudMessageVector
- // HudMessageVector will no longer render the text
- chatHud.detach();
- @endtsexample
- */
- virtual void detach(()) {}
- /*!
- */
- int lineSpacing;
- /*!
- */
- int lineContinuedIndex;
- /*!
- */
- string allowedMatches;
- /*!
- */
- ColorI matchColor;
- /*!
- */
- int maxColorIndex;
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class GuiPlayersWindow : public GuiControl {
- public:
- virtual void onClose(()) {}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class CmEquipmentWindow : public GuiWindowCtrl {
- public:
- virtual Script onSleep(( string this )) {}
- virtual Script onWake(( string this )) {}
- virtual void onClose(()) {}
- virtual void onControlDragEnter(( GuiControl control, Point2I dropPoint )) {}
- virtual void onControlDragged(( GuiControl control, Point2I dropPoint )) {}
- virtual void onControlDragExit(( GuiControl control, Point2I dropPoint )) {}
- /*! @name Window
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class GuiAlchemyMixer : public GuiWindowCtrl {
- public:
- virtual void onClose(()) {}
- /*! @name Window
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class GuiAnimalHusbandry : public GuiObjectInventoryContainer {
- public:
- virtual void onClose(()) {}
- /*! @name Window
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief GUI Control which displays a numerical value which can be increased or decreased using a pair of bitmap up/down buttons.
- This control uses the bitmap specified in it's profile (GuiControlProfile::bitmapName). It takes this image and breaks up aspects of it to render the up and down arrows. It is also important to set GuiControlProfile::hasBitmapArray to true on the profile as well.
- The bitmap referenced should be broken up into a 1 x 4 grid (using the top left color pixel as a border color between each of the images) in which it will map to the following places:
- <ol>
- <li>Up arrow active</li>
- <li>Up arrow inactive</li>
- <li>Down arrow active</li>
- <li>Down arrow inactive</li>
- </ol>
- <pre>
- 1
- 2
- 3
- 4</pre>
- @tsexample
- singleton GuiControlProfile (SliderBitmapGUIProfile)
- {
- bitmap = "core/art/gui/images/sliderArray";
- hasBitmapArray = true;
- opaque = false;
- };
- new GuiCmSliderBitmapCtrl()
- {
- profile = "SliderBitmapGUIProfile";
- format = "%3.2f";
- range = "-1e+03 1e+03";
- increment = "0.1";
- focusOnMouseWheel = "0";
- bitmap = "";
- //Properties not specific to this control have been omitted from this example.
- };
- @endtsexample
- @see GuiTextEditSliderCtrl
- @see GuiTextEditCtrl
- @ingroup GuiCore
- */
- class GuiCmSliderBitmapCtrl : public GuiTextEditCtrl {
- public:
- /*! Called when value changed */
- void onValueChanged();
- /*!
- Character format type to place in the control.
- */
- string format;
- /*!
- Maximum vertical and horizontal range to allow in the control.
- */
- Point2F range;
- /*!
- How far to increment the slider on each step.
- */
- float increment;
- /*!
- If true, the control will accept giving focus to the user when the mouse wheel is used.
- */
- bool focusOnMouseWheel;
- /*!
- Unused
- */
- filename bitmap;
- /*! @name Text Input
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class GuiCraftToolInventory : public GuiWindowCtrl {
- public:
- virtual void onClose(()) {}
- /*! @name Window
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class GuiInventoryItem : public GuiButtonBaseCtrl {
- public:
- /*! Set the bitmap to show on the button.
- @param path Path to the texture file in any of the supported formats.
- */
- virtual void setBitmap(( string path )) {}
- /*! @name Bitmap
- @{ */
- /*! */
- /*!
- Texture file to display on this button.
- If useStates is false, this will be the file that renders on the control. Otherwise, this will specify the default texture name to which the various state and modifier suffixes are appended to find the per-state and per-modifier (if enabled) textures.
- */
- filename bitmap;
- /*!
- If true, the control's extents will be set to match the bitmap's extents when setting the bitmap.
- The bitmap extents will always be taken from the default/normal bitmap (in case the extents of the various bitmaps do not match up.)
- */
- bool autoFitExtents;
- /*!
- If true, per-modifier button functionality is enabled.
- @ref guibitmapbutton_modifiers
- */
- bool useModifiers;
- /*!
- If true, per-mouse state button functionality is enabled.
- Defaults to true.
- If you do not use per-state images on this button set this to false to speed up the loading process by inhibiting searches for the individual images.
- */
- bool useStates;
- /// @}
- /*! @name Button
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class GuiTrebuchet : public GuiObjectInventoryContainer {
- public:
- virtual void onClose(()) {}
- /*! @name Window
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class GuiSkillsWindow : public GuiWindowCtrl {
- public:
- virtual void onClose(()) {}
- /*! @name Window
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class GuiUnitWindow : public GuiWindowCtrl {
- public:
- virtual void onClose(()) {}
- /*! @name Window
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief Store a list of chat messages.
- This is responsible for managing messages which appear in the chat HUD, not the actual control rendered to the screen
- @tsexample
- // Declare ChatHud, which is what will display the actual chat from a MessageVector
- new GuiMessageVectorCtrl(ChatHud) {
- profile = "ChatHudMessageProfile";
- horizSizing = "width";
- vertSizing = "height";
- position = "1 1";
- extent = "252 16";
- minExtent = "8 8";
- visible = "1";
- helpTag = "0";
- lineSpacing = "0";
- lineContinuedIndex = "10";
- matchColor = "0 0 255 255";
- maxColorIndex = "5";
- };
- // All messages are stored in this HudMessageVector, the actual
- // MainChatHud only displays the contents of this vector.
- new MessageVector(HudMessageVector);
- // Attach the MessageVector to the chat control
- chatHud.attach(HudMessageVector);
- @endtsexample
- @see GuiMessageVectorCtrl for more details on how this is used.@ingroup GuiUtil
- */
- class MessageVector : public SimObject {
- public:
- /*! Clear all messages in the vector
- @tsexample
- HudMessageVector.clear();
- @endtsexample
- */
- virtual void clear(()) {}
- /*! Push a line onto the back of the list.
- @param msg Text that makes up the message
- @param tag Numerical value associated with this message, useful for searching.
- @tsexample
- // Add the message...
- HudMessageVector.pushBackLine("Hello World", 0);
- @endtsexample
- */
- virtual void pushBackLine(( string msg, int tag )) {}
- /*! Pop a line from the back of the list; destroys the line.
- @tsexample
- HudMessageVector.popBackLine();
- @endtsexample
- @return False if there are no lines to pop (underflow), true otherwise */
- virtual bool popBackLine(()) {}
- /*! Push a line onto the front of the vector.
- @param msg Text that makes up the message
- @param tag Numerical value associated with this message, useful for searching.
- @tsexample
- // Add the message...
- HudMessageVector.pushFrontLine("Hello World", 0);
- @endtsexample
- */
- virtual void pushFrontLine(( string msg, int tag )) {}
- /*! Pop a line from the front of the vector, destroying the line.
- @tsexample
- HudMessageVector.popFrontLine();
- @endtsexample
- @return False if there are no lines to pop (underflow), true otherwise */
- virtual bool popFrontLine(()) {}
- /*! Push a line onto the back of the list.
- @param msg Text that makes up the message
- @param tag Numerical value associated with this message, useful for searching.
- @tsexample
- // Add the message...
- HudMessageVector.insertLine(1, "Hello World", 0);
- @endtsexample
- @return False if insertPos is greater than the number of lines in the current vector */
- virtual bool insertLine(( int insertPos, string msg, int tag )) {}
- /*! Delete the line at the specified position.
- @param deletePos Position in the vector containing the line to be deleted
- @tsexample
- // Delete the first line (index 0) in the vector...
- HudMessageVector.deleteLine(0);
- @endtsexample
- @return False if deletePos is greater than the number of lines in the current vector */
- virtual bool deleteLine(( int deletePos )) {}
- /*! Dump the message vector to a file, optionally prefixing a header.@hide */
- virtual void dump((string filename, string header=NULL)) {}
- /*! Get the number of lines in the vector.
- @tsexample
- // Find out how many lines have been stored in HudMessageVector
- %chatLines = HudMessageVector.getNumLines();
- echo(%chatLines);
- @endtsexample
- */
- virtual int getNumLines(()) {}
- /*! Scan through the lines in the vector, returning the first line that has a matching tag.
- @param tag Numerical value assigned to a message when it was added or inserted
- @tsexample
- // Locate text in the vector tagged with the value "1", then print it
- %taggedText = HudMessageVector.getLineTextByTag(1);
- echo(%taggedText);
- @endtsexample
- @return Text from a line with matching tag, other wise "" */
- virtual string getLineTextByTag(( int tag )) {}
- /*! Scan through the vector, returning the line number of the first line that matches the specified tag; else returns -1 if no match was found.
- @param tag Numerical value assigned to a message when it was added or inserted
- @tsexample
- // Locate a line of text tagged with the value "1", then delete it.
- %taggedLine = HudMessageVector.getLineIndexByTag(1);
- HudMessageVector.deleteLine(%taggedLine);
- @endtsexample
- @return Line with matching tag, other wise -1 */
- virtual int getLineIndexByTag(( int tag )) {}
- /*! Get the text at a specified line.
- @param pos Position in vector to grab text from
- @tsexample
- // Print a line of text at position 1.
- %text = HudMessageVector.getLineText(1);
- echo(%text);
- @endtsexample
- @return Text at specified line, if the position is greater than the number of lines return "" */
- virtual string getLineText(( int pos )) {}
- /*! Get the tag of a specified line.
- @param pos Position in vector to grab tag from
- @tsexample
- // Remove all lines that do not have a tag value of 1.
- while( HudMessageVector.getNumLines())
- {
- %tag = HudMessageVector.getLineTag(1);
- if(%tag != 1)
- %tag.delete();
- HudMessageVector.popFrontLine();
- }
- @endtsexample
- @return Tag value of a given line, if the position is greater than the number of lines return 0 */
- virtual int getLineTag(( int pos )) {}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class guiBrowserWindow : public GuiWindowCtrl {
- public:
- virtual void onClose(()) {}
- /*! @name Window
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Layout
- @{ */
- /*! */
- /// @}
- /*! @name Control
- @{ */
- /*! */
- /// @}
- /*! @name ToolTip
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Localization
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief Provides the code necessary to handle the low level management of the string tables for localization
- One LangTable is created for each mod, as well as one for the C++ code. LangTable is responsible for obtaining the correct strings from each and relaying it to the appropriate controls.
- @see Localization for a full description
- @ingroup Localization
- */
- class LangTable : public SimObject {
- public:
- /*! @brief Adds a language to the table
- @param filename Name and path to the language file
- @param languageName Optional name to assign to the new language entry
- @return True If file was successfully found and language created
- */
- virtual int addLanguage((string filename, [string languageName])) {}
- /*! @brief Grabs a string from the specified table
- If an invalid is passed, the function will attempt to to grab from the default table
- @param filename Name of the language table to access
- @return Text from the specified language table, "" if ID was invalid and default table is not set */
- virtual string getString((string filename)) {}
- /*! @brief Sets the default language table
- @param language ID of the table
- */
- virtual void setDefaultLanguage((int language)) {}
- /*! @brief Sets the current language table for grabbing text
- @param language ID of the table
- */
- virtual void setCurrentLanguage((int language)) {}
- /*! @brief Get the ID of the current language table
- @return Numerical ID of the current language table */
- virtual int getCurrentLanguage(()) {}
- /*! @brief Return the readable name of the language table
- @param language Numerical ID of the language table to access
- @return String containing the name of the table, NULL if ID was invalid or name was never specified */
- virtual string getLangName((int language)) {}
- /*! @brief Used to find out how many languages are in the table
- @return Size of the vector containing the languages, numerical */
- virtual int getNumLang(()) {}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A ResponseCurve<F32> wrapped as a SimObject.
- Currently no applied use, not network ready, not intended for game development, for editors or internal use only.
- */
- class SimResponseCurve : public SimObject {
- public:
- /*! addPoint( F32 value, F32 time ) */
- virtual void addPoint() {}
- /*! getValue( F32 time ) */
- virtual float getValue() {}
- /*! clear() */
- virtual void clear() {}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief Used for rendering platform menu bars
- Internal use only
- */
- class MenuBar : public SimSet {
- public:
- virtual void attachToCanvas((GuiCanvas, pos)) {}
- virtual void removeFromCanvas(()) {}
- /*! insert object at position */
- virtual void insert((object, pos)) {}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief PopupMenu represents a system menu.
- You can add menu items to the menu, but there is no torque object associated with these menu items, they exist only in a platform specific manner.
- @note Internal use only
- */
- class PopupMenu : public SimObject {
- public:
- virtual int insertItem((pos[, title][, accelerator])) {}
- virtual void removeItem((pos)) {}
- virtual int insertSubMenu((pos, title, subMenu)) {}
- virtual bool setItem((pos, title[, accelerator])) {}
- virtual void enableItem((pos, enabled)) {}
- virtual void checkItem((pos, checked)) {}
- virtual void checkRadioItem((firstPos, lastPos, checkPos)) {}
- virtual bool isItemChecked((pos)) {}
- virtual int getItemCount(()) {}
- virtual void attachToMenuBar((GuiCanvas, pos, title)) {}
- virtual void removeFromMenuBar(()) {}
- virtual void showPopup((Canvas,[x, y])) {}
- /*!
- true if this is a pop-up/context menu. defaults to false.
- */
- bool isPopup;
- /*!
- the title of this menu when attached to a menu bar
- */
- caseString barTitle;
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class PfxVis {
- public:
- /*! @hide */
- virtual void clear(()) {}
- /*! @hide */
- virtual void open(( PostEffect, [bool clear = false] )) {}
- /*! @hide */
- virtual void hide(()) {}
- /*! @hide */
- virtual void show(()) {}
- /*! @hide */
- virtual void onWindowClosed(( GuiWindowCtrl )) {}
- };
- /*!
- @brief A sound source that drives multi-source playback.
- This class acts as an interpreter for SFXPlayLists. It goes through the slots of the playlist it is attached to and performs the actions described by each of the slots in turn.
- As SFXControllers are created implicitly by the SFX system when instantiating a source for a play list it is in most cases not necessary to directly deal with the class.
- The following example demonstrates how a controller would commonly be created.
- @tsexample
- // Create a play list from two SFXProfiles.
- %playList = new SFXPlayList()
- {
- // Use a looped description so the list playback will loop.
- description = AudioMusicLoop2D;
- track[ 0 ] = Profile1;
- track[ 1 ] = Profile2;
- };
- // Play the list. This will implicitly create a controller.
- sfxPlayOnce( %playList );
- @endtsexample
- @note Play lists are updated at regular intervals by the sound system. This processing determines the granularity at which playlist action timing takes place.
- @note This class cannot be instantiated directly. Use sfxPlayOnce() or sfxCreateSource() with the playlist you want to play to create an instance of this class.
- @see SFXPlayList
- @ingroup SFX
- */
- class SFXController : public SFXSource {
- public:
- /*! Get the index of the playlist slot currently processed by the controller.
- @return The slot index currently being played.
- @see SFXPlayList */
- virtual int getCurrentSlot(()) {}
- /*! Set the index of the playlist slot to play by the controller. This can be used to seek in the playlist.
- @param index Index of the playlist slot. */
- virtual void setCurrentSlot(( int index )) {}
- /*! @name Debug
- @{ */
- /*! */
- /*!
- If true, the controller logs its operation to the console.
- This is a non-networked field that will work locally only.
- */
- bool trace;
- /// @}
- /*! @name Sound
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A sound channel value that can be bound to multiple sound sources.
- Parameters are special objects that isolate a specific property that sound sources can have and allows to bind this isolated instance to multiple sound sources such that when the value of the parameter changes, all sources bound to the parameter will have their respective property changed.
- Parameters are identified and referenced by their #internalName. This means that the SFXDescription::parameters and SFXTrack::parameters fields should contain the #internalNames of the SFXParameter objects which should be attached to the SFXSources when they are created. No two SFXParameters should have the same #internalName.
- All SFXParameter instances are automatically made children of the SFXParameterGroup.
- @note To simply control the volume and/or pitch levels of a group of sounds, it is easier and more efficient to use a sound source group rather than SFXParameters (see @ref SFXSource_hierarchies). Simply create a SFXSource object representing the group, assign SFXDescription::sourceGroup of the sounds appropriately, and then set the volume and/or pitch level of the group to modulate the respective properties of all children.
- @section SFXParameter_updates Parameter Updates
- Parameters are periodically allowed to update their own values. This makes it possible to attach custom logic to a parameter and have individual parameters synchronize their values autonomously. Use the onUpdate() callback to attach script code to a parameter update.
- @tsexample
- new SFXParameter( EngineRPMLevel )
- {
- // Set the name by which this parameter is identified.
- internalName = "EngineRPMLevel";
- // Let this parameter control the pitch of attached sources to simulate engine RPM ramping up and down.
- channel = "Pitch";
- // Start out with unmodified pitch.
- defaultValue = 1;
- // Add a texture description of what this parameter does.
- description = "Engine RPM Level";
- };
- // Create a description that automatically attaches the engine RPM parameter.
- singleton SFXDescription( EngineRPMSound : AudioLoop2D )
- {
- parameters[ 0 ] = "EngineRPMLevel";
- };
- // Create sound sources for the engine.
- sfxCreateSource( EngineRPMSound, "art/sound/engine/enginePrimary" );
- sfxCreateSource( EngineRPMSound, "art/sound/engine/engineSecondary" );
- // Setting the parameter value will now affect the pitch level of both sound sources.
- EngineRPMLevel.value = 0.5;
- EngineRPMLevel.value = 1.5;
- @endtsexample
- @ref SFX_interactive
- */
- class SFXParameter : public SimObject {
- public:
- /*! Called when the sound system triggers an update on the parameter.
- This occurs periodically during system operation. */
- void onUpdate();
- /*! Get the name of the parameter.
- @return The paramete name. */
- virtual string getParameterName(()) {}
- /*! Reset the parameter's value to its default.
- @see SFXParameter::defaultValue
- */
- virtual void reset(()) {}
- /*! @name Sound
- @{ */
- /*! */
- /*!
- Current value of the audio parameter.
- All attached sources are notified when this value changes.
- */
- float value;
- /*!
- Permitted range for #value.
- Minimum and maximum allowed value for the parameter. Both inclusive.
- For all but the User0-3 channels, this property is automatically set up by SFXParameter.
- */
- Point2F range;
- /*!
- Channel that the parameter controls.
- This controls which property of the sources it is attached to the parameter controls.
- */
- SFXChannel channel;
- /*!
- Value to which the parameter is initially set.
- When the parameter is first added to the system, #value will be set to #defaultValue.
- */
- float defaultValue;
- /*!
- Textual description of the parameter.
- Primarily for use in the Audio Parameters dialog of the editor to allow for easier identification of parameters.
- */
- string Description;
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A sound controller that directly plays a single sound file.
- When playing individual audio files, SFXSounds are implicitly created by the sound system.
- Each sound source has an associated play cursor that can be queried and explicitly positioned by the user. The cursor is a floating-point value measured in seconds.
- For streamed sources, playback may not be continuous in case the streaming queue is interrupted.
- @note This class cannot be instantiated directly by the user but rather is implicitly created by the sound system when sfxCreateSource() or sfxPlayOnce() is called on a SFXProfile instance.
- @section SFXSound_virtualization Sounds and Voices
- To actually emit an audible signal, a sound must allocate a resource on the sound device through which the sound data is being played back. This resource is called 'voice'.
- As with other types of resources, the availability of these resources may be restricted, i.e. a given sound device will usually only support a fixed number of voices that are playing at the same time. Since, however, there may be arbitrary many SFXSounds instantiated and playing at the same time, this needs to be solved.
- @see SFXDescription::priority
- */
- class SFXSound : public SFXSource {
- public:
- /*! Test whether the sound data associated with the sound has been fully loaded and is ready for playback.
- For streamed sounds, this will be false during playback when the stream queue for the sound is starved and waiting for data. For buffered sounds, only an initial loading phase will potentially cause isReady to return false.
- @return True if the sound is ready for playback. */
- virtual bool isReady(()) {}
- /*! Get the current playback position in seconds.
- @return The current play cursor offset. */
- virtual float getPosition(()) {}
- /*! Set the current playback position in seconds.
- If the source is currently playing, playback will jump to the new position. If playback is stopped or paused, playback will resume at the given position when play() is called.
- @param position The new position of the play cursor (in seconds).
- */
- virtual void setPosition(( float position )) {}
- /*! Get the total play time (in seconds) of the sound data attached to the sound.
- @return
- @note Be aware that for looped sounds, this will not return the total playback time of the sound.
- */
- virtual float getDuration(()) {}
- /*! @name Sound
- @{ */
- /*! */
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief A group of events in an imported FMOD Designer project.
- @note Instances of this class
- @ingroup SFXFMOD
- */
- class SFXFMODEventGroup : public SimDataBlock {
- public:
- /*! Test whether the resource data for this group has been loaded.
- @return True if the resource data for this group is currently loaded.
- */
- virtual bool isDataLoaded(()) {}
- /*! Load the resource data for this group, if it has not already been loaded (either directly or indirectly through a parent group).
- This method works recursively and thus data for direct and indirect child groups to this group will be loaded as well.
- @param loadStreams Whether to open streams.
- @param loadSamples Whether to load sample banks.
- @return True if the data has been successfully loaded; false otherwise.
- @see SFXFMODProject_resources */
- virtual bool loadData(( bool loadStreams=true, bool loadSamples=true )) {}
- /*! Release the resource data for this group and its subgroups.
- @see SFXFMODProject_resources */
- virtual void freeData(()) {}
- /*! @name DO NOT MODIFY!!
- @{ */
- /*! */
- /*!
- DO NOT MODIFY!!
- */
- SFXFMODProject fmodProject;
- /*!
- DO NOT MODIFY!!
- */
- SFXFMODEventGroup fmodGroup;
- /*!
- DO NOT MODIFY!!
- */
- string fmodName;
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class ShaderGen {
- public:
- virtual void preloadCache() {}
- };
- class TCPConnection : public SimObject {
- public:
- virtual bool sendRPC((cmd, args...)) {}
- virtual bool sendCommand((cmd, args...)) {}
- virtual void setConnectArgs((authInfoToSend, authInfoToRecieve)) {}
- virtual void connect((address, port)) {}
- virtual string getRemoteAddress() {}
- virtual int getRemotePort() {}
- virtual string getLocalAddress() {}
- virtual int getLocalPort() {}
- virtual bool isServerSide() {}
- virtual bool isInitiator() {}
- /*! @name TCPConnection
- @{ */
- /*! */
- /*!
- The hostname we are online with.
- */
- string hostname;
- /*!
- The port number we are using atm.
- */
- int port;
- /*!
- Account ID of the client
- */
- int ac_id;
- /// @}
- /*! @name TCP Stats
- @{ */
- /*! */
- /*!
- When this connection was established (unixtime)
- */
- int initatedAt;
- /*!
- Bytes read from network stream since the connection was established.
- */
- int bytesRead;
- /*!
- Bytes sent to network stream since the connection was established.
- */
- int bytesSent;
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class TCPServer : public SimGroup {
- public:
- virtual void closeServer(()) {}
- virtual void startListening(([port])) {}
- virtual int serverPort() {}
- virtual bool isActive() {}
- virtual void delete((bool removeConnections = true)) {}
- /*! @name TCP Server
- @{ */
- /*! */
- /*!
- The class name to be assigned for connected clients.
- */
- string clientsClassName;
- /*!
- Authorization string which should be sent by client so we can check if its valid connection.
- */
- string authInfoIn;
- /*!
- Authorization string which should be sent by client so we can check if its valid connection.
- */
- string authInfoOut;
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- class SimDownloadHelper : public SimObject {
- public:
- /*! */
- void onFinished();
- /*! */
- void onFailed( int errorCode, String errorMessage );
- /*! */
- void onProgress( float progress, int current, int total, String speed );
- virtual void delete(()) {}
- virtual bool start(()) {}
- virtual int getSizeTransfer(()) {}
- virtual int getSizeTotal(()) {}
- /*! @name Download Details
- @{ */
- /*! */
- /*!
- */
- string url;
- /*!
- */
- string fileName;
- /*!
- */
- string cbFinished;
- /*!
- */
- string cbFailed;
- /*!
- */
- string cbProgress;
- /// @}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief An undo action that is comprised of other undo actions.
- Not intended for game development, for editors or internal use only.
- */
- class CompoundUndoAction : public UndoAction {
- public:
- /*! addAction( UndoAction ) */
- virtual void addAction() {}
- /*! @name Ungrouped
- @{ */
- /*! */
- /// @}
- /*! @name Object
- @{ */
- /*! */
- /// @}
- /*! @name Editing
- @{ */
- /*! */
- /// @}
- /*! @name Persistence
- @{ */
- /*! */
- /// @}
- };
- /*!
- @brief SimObject which adds, tracks, and deletes UndoAction objects.
- Not intended for game development, for editors or internal use only.
- */
- class UndoManager : public SimObject {
- public:
- /*! Clears the undo manager. */
- virtual void clearAll() {}
- virtual int getUndoCount() {}
- virtual string getUndoName((index)) {}
- virtual int getUndoAction((index)) {}
- virtual int getRedoCount() {}
- virtual string getRedoName((index)) {}
- virtual int getRedoAction((index)) {}
- /*! UndoManager.undo(); */
- virtual void undo() {}
- /*! UndoManager.redo(); */
- virtual void redo() {}
- /*! UndoManager.getNextUndoName(); */
- virtual string getNextUndoName() {}
- /*! UndoManager.getNextRedoName(); */
- virtual string getNextRedoName() {}
- /*! Push a CompoundUndoAction onto the compound stack for assembly. */
- virtual string pushCompound(( string name="" )) {}
- /*! Pop the current CompoundUndoAction off the stack. */
- virtual void popCompound(( bool discard=false )) {}
- /*!
- Number of undo & redo levels.
- */
- int numLevels;
- };
Add Comment
Please, Sign In to add comment