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

@ -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" );