From 3d2a923a308ace2bb1060491416918ced22d61f9 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Wed, 2 Apr 2025 15:33:39 -0500 Subject: [PATCH 1/2] add 0-100 percent ranges F32 and S32 apply to guibitmapbarctrl --- Engine/source/console/typeValidators.cpp | 2 ++ Engine/source/console/typeValidators.h | 2 ++ Engine/source/gui/controls/guiBitmapBarCtrl.cpp | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) 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."); From 664e9db571791fd079554df222950b84823d4f03 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Wed, 2 Apr 2025 15:44:49 -0500 Subject: [PATCH 2/2] fix S32Percent type-o --- Engine/source/console/typeValidators.cpp | 2 +- Engine/source/console/typeValidators.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Engine/source/console/typeValidators.cpp b/Engine/source/console/typeValidators.cpp index 7aa62e5d5..c5178a547 100644 --- a/Engine/source/console/typeValidators.cpp +++ b/Engine/source/console/typeValidators.cpp @@ -117,7 +117,7 @@ namespace CommonValidators IRangeValidator NegDefaultInt(-1, S32_MAX); IRangeValidator PositiveInt(0, S32_MAX); IRangeValidator NaturalNumber(1, S32_MAX); - IRangeValidator S32Percent(0.0f, 100); + IRangeValidator S32Percent(0, 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 e59f3d8e6..76d142692 100644 --- a/Engine/source/console/typeValidators.h +++ b/Engine/source/console/typeValidators.h @@ -131,7 +131,7 @@ namespace CommonValidators extern IRangeValidator NegDefaultInt; extern IRangeValidator PositiveInt; extern IRangeValidator NaturalNumber; - extern FRangeValidator S32Percent; + extern IRangeValidator S32Percent; extern IRangeValidator MSTickRange; extern IRangeValidator S32_8BitCap; extern IRangeValidator S32_16BitCap;