diff --git a/Engine/source/console/typeValidators.cpp b/Engine/source/console/typeValidators.cpp index 9d6eb3644..7aa62e5d5 100644 --- a/Engine/source/console/typeValidators.cpp +++ b/Engine/source/console/typeValidators.cpp @@ -105,6 +105,7 @@ namespace CommonValidators FRangeValidator PositiveFloat(0.0f, F32_MAX); FRangeValidator PositiveNonZeroFloat((F32)POINT_EPSILON, F32_MAX); FRangeValidator NormalizedFloat(0.0f, 1.0f); + FRangeValidator F32Percent(0.0f, 100.0f); FRangeValidator F32_8BitPercent(0.0f, 1.0f, BIT(8)); FRangeValidator F32_16BitPercent(0.0f, 1.0f, BIT(16)); @@ -116,6 +117,7 @@ namespace CommonValidators IRangeValidator NegDefaultInt(-1, S32_MAX); IRangeValidator PositiveInt(0, S32_MAX); IRangeValidator NaturalNumber(1, S32_MAX); + IRangeValidator S32Percent(0.0f, 100); //see "T3D/gameBase/processList.h" for TickMs = 32 IRangeValidator MSTickRange(32, S32_MAX); diff --git a/Engine/source/console/typeValidators.h b/Engine/source/console/typeValidators.h index 1b0920bce..e59f3d8e6 100644 --- a/Engine/source/console/typeValidators.h +++ b/Engine/source/console/typeValidators.h @@ -120,6 +120,7 @@ namespace CommonValidators extern FRangeValidator PositiveFloat; extern FRangeValidator PositiveNonZeroFloat; extern FRangeValidator NormalizedFloat; + extern FRangeValidator F32Percent; extern FRangeValidator F32_8BitPercent; extern FRangeValidator F32_16BitPercent; extern FRangeValidator ValidSlopeAngle; @@ -130,6 +131,7 @@ namespace CommonValidators extern IRangeValidator NegDefaultInt; extern IRangeValidator PositiveInt; extern IRangeValidator NaturalNumber; + extern FRangeValidator S32Percent; extern IRangeValidator MSTickRange; extern IRangeValidator S32_8BitCap; extern IRangeValidator S32_16BitCap; diff --git a/Engine/source/gui/controls/guiBitmapBarCtrl.cpp b/Engine/source/gui/controls/guiBitmapBarCtrl.cpp index 1ee2d1a32..edf644204 100644 --- a/Engine/source/gui/controls/guiBitmapBarCtrl.cpp +++ b/Engine/source/gui/controls/guiBitmapBarCtrl.cpp @@ -44,7 +44,7 @@ GuiBitmapBarCtrl::GuiBitmapBarCtrl(void) void GuiBitmapBarCtrl::initPersistFields() { docsURL; - addFieldV("percent", TypeRangedF32, Offset(mPercent, GuiBitmapBarCtrl), &CommonValidators::NormalizedFloat, + addFieldV("percent", TypeRangedF32, Offset(mPercent, GuiBitmapBarCtrl), &CommonValidators::F32Percent, "% shown"); addField("vertical", TypeBool, Offset(mVertical, GuiBitmapBarCtrl), "If true, the bitmap is clipped vertically.");