fill in the validated variables

This commit is contained in:
AzaezelX 2025-03-09 11:53:23 -05:00
parent fa760fa746
commit f633ef3a3d
184 changed files with 1359 additions and 1216 deletions

View file

@ -175,16 +175,16 @@ void GuiTSCtrl::initPersistFields()
docsURL;
addGroup( "Camera" );
addField("cameraZRot", TypeF32, Offset(mCameraZRot, GuiTSCtrl),
addFieldV("cameraZRot", TypeRangedF32, Offset(mCameraZRot, GuiTSCtrl), &CommonValidators::DegreeRange,
"Z rotation angle of camera." );
addField("forceFOV", TypeF32, Offset(mForceFOV, GuiTSCtrl),
addFieldV("forceFOV", TypeRangedF32, Offset(mForceFOV, GuiTSCtrl), &CommonValidators::PosDegreeRange,
"The vertical field of view in degrees or zero to use the normal camera FOV." );
endGroup( "Camera" );
addGroup( "Rendering" );
addField( "reflectPriority", TypeF32, Offset( mReflectPriority, GuiTSCtrl ),
addFieldV( "reflectPriority", TypeRangedF32, Offset( mReflectPriority, GuiTSCtrl ), &CommonValidators::PositiveFloat,
"The share of the per-frame reflection update work this control's rendering should run.\n"
"The reflect update priorities of all visible GuiTSCtrls are added together and each control is assigned "
"a share of the per-frame reflection update time according to its percentage of the total priority value." );

View file

@ -135,9 +135,9 @@ void GuiIconButtonCtrl::initPersistFields()
addField( "makeIconSquare", TypeBool, Offset( mMakeIconSquare, GuiIconButtonCtrl ),"If true, will make sure the icon is square.\n");
addField( "textLocation", TYPEID< TextLocation >(), Offset( mTextLocation, GuiIconButtonCtrl ),"Where to place the text on the control.\n"
"Options are 0 (None), 1 (Bottom), 2 (Right), 3 (Top), 4 (Left), 5 (Center).\n");
addField( "textMargin", TypeS32, Offset( mTextMargin, GuiIconButtonCtrl ),"Margin between the icon and the text.\n");
addFieldV( "textMargin", TypeRangedS32, Offset( mTextMargin, GuiIconButtonCtrl ),&CommonValidators::PositiveInt,"Margin between the icon and the text.\n");
addField( "autoSize", TypeBool, Offset( mAutoSize, GuiIconButtonCtrl ),"If true, the text and icon will be automatically sized to the size of the control.\n");
addField( "bitmapMargin", TypeS32, Offset( mBitmapMargin, GuiIconButtonCtrl), "Margin between the icon and the border.\n");
addFieldV( "bitmapMargin", TypeRangedS32, Offset( mBitmapMargin, GuiIconButtonCtrl), &CommonValidators::PositiveInt, "Margin between the icon and the border.\n");
Parent::initPersistFields();
}

View file

@ -112,14 +112,14 @@ void GuiAutoScrollCtrl::initPersistFields()
addField( "scrollDirection", TYPEID< Direction >(), Offset( mDirection, GuiAutoScrollCtrl ),
"Direction in which the child control is moved." );
addField( "startDelay", TypeF32, Offset( mStartDelay, GuiAutoScrollCtrl ),
addFieldV( "startDelay", TypeRangedF32, Offset( mStartDelay, GuiAutoScrollCtrl ), &CommonValidators::PositiveFloat,
"Seconds to wait before starting to scroll." );
addField( "resetDelay", TypeF32, Offset( mResetDelay, GuiAutoScrollCtrl ),
addFieldV( "resetDelay", TypeRangedF32, Offset( mResetDelay, GuiAutoScrollCtrl ), &CommonValidators::PositiveFloat,
"Seconds to wait after scrolling completes before resetting and starting over.\n\n"
"@note Only takes effect if #isLooping is true." );
addField( "childBorder", TypeS32, Offset( mChildBorder, GuiAutoScrollCtrl ),
addFieldV( "childBorder", TypeRangedS32, Offset( mChildBorder, GuiAutoScrollCtrl ), &CommonValidators::PositiveInt,
"Padding to put around child control (in pixels)." );
addField( "scrollSpeed", TypeF32, Offset( mScrollSpeed, GuiAutoScrollCtrl ),
addFieldV( "scrollSpeed", TypeRangedF32, Offset( mScrollSpeed, GuiAutoScrollCtrl ), &CommonValidators::PositiveFloat,
"Scrolling speed in pixels per second." );
addField( "isLooping", TypeBool, Offset( mIsLooping, GuiAutoScrollCtrl ),
"If true, the scrolling will reset to the beginning once completing a cycle." );

View file

@ -56,15 +56,15 @@ void GuiControlArrayControl::initPersistFields()
docsURL;
addGroup( "Array" );
addField( "colCount", TypeS32, Offset(mCols, GuiControlArrayControl),
addFieldV( "colCount", TypeRangedS32, Offset(mCols, GuiControlArrayControl), &CommonValidators::PositiveInt,
"Number of colums in the array." );
addField( "colSizes", TypeS32Vector, Offset(mColumnSizes, GuiControlArrayControl),
"Size of each individual column." );
addField( "rowSize", TypeS32, Offset(mRowSize, GuiControlArrayControl),
addFieldV( "rowSize", TypeRangedS32, Offset(mRowSize, GuiControlArrayControl), &CommonValidators::PositiveInt,
"Heigth of a row in the array." );
addField( "rowSpacing", TypeS32, Offset(mRowSpacing, GuiControlArrayControl),
addFieldV( "rowSpacing", TypeRangedS32, Offset(mRowSpacing, GuiControlArrayControl), &CommonValidators::PositiveInt,
"Padding to put between rows." );
addField( "colSpacing", TypeS32, Offset(mColSpacing, GuiControlArrayControl),
addFieldV( "colSpacing", TypeRangedS32, Offset(mColSpacing, GuiControlArrayControl), &CommonValidators::PositiveInt,
"Padding to put between columns." );
endGroup( "Array" );

View file

@ -215,6 +215,9 @@ void GuiDragAndDropControl::onMouseDragged( const GuiEvent& event )
// Allow the control under the drag to react to a potential drop
GuiControl* enterTarget = findDragTarget( event.mousePoint, "onControlDragEnter" );
if(enterTarget != nullptr)
Con::printf("GuiDragAndDropControl::onMouseDragged() - enterTarget: %d", enterTarget->getId());
if( mLastTarget != enterTarget )
{
if( mLastTarget )

View file

@ -98,28 +98,28 @@ ConsoleDocClass( GuiDynamicCtrlArrayControl,
void GuiDynamicCtrlArrayControl::initPersistFields()
{
docsURL;
addField( "colCount", TypeS32, Offset( mCols, GuiDynamicCtrlArrayControl ),
addFieldV( "colCount", TypeRangedS32, Offset( mCols, GuiDynamicCtrlArrayControl ), &CommonValidators::PositiveInt,
"Number of columns the child controls have been arranged into. This "
"value is calculated automatically when children are added, removed or "
"resized; writing it directly has no effect." );
addField( "colSize", TypeS32, Offset( mColSize, GuiDynamicCtrlArrayControl ),
addFieldV( "colSize", TypeRangedS32, Offset( mColSize, GuiDynamicCtrlArrayControl ), &CommonValidators::PositiveInt,
"Width of each column. If <i>autoCellSize</i> is set, this will be "
"calculated automatically from the widest child control" );
addField( "rowCount", TypeS32, Offset( mRows, GuiDynamicCtrlArrayControl ),
addFieldV( "rowCount", TypeRangedS32, Offset( mRows, GuiDynamicCtrlArrayControl ), &CommonValidators::PositiveInt,
"Number of rows the child controls have been arranged into. This value "
"is calculated automatically when children are added, removed or resized; "
"writing it directly has no effect." );
addField( "rowSize", TypeS32, Offset( mRowSize, GuiDynamicCtrlArrayControl ),
addFieldV( "rowSize", TypeRangedS32, Offset( mRowSize, GuiDynamicCtrlArrayControl ), &CommonValidators::PositiveInt,
"Height of each row. If <i>autoCellSize</i> is set, this will be "
"calculated automatically from the tallest child control" );
addField( "rowSpacing", TypeS32, Offset( mRowSpacing, GuiDynamicCtrlArrayControl ),
addFieldV( "rowSpacing", TypeRangedS32, Offset( mRowSpacing, GuiDynamicCtrlArrayControl ), &CommonValidators::PositiveInt,
"Spacing between rows" );
addField( "colSpacing", TypeS32, Offset( mColSpacing, GuiDynamicCtrlArrayControl ),
addFieldV( "colSpacing", TypeRangedS32, Offset( mColSpacing, GuiDynamicCtrlArrayControl ), &CommonValidators::PositiveInt,
"Spacing between columns" );
addField( "frozen", TypeBool, Offset( mFrozen, GuiDynamicCtrlArrayControl ),

View file

@ -92,7 +92,7 @@ void GuiFrameSetCtrl::initPersistFields()
addField( "rows", TypeS32Vector, Offset(mRowOffsets, GuiFrameSetCtrl),
"A vector of row offsets (determines the height of each row)." );
addField( "borderWidth", TypeS32, Offset(mFramesetDetails.mBorderWidth, GuiFrameSetCtrl),
addFieldV( "borderWidth", TypeRangedS32, Offset(mFramesetDetails.mBorderWidth, GuiFrameSetCtrl), &CommonValidators::PositiveInt,
"Width of interior borders between cells in pixels." );
addField( "borderColor", TypeColorI, Offset(mFramesetDetails.mBorderColor, GuiFrameSetCtrl),
@ -111,7 +111,7 @@ void GuiFrameSetCtrl::initPersistFields()
"If true, row and column offsets are automatically scaled to match the "
"new extents when the control is resized." );
addField( "fudgeFactor", TypeS32, Offset(mFudgeFactor, GuiFrameSetCtrl),
addFieldV( "fudgeFactor", TypeRangedS32, Offset(mFudgeFactor, GuiFrameSetCtrl), &CommonValidators::PositiveInt,
"Offset for row and column dividers in pixels" );
Parent::initPersistFields();

View file

@ -99,7 +99,7 @@ void GuiRolloutCtrl::initPersistFields()
"Text label to display on the rollout header." );
addField( "margin", TypeRectI, Offset( mMargin, GuiRolloutCtrl ),
"Margin to put around child control." );
addField( "defaultHeight", TypeS32, Offset( mDefaultHeight, GuiRolloutCtrl ),
addFieldV( "defaultHeight", TypeRangedS32, Offset( mDefaultHeight, GuiRolloutCtrl ), &CommonValidators::PositiveInt,
"Default height of the client area. This is used when no child control has been added to the rollout." );
addProtectedField( "expanded", TypeBool, Offset( mIsExpanded, GuiRolloutCtrl), &setExpanded, &defaultProtectedGetFn,
"The current rollout expansion state." );

View file

@ -111,7 +111,7 @@ void GuiScrollCtrl::initPersistFields()
addField( "constantThumbHeight", TypeBool, Offset(mUseConstantHeightThumb, GuiScrollCtrl));
addField( "childMargin", TypePoint2I, Offset(mChildMargin, GuiScrollCtrl),
"Padding region to put around child contents." );
addField( "mouseWheelScrollSpeed", TypeS32, Offset(mScrollAnimSpeed, GuiScrollCtrl),
addFieldV( "mouseWheelScrollSpeed", TypeRangedS32, Offset(mScrollAnimSpeed, GuiScrollCtrl), &CommonValidators::PositiveInt,
"Pixels/Tick - if not positive then mousewheel scrolling occurs instantly (like other scrolling).");
endGroup( "Scrolling" );

View file

@ -118,14 +118,14 @@ void GuiSplitContainer::initPersistFields()
addField( "orientation", TYPEID< Orientation >(), Offset( mOrientation, GuiSplitContainer),
"Whether to split between top and bottom (horizontal) or between left and right (vertical)." );
addField( "splitterSize", TypeS32, Offset( mSplitterSize, GuiSplitContainer),
addFieldV( "splitterSize", TypeRangedS32, Offset( mSplitterSize, GuiSplitContainer), &CommonValidators::PositiveInt,
"Width of the splitter bar between the two sides. Default is 2." );
addField( "splitPoint", TypePoint2I, Offset( mSplitPoint, GuiSplitContainer),
"Point on control through which the splitter goes.\n\n"
"Changed relatively if size of control changes." );
addField( "fixedPanel", TYPEID< FixedPanel >(), Offset( mFixedPanel, GuiSplitContainer),
"Which (if any) side of the splitter to keep at a fixed size." );
addField( "fixedSize", TypeS32, Offset( mFixedPanelSize, GuiSplitContainer),
addFieldV( "fixedSize", TypeRangedS32, Offset( mFixedPanelSize, GuiSplitContainer), &CommonValidators::PositiveInt,
"Width of the fixed panel specified by #fixedPanel (if any)." );
endGroup( "Splitter" );

View file

@ -110,4 +110,4 @@ DefineEnumType( GuiSplitFixedPanel );
/// @}
#endif // _GUI_SPLTCONTAINER_H_
#endif // _GUI_SPLTCONTAINER_H_

View file

@ -110,7 +110,7 @@ void GuiStackControl::initPersistFields()
"Controls the type of vertical stacking to use (<i>Top to Bottom</i> or "
"<i>Bottom to Top</i>)" );
addField( "padding", TypeS32, Offset(mPadding, GuiStackControl),
addFieldV( "padding", TypeRangedS32, Offset(mPadding, GuiStackControl), &CommonValidators::PositiveInt,
"Distance (in pixels) between stacked child controls." );
addField( "dynamicSize", TypeBool, Offset(mDynamicSize, GuiStackControl),

View file

@ -27,6 +27,7 @@
#include "gui/controls/guiPopUpCtrl.h"
#include "gui/core/guiDefaultControlRender.h"
#include "gfx/gfxDrawUtil.h"
#include "console/typeValidators.h"
IMPLEMENT_CONOBJECT( GuiTabBookCtrl );
@ -107,19 +108,19 @@ void GuiTabBookCtrl::initPersistFields()
addField( "tabPosition", TYPEID< TabPosition >(), Offset( mTabPosition, GuiTabBookCtrl ),
"Where to place the tab page headers." );
addField( "tabMargin", TypeS32, Offset( mTabMargin, GuiTabBookCtrl ),
addFieldV( "tabMargin", TypeRangedS32, Offset( mTabMargin, GuiTabBookCtrl ), &CommonValidators::PositiveInt,
"Spacing to put between individual tab page headers." );
addField( "minTabWidth", TypeS32, Offset( mMinTabWidth, GuiTabBookCtrl ),
addFieldV( "minTabWidth", TypeRangedS32, Offset( mMinTabWidth, GuiTabBookCtrl ), &CommonValidators::PositiveInt,
"Minimum width allocated to a tab page header." );
addField( "tabHeight", TypeS32, Offset( mTabHeight, GuiTabBookCtrl ),
addFieldV( "tabHeight", TypeRangedS32, Offset( mTabHeight, GuiTabBookCtrl ), &CommonValidators::PositiveInt,
"Height of tab page headers." );
addField( "allowReorder", TypeBool, Offset( mAllowReorder, GuiTabBookCtrl ),
"Whether reordering tabs with the mouse is allowed." );
addField( "defaultPage", TypeS32, Offset( mDefaultPageNum, GuiTabBookCtrl ),
addFieldV( "defaultPage", TypeRangedS32, Offset( mDefaultPageNum, GuiTabBookCtrl ), &CommonValidators::NegDefaultInt,
"Index of page to select on first onWake() call (-1 to disable)." );
addProtectedField( "selectedPage", TypeS32, Offset( mSelectedPageNum, GuiTabBookCtrl ),
&_setSelectedPage, &defaultProtectedGetFn,
addProtectedFieldV( "selectedPage", TypeRangedS32, Offset( mSelectedPageNum, GuiTabBookCtrl ),
&_setSelectedPage, &defaultProtectedGetFn, &CommonValidators::PositiveInt,
"Index of currently selected page." );
addField( "frontTabPadding", TypeS32, Offset( mFrontTabPadding, GuiTabBookCtrl ),
@ -320,6 +321,15 @@ bool GuiTabBookCtrl::resize(const Point2I &newPosition, const Point2I &newExtent
bool result = Parent::resize( newPosition, newExtent );
calculatePageTabs();
for (S32 i = 0; i < mPages.size(); i++)
{
const TabHeaderInfo& info = mPages[i];
GuiTabPageCtrl* page = info.Page;
if(page->getFitBook())
fitPage(page);
}
return result;
}
@ -430,6 +440,18 @@ void GuiTabBookCtrl::onMouseMove(const GuiEvent &event)
void GuiTabBookCtrl::onMouseLeave( const GuiEvent &event )
{
Parent::onMouseLeave( event );
if(mDraggingTab)
{
//we dragged the tab out, so do something about that
GuiTabPageCtrl* selectedPage = NULL;
if (mSelectedPageNum != -1)
selectedPage = mPages[mSelectedPageNum].Page;
mDraggingTab = false;
Con::executef(this, "onTabDraggedOut", selectedPage->getIdString());
}
mHoverTab = NULL;
}

View file

@ -143,7 +143,7 @@ void GuiWindowCtrl::initPersistFields()
"Whether the window can be resized horizontally." );
addField( "resizeHeight", TypeBool, Offset( mResizeHeight, GuiWindowCtrl ),
"Whether the window can be resized vertically." );
addField("resizeMargin", TypeF32, Offset(mResizeMargin, GuiWindowCtrl),
addFieldV("resizeMargin", TypeRangedF32, Offset(mResizeMargin, GuiWindowCtrl), &CommonValidators::PositiveFloat,
"Margin along the window edge to allow grabbing.");
addField( "canMove", TypeBool, Offset( mCanMove, GuiWindowCtrl ),
"Whether the window can be moved by dragging its titlebar." );

View file

@ -28,6 +28,7 @@
#include "console/engineAPI.h"
#include "gfx/gfxDevice.h"
#include "gfx/gfxDrawUtil.h"
#include "console/typeValidators.h"
@ -89,7 +90,7 @@ void guiAnimBitmapCtrl::initPersistFields()
addField("reverse", TypeBool, Offset(mReverse, guiAnimBitmapCtrl), "play reversed?");
addField("fps", TypeS32, Offset(mFramesPerSec, guiAnimBitmapCtrl), "Frame Rate");
addProtectedField("curFrame", TypeS32, Offset(mCurFrameIndex, guiAnimBitmapCtrl), &ptSetFrame, &defaultProtectedGetFn, "Index of currently Displaying Frame ");
addProtectedFieldV("curFrame", TypeRangedS32, Offset(mCurFrameIndex, guiAnimBitmapCtrl), &ptSetFrame, &defaultProtectedGetFn, &CommonValidators::S32Range, "Index of currently Displaying Frame ");
Parent::initPersistFields();
removeField("wrap");
@ -126,16 +127,21 @@ bool guiAnimBitmapCtrl::ptSetFrame(void *object, const char *index, const char *
S32 val = dAtoi(data);
if (val < 0)
if ((val < 0) || (val >pData->mNumFrames))
{
pData->mCurFrameIndex = pData->mNumFrames;
if (pData->mLoop)
{
int len = pData->mNumFrames;
val = (val >= 0 ? val % len : -val % len ? len - (-val % len) : 0);
}
else
{
if (val < 0) val = 0;
if (val >pData->mNumFrames) val = pData->mNumFrames;
}
pData->mCurFrameIndex = val;
return false;
}
else if (val > pData->mNumFrames)
{
pData->mCurFrameIndex = 0;
return false;
};
pData->mCurFrameIndex = val;
return true;

View file

@ -44,7 +44,7 @@ GuiBitmapBarCtrl::GuiBitmapBarCtrl(void)
void GuiBitmapBarCtrl::initPersistFields()
{
docsURL;
addField("percent", TypeF32, Offset(mPercent, GuiBitmapBarCtrl),
addFieldV("percent", TypeRangedF32, Offset(mPercent, GuiBitmapBarCtrl), &CommonValidators::NormalizedFloat,
"% shown");
addField("vertical", TypeBool, Offset(mVertical, GuiBitmapBarCtrl),
"If true, the bitmap is clipped vertically.");

View file

@ -88,7 +88,7 @@ void GuiBitmapCtrl::initPersistFields()
addField( "wrap", TypeBool, Offset( mWrap, GuiBitmapCtrl ),
"If true, the bitmap is tiled inside the control rather than stretched to fit." );
addField("angle", TypeF32, Offset(mAngle, GuiBitmapCtrl), "rotation");
addFieldV("angle", TypeRangedF32, Offset(mAngle, GuiBitmapCtrl), &CommonValidators::DegreeRange, "rotation");
endGroup( "Bitmap" );

View file

@ -29,6 +29,26 @@
#include "gui/controls/guiColorPicker.h"
#include "gfx/primBuilder.h"
#include "gfx/gfxDrawUtil.h"
#include "console/typeValidators.h"
/// @name Common colors we use
/// @{
LinearColorF colorWhite(1.,1.,1.);
LinearColorF colorWhiteBlend(1.,1.,1.,.75);
LinearColorF colorBlack(.0,.0,.0);
LinearColorF colorAlpha(0.0f, 0.0f, 0.0f, 0.0f);
LinearColorF colorAlphaW(1.0f, 1.0f, 1.0f, 0.0f);
ColorI GuiColorPickerCtrl::mColorRange[7] = {
ColorI(255,0,0), // Red
ColorI(255,0,255), // Pink
ColorI(0,0,255), // Blue
ColorI(0,255,255), // Light blue
ColorI(0,255,0), // Green
ColorI(255,255,0), // Yellow
ColorI(255,0,0), // Red
};
/// @}
#include "postFx/postEffectManager.h"
#include "gfx/screenshot.h"
@ -91,7 +111,9 @@ void GuiColorPickerCtrl::initPersistFields()
{
docsURL;
addGroup("ColorPicker");
addField("selectorGap", TypeS32, Offset(mSelectorGap, GuiColorPickerCtrl));
addField("baseColor", TypeColorF, Offset(mBaseColor, GuiColorPickerCtrl));
addField("pickColor", TypeColorF, Offset(mPickColor, GuiColorPickerCtrl));
addFieldV("selectorGap", TypeRangedS32, Offset(mSelectorGap, GuiColorPickerCtrl),&CommonValidators::NaturalNumber);
addField("displayMode", TYPEID< PickMode >(), Offset(mDisplayMode, GuiColorPickerCtrl) );
addField("selectorMode", TYPEID< SelectorMode >(), Offset(mSelectorMode, GuiColorPickerCtrl) );
addField("actionOnMove", TypeBool,Offset(mActionOnMove, GuiColorPickerCtrl));

View file

@ -29,6 +29,7 @@
#include "gui/containers/guiScrollCtrl.h"
#include "sim/actionMap.h"
#include "core/strings/stringUnit.h"
#include "console/typeValidators.h"
//-----------------------------------------------------------------------------
// GuiGameListMenuCtrl
@ -1878,10 +1879,10 @@ void GuiGameListMenuProfile::initPersistFields()
addField( "rowSize", TypePoint2I, Offset(mRowSize, GuiGameListMenuProfile),
"The base size (\"width height\") of a row" );
addField("columnSplit", TypeS32, Offset(mColumnSplit, GuiGameListMenuProfile),
addFieldV("columnSplit", TypeRangedS32, Offset(mColumnSplit, GuiGameListMenuProfile), &CommonValidators::PositiveInt,
"Padding between the leftmost edge of the control, and the row's left arrow.");
addField("rightPad", TypeS32, Offset(mRightPad, GuiGameListMenuProfile),
addFieldV("rightPad", TypeRangedS32, Offset(mRightPad, GuiGameListMenuProfile), &CommonValidators::PositiveInt,
"Padding between the rightmost edge of the control and the row's right arrow.");
Parent::initPersistFields();

View file

@ -544,10 +544,10 @@ ConsoleDocClass( GuiGameListOptionsProfile,
void GuiGameListOptionsProfile::initPersistFields()
{
docsURL;
addField( "columnSplit", TypeS32, Offset(mColumnSplit, GuiGameListOptionsProfile),
addFieldV( "columnSplit", TypeRangedS32, Offset(mColumnSplit, GuiGameListOptionsProfile), &CommonValidators::PositiveInt,
"Padding between the leftmost edge of the control, and the row's left arrow." );
addField( "rightPad", TypeS32, Offset(mRightPad, GuiGameListOptionsProfile),
addFieldV( "rightPad", TypeRangedS32, Offset(mRightPad, GuiGameListOptionsProfile), &CommonValidators::PositiveInt,
"Padding between the rightmost edge of the control and the row's right arrow." );
Parent::initPersistFields();

View file

@ -29,6 +29,7 @@
#include "gui/containers/guiScrollCtrl.h"
#include "core/strings/stringUnit.h"
#include "gui/core/guiDefaultControlRender.h"
#include "console/typeValidators.h"
//-----------------------------------------------------------------------------
// GuiGameSettingsCtrl
@ -844,13 +845,13 @@ void GuiGameSettingsCtrl::initPersistFields()
INITPERSISTFIELD_IMAGEASSET(PreviousBitmap, GuiGameSettingsCtrl, "Bitmap used for the previous button when in list mode.");
INITPERSISTFIELD_IMAGEASSET(NextBitmap, GuiGameSettingsCtrl, "Bitmap used for the next button when in list mode.");
addField("arrowSize", TypeS32, Offset(mArrowSize, GuiGameSettingsCtrl),
addFieldV("arrowSize", TypeRangedS32, Offset(mArrowSize, GuiGameSettingsCtrl), &CommonValidators::PositiveInt,
"Size of the arrow buttons' extents");
addField("columnSplit", TypeS32, Offset(mColumnSplit, GuiGameSettingsCtrl),
addFieldV("columnSplit", TypeRangedS32, Offset(mColumnSplit, GuiGameSettingsCtrl), &CommonValidators::NaturalNumber,
"Position of the split between the leftside label and the rightside setting parts");
addField("rightPad", TypeS32, Offset(mRightPad, GuiGameSettingsCtrl),
addFieldV("rightPad", TypeRangedS32, Offset(mRightPad, GuiGameSettingsCtrl), &CommonValidators::NaturalNumber,
"Padding between the rightmost edge of the control and right arrow.");
addField("callbackOnA", TypeString, Offset(mCallbackOnA, GuiGameSettingsCtrl),

View file

@ -32,6 +32,7 @@
#include "sfx/sfxTrack.h"
#include "sfx/sfxTypes.h"
#include "console/engineAPI.h"
#include "console/typeValidators.h"
IMPLEMENT_CONOBJECT( GuiMLTextCtrl );
@ -301,18 +302,18 @@ void GuiMLTextCtrl::initPersistFields()
docsURL;
addGroup( "Text" );
addField("lineSpacing", TypeS32, Offset(mLineSpacingPixels, GuiMLTextCtrl), "The number of blank pixels to place between each line.\n");
addFieldV("lineSpacing", TypeRangedS32, Offset(mLineSpacingPixels, GuiMLTextCtrl), &CommonValidators::PositiveInt, "The number of blank pixels to place between each line.\n");
addField("allowColorChars", TypeBool, Offset(mAllowColorChars, GuiMLTextCtrl), "If true, the control will allow characters to have unique colors.");
addField("maxChars", TypeS32, Offset(mMaxBufferSize, GuiMLTextCtrl), "Maximum number of characters that the control will display.");
addFieldV("maxChars", TypeRangedS32, Offset(mMaxBufferSize, GuiMLTextCtrl), &CommonValidators::NegDefaultInt, "Maximum number of characters that the control will display.");
INITPERSISTFIELD_SOUNDASSET(DeniedSound, GuiMLTextCtrl, "If the text will not fit in the control, the deniedSound is played.");
addField("text", TypeCaseString, Offset( mInitialText, GuiMLTextCtrl ), "Text to display in this control.");
addField("useURLMouseCursor", TypeBool, Offset(mUseURLMouseCursor, GuiMLTextCtrl), "If true, the mouse cursor will turn into a hand cursor while over a link in the text.\n"
"This is dependant on the markup language used by the GuiMLTextCtrl\n");
addField("useTypeOverTime", TypeBool, Offset(mUseTypeOverTime, GuiMLTextCtrl), "");
addField("typeOverTimeSpeedMS", TypeF32, Offset(mTypeOverTimeSpeedMS, GuiMLTextCtrl), "");
addFieldV("typeOverTimeSpeedMS", TypeRangedF32, Offset(mTypeOverTimeSpeedMS, GuiMLTextCtrl), &CommonValidators::PositiveFloat, "");
addField("typeoutSound", TypeSFXTrackName, Offset(mTypeoutSound, GuiMLTextCtrl), "Played when the text is being typed out");
addField("typeoutSoundRate", TypeS32, Offset(mTypeoutSoundRate, GuiMLTextCtrl), "Dictates how many characters must be typed out before the sound is played again. -1 for the sound to only play once at the start.");
addFieldV("typeoutSoundRate", TypeRangedS32, Offset(mTypeoutSoundRate, GuiMLTextCtrl), &CommonValidators::NegDefaultInt, "Dictates how many characters must be typed out before the sound is played again. -1 for the sound to only play once at the start.");
endGroup( "Text" );

View file

@ -298,7 +298,7 @@ GuiPopUpMenuCtrl::~GuiPopUpMenuCtrl()
void GuiPopUpMenuCtrl::initPersistFields(void)
{
docsURL;
addField("maxPopupHeight", TypeS32, Offset(mMaxPopupHeight, GuiPopUpMenuCtrl));
addFieldV("maxPopupHeight", TypeRangedS32, Offset(mMaxPopupHeight, GuiPopUpMenuCtrl), &CommonValidators::PositiveInt);
addField("sbUsesNAColor", TypeBool, Offset(mRenderScrollInNA, GuiPopUpMenuCtrl));
addField("reverseTextList", TypeBool, Offset(mReverseTextList, GuiPopUpMenuCtrl));

View file

@ -28,6 +28,7 @@
#include "gfx/primBuilder.h"
#include "gfx/gfxDrawUtil.h"
#include "console/engineAPI.h"
#include "console/typeValidators.h"
ConsoleDocClass( GuiPopUpMenuCtrlEx,
"@brief A control that allows to select a value from a drop-down list.\n\n"
@ -352,7 +353,7 @@ GuiPopUpMenuCtrlEx::~GuiPopUpMenuCtrlEx()
void GuiPopUpMenuCtrlEx::initPersistFields(void)
{
docsURL;
addField("maxPopupHeight", TypeS32, Offset(mMaxPopupHeight, GuiPopUpMenuCtrlEx), "Length of menu when it extends");
addFieldV("maxPopupHeight", TypeRangedS32, Offset(mMaxPopupHeight, GuiPopUpMenuCtrlEx), &CommonValidators::PositiveInt, "Length of menu when it extends");
addField("sbUsesNAColor", TypeBool, Offset(mRenderScrollInNA, GuiPopUpMenuCtrlEx), "Deprecated" "@internal");
addField("reverseTextList", TypeBool, Offset(mReverseTextList, GuiPopUpMenuCtrlEx), "Reverses text list if popup extends up, instead of down");
@ -1236,7 +1237,7 @@ void GuiPopUpMenuCtrlEx::onRender(Point2I offset, const RectI &updateRect)
{
localStart.x = getWidth() - txt_w - 12;
}
}
}
else
{
localStart.x = mProfile->mTextOffset.x; // Use mProfile->mTextOffset as a controlable margin for the control's text.

View file

@ -96,7 +96,7 @@ void GuiTextCtrl::initPersistFields()
addField( "textID", TypeString, Offset( mInitialTextID, GuiTextCtrl ),
"Maps the text of this control to a variable used in localization, rather than raw text.");
addField( "maxLength", TypeS32, Offset( mMaxStrLen, GuiTextCtrl ),
addFieldV( "maxLength", TypeRangedS32, Offset( mMaxStrLen, GuiTextCtrl ), &CommonValidators::PositiveInt,
"Defines the maximum length of the text. The default is 1024." );
Parent::initPersistFields();

View file

@ -36,6 +36,7 @@
#include "sfx/sfxSystem.h"
#include "core/strings/unicode.h"
#include "console/engineAPI.h"
#include "console/typeValidators.h"
IMPLEMENT_CONOBJECT(GuiTextEditCtrl);
@ -177,7 +178,7 @@ void GuiTextEditCtrl::initPersistFields()
addField("validate", TypeRealString,Offset(mValidateCommand, GuiTextEditCtrl), "Script command to be called when the first validater is lost.\n");
addField("escapeCommand", TypeRealString,Offset(mEscapeCommand, GuiTextEditCtrl), "Script command to be called when the Escape key is pressed.\n");
addField("historySize", TypeS32, Offset(mHistorySize, GuiTextEditCtrl), "How large of a history buffer to maintain.\n");
addFieldV("historySize", TypeRangedS32, Offset(mHistorySize, GuiTextEditCtrl), &CommonValidators::PositiveInt, "How large of a history buffer to maintain.\n");
addField("tabComplete", TypeBool, Offset(mTabComplete, GuiTextEditCtrl), "If true, when the 'tab' key is pressed, it will act as if the Enter key was pressed on the control.\n");
addField("deniedSound", TypeSFXTrackName, Offset(mDeniedSound, GuiTextEditCtrl), "If the attempted text cannot be entered, this sound effect will be played.\n");
addField("sinkAllKeyEvents", TypeBool, Offset(mSinkAllKeyEvents, GuiTextEditCtrl), "If true, every key event will act as if the Enter key was pressed.\n");

View file

@ -341,6 +341,8 @@ void GuiTextEditSliderCtrl::onRender(Point2I offset, const RectI &updateRect)
mIncCounter = (mIncCounter > 0.0f) ? mIncCounter-1 : mIncCounter+1;
checkRange();
setValue();
execConsoleCallback();
execAltConsoleCallback();
mCursorPos = 0;
}
}

View file

@ -29,6 +29,7 @@
#include "gui/core/guiDefaultControlRender.h"
#include "gfx/gfxDrawUtil.h"
#include "console/engineAPI.h"
#include "console/typeValidators.h"
IMPLEMENT_CONOBJECT(GuiTextListCtrl);
@ -134,7 +135,7 @@ void GuiTextListCtrl::initPersistFields()
addField("columns", TypeS32Vector, Offset(mColumnOffsets, GuiTextListCtrl), "A vector of column offsets. The number of values determines the number of columns in the table.\n" );
addField("fitParentWidth", TypeBool, Offset(mFitParentWidth, GuiTextListCtrl), "If true, the width of this control will match the width of its parent.\n");
addField("clipColumnText", TypeBool, Offset(mClipColumnText, GuiTextListCtrl), "If true, text exceeding a column's given width will get clipped.\n" );
addField("rowHeightPadding", TypeS32, Offset(mRowHeightPadding, GuiTextListCtrl), "Sets how much padding to add to the row heights on top of the font height");
addFieldV("rowHeightPadding", TypeRangedS32, Offset(mRowHeightPadding, GuiTextListCtrl), &CommonValidators::PositiveInt, "Sets how much padding to add to the row heights on top of the font height");
Parent::initPersistFields();
}

View file

@ -883,10 +883,10 @@ void GuiTreeViewCtrl::initPersistFields()
docsURL;
addGroup( "TreeView" );
addField( "tabSize", TypeS32, Offset(mTabSize, GuiTreeViewCtrl));
addFieldV( "tabSize", TypeRangedS32, Offset(mTabSize, GuiTreeViewCtrl), &CommonValidators::PositiveInt);
addField( "textOffset", TypeS32, Offset(mTextOffset, GuiTreeViewCtrl));
addField( "fullRowSelect", TypeBool, Offset(mFullRowSelect, GuiTreeViewCtrl));
addField( "itemHeight", TypeS32, Offset(mItemHeight, GuiTreeViewCtrl));
addFieldV( "itemHeight", TypeRangedS32, Offset(mItemHeight, GuiTreeViewCtrl), &CommonValidators::PositiveInt);
addField( "destroyTreeOnSleep", TypeBool, Offset(mDestroyOnSleep, GuiTreeViewCtrl),
"If true, the entire tree item hierarchy is deleted when the control goes to sleep." );
addField( "mouseDragging", TypeBool, Offset(mSupportMouseDragging, GuiTreeViewCtrl));

View file

@ -39,6 +39,7 @@
#include "gui/core/guiDefaultControlRender.h"
#include "gui/editor/guiEditCtrl.h"
#include "gfx/gfxDrawUtil.h"
#include "console/typeValidators.h"
//#define DEBUG_SPEW
@ -306,7 +307,7 @@ void GuiControl::initPersistFields()
"Control profile to use when rendering tooltips for this control." );
addField("tooltip", TypeRealString, Offset(mTooltip, GuiControl),
"String to show in tooltip for this control." );
addField("hovertime", TypeS32, Offset(mTipHoverTime, GuiControl),
addFieldV("hovertime", TypeRangedS32, Offset(mTipHoverTime, GuiControl), &CommonValidators::PositiveInt,
"Time for mouse to hover over control until tooltip is shown (in milliseconds)." );
endGroup( "ToolTip" );

View file

@ -34,6 +34,7 @@
#include "sfx/sfxTrack.h"
#include "sfx/sfxTypes.h"
#include "console/engineAPI.h"
#include "console/typeValidators.h"
//#define DEBUG_SPEW
@ -370,9 +371,9 @@ void GuiControlProfile::initPersistFields()
addField("fillColorNA", TypeColorI, Offset(mFillColorNA, GuiControlProfile));
addField("fillColorERR", TypeColorI, Offset(mFillColorERR, GuiControlProfile));
addField("fillColorSEL", TypeColorI, Offset(mFillColorSEL, GuiControlProfile));
addField("border", TypeS32, Offset(mBorder, GuiControlProfile),
addFieldV("border", TypeRangedS32, Offset(mBorder, GuiControlProfile), &CommonValidators::PositiveInt,
"Border type (0=no border)." );
addField("borderThickness",TypeS32, Offset(mBorderThickness, GuiControlProfile),
addFieldV("borderThickness", TypeRangedS32, Offset(mBorderThickness, GuiControlProfile), &CommonValidators::PositiveInt,
"Thickness of border in pixels." );
addField("borderColor", TypeColorI, Offset(mBorderColor, GuiControlProfile),
"Color to draw border with." );
@ -394,7 +395,7 @@ void GuiControlProfile::initPersistFields()
addField("fontType", TypeString, Offset(mFontType, GuiControlProfile),
"Name of font family and typeface (e.g. \"Arial Bold\")." );
addField("fontSize", TypeS32, Offset(mFontSize, GuiControlProfile),
addFieldV("fontSize", TypeRangedS32, Offset(mFontSize, GuiControlProfile), &CommonValidators::PositiveInt,
"Font size in points." );
addField("fontCharset", TYPEID< FontCharset >(), Offset(mFontCharset, GuiControlProfile) );
addField("fontColors", TypeColorI, Offset(mFontColors, GuiControlProfile), ColorMax,

View file

@ -54,7 +54,7 @@ void GuiEaseViewCtrl::initPersistFields()
addField("ease", TypeEaseF, Offset( mEase, GuiEaseViewCtrl ) );
addField("easeColor", TypeColorF, Offset( mEaseColor, GuiEaseViewCtrl ) );
addField("easeWidth", TypeF32, Offset(mEaseWidth, GuiEaseViewCtrl ) );
addFieldV("easeWidth", TypeRangedF32, Offset(mEaseWidth, GuiEaseViewCtrl ), &CommonValidators::PositiveNonZeroFloat);
addField("axisColor", TypeColorF, Offset( mAxisColor, GuiEaseViewCtrl ) );
}

View file

@ -152,7 +152,7 @@ void GuiEditCtrl::initPersistFields()
"If true, selection edges will snap into alignment when moved or resized." );
addField( "snapToCenters", TypeBool, Offset( mSnapToCenters, GuiEditCtrl ),
"If true, selection centers will snap into alignment when moved or resized." );
addField( "snapSensitivity", TypeS32, Offset( mSnapSensitivity, GuiEditCtrl ),
addFieldV( "snapSensitivity", TypeRangedS32, Offset( mSnapSensitivity, GuiEditCtrl ), &CommonValidators::PositiveInt,
"Distance in pixels that edge and center snapping will work across." );
endGroup( "Snapping" );

View file

@ -29,6 +29,7 @@
#include "guiFilterCtrl.h"
#include "math/mMath.h"
#include "gfx/gfxDrawUtil.h"
#include "console/typeValidators.h"
IMPLEMENT_CONOBJECT(GuiFilterCtrl);
@ -51,7 +52,7 @@ GuiFilterCtrl::GuiFilterCtrl()
void GuiFilterCtrl::initPersistFields()
{
docsURL;
addField("controlPoints", TypeS32, Offset(mControlPointRequest, GuiFilterCtrl),
addFieldV("controlPoints", TypeRangedS32, Offset(mControlPointRequest, GuiFilterCtrl), &CommonValidators::NaturalNumber,
"Total number of control points in the spline curve." );
addField("filter", TypeF32Vector, Offset(mFilter, GuiFilterCtrl),
"Vector of control points." );

View file

@ -105,7 +105,7 @@ void GuiGraphCtrl::initPersistFields()
docsURL;
addGroup( "Graph" );
addField( "centerY", TypeF32, Offset( mCenterY, GuiGraphCtrl ),
addFieldV( "centerY", TypeRangedF32, Offset( mCenterY, GuiGraphCtrl ), &CommonValidators::NormalizedFloat,
"Ratio of where to place the center coordinate of the graph on the Y axis. 0.5=middle height of control.\n\n"
"This allows to account for graphs that have only positive or only negative data points, for example." );
@ -119,7 +119,7 @@ void GuiGraphCtrl::initPersistFields()
"Name of the variable to automatically plot on the curves. If empty, auto-plotting "
"is disabled for the respective curve." );
addField( "plotInterval", TypeS32, Offset( mAutoPlotDelay, GuiGraphCtrl ), MaxPlots,
addFieldV( "plotInterval", TypeRangedS32, Offset( mAutoPlotDelay, GuiGraphCtrl ), &CommonValidators::PositiveInt, MaxPlots,
"Interval between auto-plots of #plotVariable for the respective curve (in milliseconds)." );
endGroup( "Graph" );

View file

@ -34,6 +34,7 @@
#include "gfx/primBuilder.h"
#include "console/engineAPI.h"
#include "gui/editor/guiPopupMenuCtrl.h"
#include "console/typeValidators.h"
// menu bar:
// basic idea - fixed height control bar at the top of a window, placed and sized in gui editor
@ -188,9 +189,9 @@ void GuiMenuBar::onRemove()
void GuiMenuBar::initPersistFields()
{
docsURL;
addField("padding", TypeS32, Offset( mPadding, GuiMenuBar ),"Extra padding to add to the bounds of the control.\n");
addFieldV("padding", TypeRangedS32, Offset( mPadding, GuiMenuBar ), &CommonValidators::PositiveInt,"Extra padding to add to the bounds of the control.\n");
addField("menubarHeight", TypeS32, Offset(mMenubarHeight, GuiMenuBar), "Sets the height of the menubar when attached to the canvas.\n");
addFieldV("menubarHeight", TypeRangedS32, Offset(mMenubarHeight, GuiMenuBar), &CommonValidators::PositiveInt, "Sets the height of the menubar when attached to the canvas.\n");
Parent::initPersistFields();
}

View file

@ -25,6 +25,7 @@
#include "console/engineAPI.h"
#include "gfx/gfxDevice.h"
#include "gfx/gfxDrawUtil.h"
#include "console/typeValidators.h"
#include "gui/editor/guiRectHandles.h"
@ -55,7 +56,7 @@ void GuiRectHandles::initPersistFields()
{
docsURL;
addField("handleRect", TypeRectF, Offset(mHandleRect, GuiRectHandles), "RectF of handle's box." );
addField("handleSize", TypeS32, Offset(mHandleSize, GuiRectHandles), "Size of handles in pixels." );
addFieldV("handleSize", TypeRangedS32, Offset(mHandleSize, GuiRectHandles), &CommonValidators::NaturalNumber, "Size of handles in pixels." );
addField("useCustomColor", TypeBool, Offset(mUseCustomColor, GuiRectHandles), "Use given custom color for handles." );
addField("handleColor", TypeColorI, Offset(mHandleColor, GuiRectHandles), "Use given custom color for handles." );

View file

@ -29,6 +29,7 @@
#include "console/consoleTypes.h"
#include "gui/core/guiCanvas.h"
#include "gui/core/guiDefaultControlRender.h"
#include "console/typeValidators.h"
IMPLEMENT_CONOBJECT(GuiSeparatorCtrl);
@ -77,9 +78,9 @@ void GuiSeparatorCtrl::initPersistFields()
"Optional text label to display." );
addField("type", TYPEID< separatorTypeOptions >(), Offset(mSeparatorType, GuiSeparatorCtrl),
"Orientation of separator." );
addField("borderMargin", TypeS32, Offset(mMargin, GuiSeparatorCtrl));
addFieldV("borderMargin", TypeRangedS32, Offset(mMargin, GuiSeparatorCtrl), &CommonValidators::PositiveInt);
addField("invisible", TypeBool, Offset(mInvisible, GuiSeparatorCtrl));// Nonsense. Should use GuiControl's visibility.
addField("leftMargin", TypeS32, Offset(mTextLeftMargin, GuiSeparatorCtrl),
addFieldV("leftMargin", TypeRangedS32, Offset(mTextLeftMargin, GuiSeparatorCtrl), &CommonValidators::PositiveInt,
"Left margin of text label." );
Parent::initPersistFields();

View file

@ -174,7 +174,7 @@ void GuiShapeEdPreview::initPersistFields()
addGroup( "Detail Stats" );
addField( "fixedDetail", TypeBool, Offset( mFixedDetail, GuiShapeEdPreview ),
"If false, the current detail is selected based on camera distance" );
addField( "orbitDist", TypeF32, Offset( mOrbitDist, GuiShapeEdPreview ),
addFieldV( "orbitDist", TypeRangedF32, Offset( mOrbitDist, GuiShapeEdPreview ), &CommonValidators::PositiveFloat,
"The current distance from the camera to the model" );
addProtectedField( "currentDL", TypeS32, Offset( mCurrentDL, GuiShapeEdPreview ), &setFieldCurrentDL, &defaultProtectedGetFn,
"The current detail level" );

View file

@ -92,11 +92,11 @@ void GuiFadeinBitmapCtrl::initPersistFields()
addField( "fadeColor", TypeColorF, Offset( mFadeColor, GuiFadeinBitmapCtrl ),
"Color to fade in from and fade out to." );
addField( "fadeInTime", TypeS32, Offset( mFadeInTime, GuiFadeinBitmapCtrl ),
addFieldV( "fadeInTime", TypeRangedS32, Offset( mFadeInTime, GuiFadeinBitmapCtrl ), &CommonValidators::PositiveInt,
"Milliseconds for the bitmap to fade in." );
addField( "waitTime", TypeS32, Offset( mWaitTime, GuiFadeinBitmapCtrl ),
addFieldV( "waitTime", TypeRangedS32, Offset( mWaitTime, GuiFadeinBitmapCtrl ), &CommonValidators::PositiveInt,
"Milliseconds to wait after fading in before fading out the bitmap." );
addField( "fadeOutTime", TypeS32, Offset( mFadeOutTime, GuiFadeinBitmapCtrl ),
addFieldV( "fadeOutTime", TypeRangedS32, Offset( mFadeOutTime, GuiFadeinBitmapCtrl ), &CommonValidators::PositiveInt,
"Milliseconds for the bitmap to fade out." );
addField( "fadeInEase", TypeEaseF, Offset( mFadeInEase, GuiFadeinBitmapCtrl ),
"Easing curve for fade-in." );

View file

@ -22,6 +22,7 @@
#include "platform/platform.h"
#include "gui/controls/guiBitmapCtrl.h"
#include "console/typeValidators.h"
#include "console/console.h"
#include "console/consoleTypes.h"
@ -161,8 +162,8 @@ public:
static void initPersistFields()
{
addField("fadeinTime", TypeS32, Offset(fadeinTime, GuiIdleCamFadeBitmapCtrl));
addField("fadeoutTime", TypeS32, Offset(fadeoutTime, GuiIdleCamFadeBitmapCtrl));
addFieldV("fadeinTime", TypeRangedS32, Offset(fadeinTime, GuiIdleCamFadeBitmapCtrl), &CommonValidators::PositiveInt);
addFieldV("fadeoutTime", TypeRangedS32, Offset(fadeoutTime, GuiIdleCamFadeBitmapCtrl), &CommonValidators::PositiveInt);
addField("done", TypeBool, Offset(done, GuiIdleCamFadeBitmapCtrl));
Parent::initPersistFields();
}

View file

@ -22,6 +22,7 @@
#include "platform/platform.h"
#include "gui/game/guiMessageVectorCtrl.h"
#include "console/typeValidators.h"
#include "gui/utility/messageVector.h"
#include "console/consoleTypes.h"
@ -193,11 +194,11 @@ GuiMessageVectorCtrl::~GuiMessageVectorCtrl()
void GuiMessageVectorCtrl::initPersistFields()
{
docsURL;
addField("lineSpacing", TypeS32, Offset(mLineSpacingPixels, GuiMessageVectorCtrl));
addField("lineContinuedIndex", TypeS32, Offset(mLineContinuationIndent, GuiMessageVectorCtrl));
addFieldV("lineSpacing", TypeRangedS32, Offset(mLineSpacingPixels, GuiMessageVectorCtrl), &CommonValidators::PositiveInt);
addFieldV("lineContinuedIndex", TypeRangedS32, Offset(mLineContinuationIndent, GuiMessageVectorCtrl), &CommonValidators::PositiveInt);
addField("allowedMatches", TypeString, Offset(mAllowedMatches, GuiMessageVectorCtrl), 16);
addField("matchColor", TypeColorI, Offset(mSpecialColor, GuiMessageVectorCtrl));
addField("maxColorIndex", TypeS32, Offset(mMaxColorIndex, GuiMessageVectorCtrl));
addFieldV("maxColorIndex", TypeRangedS32, Offset(mMaxColorIndex, GuiMessageVectorCtrl), &CommonValidators::S32_8BitCap);
Parent::initPersistFields();
}

View file

@ -88,7 +88,7 @@ void GuiShaderEditor::initPersistFields()
{
docsURL;
addGroup("Node Settings");
addFieldV("nodeSize", TypeS32, Offset(mNodeSize, GuiShaderEditor),&nodeSizeRange,
addFieldV("nodeSize", TypeRangedS32, Offset(mNodeSize, GuiShaderEditor),&nodeSizeRange,
"Size of nodes.");
endGroup("Node Settings");

View file

@ -26,6 +26,7 @@
#include "sfx/sfxTrack.h"
#include "sfx/sfxSource.h"
#include "sfx/sfxTypes.h"
#include "console/typeValidators.h"
#define TickMs 32
@ -116,7 +117,7 @@ void GuiAudioCtrl::initPersistFields()
{
addGroup("Sounds");
INITPERSISTFIELD_SOUNDASSET(Sound, GuiAudioCtrl, "Looping SoundAsset to play while GuiAudioCtrl is active.");
addField("tickPeriodMS", TypeS32, Offset(mTickPeriodMS, GuiAudioCtrl),
addFieldV("tickPeriodMS", TypeRangedS32, Offset(mTickPeriodMS, GuiAudioCtrl), &CommonValidators::MSTickRange,
"@brief Time in milliseconds between calls to onTick().\n\n"
"@see onTickTrigger()\n");
addField("playIf", TypeCommand, Offset(mPlayIf, GuiAudioCtrl), "evaluation condition to trip playback (true/false)");
@ -127,19 +128,19 @@ void GuiAudioCtrl::initPersistFields()
"The SFXSource to which to assign the sound of this emitter as a child.\n"
"@note This field is ignored if #useTrackDescriptionOnly is true.\n\n"
"@see SFXDescription::sourceGroup");
addField("volume", TypeF32, Offset(mVolume, GuiAudioCtrl),
addFieldV("volume", TypeRangedF32, Offset(mVolume, GuiAudioCtrl), &CommonValidators::PositiveFloat,
"Volume level to apply to the sound.\n"
"@note This field is ignored if #useTrackDescriptionOnly is true.\n\n"
"@see SFXDescription::volume");
addField("pitch", TypeF32, Offset(mPitch, GuiAudioCtrl),
addFieldV("pitch", TypeRangedF32, Offset(mPitch, GuiAudioCtrl), &CommonValidators::PositiveFloat,
"Pitch shift to apply to the sound. Default is 1 = play at normal speed.\n"
"@note This field is ignored if #useTrackDescriptionOnly is true.\n\n"
"@see SFXDescription::pitch");
addField("fadeInTime", TypeF32, Offset(mFadeInTime, GuiAudioCtrl),
addFieldV("fadeInTime", TypeRangedF32, Offset(mFadeInTime, GuiAudioCtrl), &CommonValidators::PositiveFloat,
"Number of seconds to gradually fade in volume from zero when playback starts.\n"
"@note This field is ignored if #useTrackDescriptionOnly is true.\n\n"
"@see SFXDescription::fadeInTime");
addField("fadeOutTime", TypeF32, Offset(mFadeOutTime, GuiAudioCtrl),
addFieldV("fadeOutTime", TypeRangedF32, Offset(mFadeOutTime, GuiAudioCtrl), &CommonValidators::PositiveFloat,
"Number of seconds to gradually fade out volume down to zero when playback is stopped or paused.\n"
"@note This field is ignored if #useTrackDescriptionOnly is true.\n\n"
"@see SFXDescription::fadeOutTime");

View file

@ -37,6 +37,7 @@
#include "scene/sceneManager.h"
#include "scene/sceneRenderState.h"
#include "renderInstance/renderBinManager.h"
#include "console/typeValidators.h"
#include "T3D/Scene.h"
@ -238,7 +239,7 @@ void EditTSCtrl::initPersistFields()
addField("renderMissionArea", TypeBool, Offset(mRenderMissionArea, EditTSCtrl));
addField("missionAreaFillColor", TypeColorI, Offset(mMissionAreaFillColor, EditTSCtrl));
addField("missionAreaFrameColor", TypeColorI, Offset(mMissionAreaFrameColor, EditTSCtrl));
addField("missionAreaHeightAdjust", TypeF32, Offset(mMissionAreaHeightAdjust, EditTSCtrl),
addFieldV("missionAreaHeightAdjust", TypeRangedF32, Offset(mMissionAreaHeightAdjust, EditTSCtrl), &CommonValidators::PositiveFloat,
"How high above and below the terrain to render the mission area bounds." );
endGroup("Mission Area");
@ -246,8 +247,8 @@ void EditTSCtrl::initPersistFields()
addGroup("BorderMovement");
addField("allowBorderMove", TypeBool, Offset(mAllowBorderMove, EditTSCtrl));
addField("borderMovePixelSize", TypeS32, Offset(mMouseMoveBorder, EditTSCtrl));
addField("borderMoveSpeed", TypeF32, Offset(mMouseMoveSpeed, EditTSCtrl));
addFieldV("borderMovePixelSize", TypeRangedS32, Offset(mMouseMoveBorder, EditTSCtrl), &CommonValidators::PositiveInt);
addFieldV("borderMoveSpeed", TypeRangedF32, Offset(mMouseMoveSpeed, EditTSCtrl), &CommonValidators::PositiveFloat);
endGroup("BorderMovement");
@ -255,9 +256,9 @@ void EditTSCtrl::initPersistFields()
addField("consoleFrameColor", TypeColorI, Offset(mConsoleFrameColor, EditTSCtrl));
addField("consoleFillColor", TypeColorI, Offset(mConsoleFillColor, EditTSCtrl));
addField("consoleSphereLevel", TypeS32, Offset(mConsoleSphereLevel, EditTSCtrl));
addField("consoleCircleSegments", TypeS32, Offset(mConsoleCircleSegments, EditTSCtrl));
addField("consoleLineWidth", TypeS32, Offset(mConsoleLineWidth, EditTSCtrl));
addFieldV("consoleSphereLevel", TypeRangedS32, Offset(mConsoleSphereLevel, EditTSCtrl), &CommonValidators::NaturalNumber);
addFieldV("consoleCircleSegments", TypeRangedS32, Offset(mConsoleCircleSegments, EditTSCtrl), &CommonValidators::NaturalNumber);
addFieldV("consoleLineWidth", TypeRangedS32, Offset(mConsoleLineWidth, EditTSCtrl), &CommonValidators::NaturalNumber);
addField("gizmoProfile", TYPEID< GizmoProfile >(), Offset(mGizmoProfile, EditTSCtrl));
endGroup("Misc");