afxGuiController.cpp
Engine/source/afx/ce/afxGuiController.cpp
Public Defines
define
myOffset(field) (field, )
Public Functions
ConsoleDocClass(afxGuiControllerData , "@brief A datablock that specifies <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> Gui Controller <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">effect.\n\n</a>" "A Gui Controller enables effect manipulation of pre-existing gui controls. With <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> Gui Controller effect, <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> regular gui <a href="/coding/file/guieditctrl_8cpp/#guieditctrl_8cpp_1abb04e3738c4c5a96b3ade6fa47013a6c">control</a> " "is located by name, made visible during the lifetime of the effect, and potentially repositioned by projecting 3D constraint " "positions into 2D screen space. In addition, when used with <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> progress-bar control, (<a href="/coding/class/classguiprogressctrl/">GuiProgressCtrl</a>, <a href="/coding/class/classafxspellcastbar/">afxSpellCastBar</a>, " "<a href="/coding/class/classafxstatusbar/">afxStatusBar</a>) , the progress-bar will continuously reflect the elapsed progress of the effect over its lifetime." "\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n\n</a>" " @ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">afxEffects\n</a>" " @ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">AFX\n</a>" " @ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Datablocks\n</a>" )
Detailed Description
Public Defines
myOffset(field) (field, )
Public Functions
ConsoleDocClass(afxGuiControllerData , "@brief A datablock that specifies <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> Gui Controller <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">effect.\n\n</a>" "A Gui Controller enables effect manipulation of pre-existing gui controls. With <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> Gui Controller effect, <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> regular gui <a href="/coding/file/guieditctrl_8cpp/#guieditctrl_8cpp_1abb04e3738c4c5a96b3ade6fa47013a6c">control</a> " "is located by name, made visible during the lifetime of the effect, and potentially repositioned by projecting 3D constraint " "positions into 2D screen space. In addition, when used with <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> progress-bar control, (<a href="/coding/class/classguiprogressctrl/">GuiProgressCtrl</a>, <a href="/coding/class/classafxspellcastbar/">afxSpellCastBar</a>, " "<a href="/coding/class/classafxstatusbar/">afxStatusBar</a>) , the progress-bar will continuously reflect the elapsed progress of the effect over its lifetime." "\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n\n</a>" " @ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">afxEffects\n</a>" " @ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">AFX\n</a>" " @ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Datablocks\n</a>" )
IMPLEMENT_CO_DATABLOCK_V1(afxGuiControllerData )
1 2 3//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// 4// Arcane-FX for MIT Licensed Open Source version of Torque 3D from GarageGames 5// Copyright (C) 2015 Faust Logic, Inc. 6// 7// Permission is hereby granted, free of charge, to any person obtaining a copy 8// of this software and associated documentation files (the "Software"), to 9// deal in the Software without restriction, including without limitation the 10// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 11// sell copies of the Software, and to permit persons to whom the Software is 12// furnished to do so, subject to the following conditions: 13// 14// The above copyright notice and this permission notice shall be included in 15// all copies or substantial portions of the Software. 16// 17// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 23// IN THE SOFTWARE. 24// 25//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// 26 27#include "afx/arcaneFX.h" 28 29#include "core/stream/bitStream.h" 30 31#include "afx/ce/afxGuiController.h" 32 33//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// 34// afxGuiControllerData 35 36IMPLEMENT_CO_DATABLOCK_V1(afxGuiControllerData); 37 38ConsoleDocClass( afxGuiControllerData, 39 "@brief A datablock that specifies a Gui Controller effect.\n\n" 40 41 "A Gui Controller enables effect manipulation of pre-existing gui controls. With a Gui Controller effect, a regular gui control " 42 "is located by name, made visible during the lifetime of the effect, and potentially repositioned by projecting 3D constraint " 43 "positions into 2D screen space. In addition, when used with a progress-bar control, (GuiProgressCtrl, afxSpellCastBar, " 44 "afxStatusBar), the progress-bar will continuously reflect the elapsed progress of the effect over its lifetime." 45 "\n\n" 46 47 "@ingroup afxEffects\n" 48 "@ingroup AFX\n" 49 "@ingroup Datablocks\n" 50); 51 52afxGuiControllerData::afxGuiControllerData() 53{ 54 control_name = ST_NULLSTRING; 55 preserve_pos = false; 56 ctrl_client_only = false; 57} 58 59afxGuiControllerData::afxGuiControllerData(const afxGuiControllerData& other, bool temp_clone) : GameBaseData(other, temp_clone) 60{ 61 control_name = other.control_name; 62 preserve_pos = other.preserve_pos; 63 ctrl_client_only = other.ctrl_client_only; 64} 65 66#define myOffset(field) Offset(field, afxGuiControllerData) 67 68void afxGuiControllerData::initPersistFields() 69{ 70 addField("controlName", TypeString, myOffset(control_name), 71 "Specifies the name of an existing gui-control."); 72 addField("preservePosition", TypeBool, myOffset(preserve_pos), 73 "When true, the gui-control will retain its initial position, otherwise the " 74 "gui-control position will be continuously updated using a projection of the " 75 "3D constraint position into 2D screen coordinates."); 76 addField("controllingClientOnly", TypeBool, myOffset(ctrl_client_only), 77 "If true, the effect will only be applied to a gui-control on the client that " 78 "matches the controlling-client of the primary position constraint object."); 79 80 Parent::initPersistFields(); 81} 82 83bool afxGuiControllerData::onAdd() 84{ 85 if (Parent::onAdd() == false) 86 return false; 87 88 return true; 89} 90 91void afxGuiControllerData::packData(BitStream* stream) 92{ 93 Parent::packData(stream); 94 95 stream->writeString(control_name); 96 stream->writeFlag(preserve_pos); 97 stream->writeFlag(ctrl_client_only); 98} 99 100void afxGuiControllerData::unpackData(BitStream* stream) 101{ 102 Parent::unpackData(stream); 103 104 control_name = stream->readSTString(); 105 preserve_pos = stream->readFlag(); 106 ctrl_client_only = stream->readFlag(); 107} 108 109 110//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// 111