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

@ -106,11 +106,11 @@ void afxAnimClipData::initPersistFields()
"The name of an animation sequence to be played by a ShapeBase-derived object to which this effect is "
"constrained. Also works on afxModel effects.\n"
"default: \"\"\n");
addField("rate", TYPEID< F32 >(), myOffset(rate),
addFieldV("rate", TypeRangedF32, myOffset(rate), &CommonValidators::F32Range,
"The desired playback speed for the sequence. A value of 1.0 indicates forward playback at a normal rate. Negative "
"values cause the sequence to play backwards.\n"
"default: 1.0\n");
addField("posOffset", TYPEID< F32 >(), myOffset(pos_offset),
addFieldV("posOffset", TypeRangedF32, myOffset(pos_offset), &CommonValidators::NormalizedFloat,
"Sets a starting offset for the selected animation clip. It directly specifies an animation thread position in the 0.0 to "
"1.0 range as a fraction of the clip's duration.\n"
"default: 1.0\n");

View file

@ -79,13 +79,13 @@ void afxAreaDamageData::initPersistFields()
"An arbitrary string which is passed as an argument to a spell's onDamage() script "
"method. It is used to classify a type of damage such as 'melee', 'magical', or "
"'fire'.");
addField("damage", TypeF32, myOffset(amount),
addFieldV("damage", TypeRangedF32, myOffset(amount), &CommonValidators::F32Range,
"An amount of area damage to inflict on a target. Objects within half the radius "
"receive full damage which then diminishes out to the full distance of the specified "
"radius.");
addField("radius", TypeF32, myOffset(radius),
addFieldV("radius", TypeRangedF32, myOffset(radius), &CommonValidators::PositiveFloat,
"Radius centered at the effect position in which damage will be applied.");
addField("impulse", TypeF32, myOffset(impulse),
addFieldV("impulse", TypeRangedF32, myOffset(impulse), &CommonValidators::F32Range,
"Specifies an amount of force to apply to damaged objects. Objects within half the "
"radius receive full impulse which then diminishes out to the full distance of the "
"specified radius.");

View file

@ -30,6 +30,7 @@
#include "sfx/sfxDescription.h"
#include "afx/ce/afxAudioBank.h"
#include "console/typeValidators.h"
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
@ -133,7 +134,7 @@ void afxAudioBank::initPersistFields()
"SFXDescription datablock to use with this set of sounds.");
addField("preload", TypeBool, Offset(mPreload, afxAudioBank),
"If set to true, file is pre-loaded, otherwise it is loaded on-demand.");
addField("playIndex", TypeS32, Offset(play_index, afxAudioBank),
addFieldV("playIndex", TypeRangedS32, Offset(play_index, afxAudioBank), &CommonValidators::NegDefaultInt,
"An array index that selects a sound to play from the filenames[] field. Values "
"outside of the range of assigned filename[] entries will not play any sound.");

View file

@ -71,9 +71,9 @@ void afxCameraShakeData::initPersistFields()
"The camera shake frequencies for all three axes: X, Y, Z.");
addField("amplitude", TypePoint3F, Offset(camShakeAmp, afxCameraShakeData),
"The camera shake amplitudes for all three axes: X, Y, Z.");
addField("radius", TypeF32, Offset(camShakeRadius, afxCameraShakeData),
addFieldV("radius", TypeRangedF32, Offset(camShakeRadius, afxCameraShakeData), &CommonValidators::PositiveFloat,
"Radius about the effect position in which shaking will be applied.");
addField("falloff", TypeF32, Offset(camShakeFalloff, afxCameraShakeData),
addFieldV("falloff", TypeRangedF32, Offset(camShakeFalloff, afxCameraShakeData), &CommonValidators::PositiveFloat,
"Magnitude by which shaking decreases over distance to radius.");
Parent::initPersistFields();

View file

@ -83,19 +83,19 @@ void afxDamageData::initPersistFields()
"An arbitrary string which is passed as an argument to a spell's onDamage() script "
"method. It is used to classify a type of damage such as 'melee', 'magical', or "
"'fire'.");
addField("directDamage", TypeF32, myOffset(amount),
addFieldV("directDamage", TypeRangedF32, myOffset(amount), &CommonValidators::F32Range,
"An amount of direct damage to inflict on a target.");
addField("directDamageRepeats", TypeS8, myOffset(repeats),
"The number of times to inflict the damage specified by directDamage. Values "
"greater than 1 inflict damage over time, with the amount of directDamage "
"repeatedly dealt at evenly spaced intervals over the lifetime of the effect.");
addField("areaDamage", TypeF32, myOffset(ad_amount),
addFieldV("areaDamage", TypeRangedF32, myOffset(ad_amount), &CommonValidators::F32Range,
"An amount of area damage to inflict on a target. Objects within half the radius "
"receive full damage which then diminishes out to the full distance of "
"areaDamageRadius.");
addField("areaDamageRadius", TypeF32, myOffset(radius),
addFieldV("areaDamageRadius", TypeRangedF32, myOffset(radius), &CommonValidators::PositiveFloat,
"Radius centered at the effect position in which damage will be applied.");
addField("areaDamageImpulse", TypeF32, myOffset(impulse),
addFieldV("areaDamageImpulse", TypeRangedF32, myOffset(impulse), &CommonValidators::F32Range,
"Specifies an amount of force to apply to damaged objects. Objects within half the "
"radius receive full impulse which then diminishes out to the full distance of "
"areaDamageRadius.");

View file

@ -104,11 +104,11 @@ void afxT3DLightBaseData::initPersistFields()
"Enables/Disables the object rendering and functionality in the scene.");
addField( "color", TypeColorF, Offset( mColor, afxT3DLightBaseData ),
"Changes the base color hue of the light.");
addField( "brightness", TypeF32, Offset( mBrightness, afxT3DLightBaseData ),
addFieldV( "brightness", TypeRangedF32, Offset( mBrightness, afxT3DLightBaseData ), &CommonValidators::PositiveFloat,
"Adjusts the lights power, 0 being off completely.");
addField( "castShadows", TypeBool, Offset( mCastShadows, afxT3DLightBaseData ),
"Enables/disables shadow casts by this light.");
addField( "priority", TypeF32, Offset( mPriority, afxT3DLightBaseData ),
addFieldV( "priority", TypeRangedF32, Offset( mPriority, afxT3DLightBaseData ), &CommonValidators::PositiveFloat,
"Used for sorting of lights by the light manager. Priority determines if a light "
"has a stronger effect than, those with a lower value");
addField( "localRenderViz", TypeBool, Offset( mLocalRenderViz, afxT3DLightBaseData ),
@ -123,9 +123,9 @@ void afxT3DLightBaseData::initPersistFields()
"Toggles animation for the light on and off");
addField( "animationType", TYPEID<LightAnimData>(), Offset( mAnimationData, afxT3DLightBaseData ),
"Datablock containing light animation information (LightAnimData)");
addField( "animationPeriod", TypeF32, Offset( mAnimState.animationPeriod, afxT3DLightBaseData ),
addFieldV( "animationPeriod", TypeRangedF32, Offset( mAnimState.animationPeriod, afxT3DLightBaseData ), &CommonValidators::PositiveFloat,
"The length of time in seconds for a single playback of the light animation");
addField( "animationPhase", TypeF32, Offset( mAnimState.animationPhase, afxT3DLightBaseData ),
addFieldV( "animationPhase", TypeRangedF32, Offset( mAnimState.animationPhase, afxT3DLightBaseData ), &CommonValidators::PositiveFloat,
"The phase used to offset the animation start time to vary the animation of "
"nearby lights.");
@ -135,7 +135,7 @@ void afxT3DLightBaseData::initPersistFields()
addField( "flareType", TYPEID<LightFlareData>(), Offset( mFlareData, afxT3DLightBaseData ),
"Datablock containing light flare information (LightFlareData)");
addField( "flareScale", TypeF32, Offset( mFlareScale, afxT3DLightBaseData ),
addFieldV( "flareScale", TypeRangedF32, Offset( mFlareScale, afxT3DLightBaseData ), &CommonValidators::PositiveFloat,
"Globally scales all features of the light flare");
endGroup( "Misc" );

View file

@ -31,6 +31,7 @@
#include "T3D/projectile.h"
#include "afx/ce/afxMachineGun.h"
#include "console/typeValidators.h"
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
// afxMachineGunData
@ -68,7 +69,7 @@ void afxMachineGunData::initPersistFields()
docsURL;
addField("projectile", TYPEID<ProjectileData>(), myOffset(projectile_data),
"A ProjectileData datablock describing the projectile to be launched.");
addField("roundsPerMinute", TypeS32, myOffset(rounds_per_minute),
addFieldV("roundsPerMinute", TypeRangedS32, myOffset(rounds_per_minute), &CommonValidators::PositiveInt,
"Specifies the number of projectiles fired over a minute of time. A value of 1200 "
"will create 20 projectiles per second.\n"
"Sample values for real machine guns:\n"

View file

@ -180,18 +180,18 @@ void afxModelData::initPersistFields()
addGroup("Animation");
addField("sequence", TypeString, myOffset(sequence),
"The name of an animation sequence to play in the model.");
addField("sequenceRate", TypeF32, myOffset(seq_rate),
addFieldV("sequenceRate", TypeRangedF32, myOffset(seq_rate), &CommonValidators::F32Range,
"The rate of playback for the sequence.");
addField("sequenceOffset", TypeF32, myOffset(seq_offset),
addFieldV("sequenceOffset", TypeRangedF32, myOffset(seq_offset), &CommonValidators::F32Range,
"An offset in seconds indicating a starting point for the animation sequence "
"specified by the sequence field. A rate of 1.0 (rather than sequenceRate) is used "
"to convert from seconds to the thread offset.");
endGroup("Animation");
addGroup("Rendering");
addField("alphaMult", TypeF32, myOffset(alpha_mult),
addFieldV("alphaMult", TypeRangedF32, myOffset(alpha_mult), &CommonValidators::PositiveFloat,
"An alpha multiplier used to set maximum opacity of the model.");
addField("fogMult", TypeF32, myOffset(fog_mult), "");
addFieldV("fogMult", TypeRangedF32, myOffset(fog_mult), &CommonValidators::PositiveFloat, "");
addField("remapTextureTags", TypeString, myOffset(remap_txr_tags),
"Rename one or more texture tags in the model. Texture tags are what link a "
"model's textures to materials.\n"

View file

@ -292,9 +292,9 @@ afxParticleEmitterConeData::afxParticleEmitterConeData(const afxParticleEmitterC
void afxParticleEmitterConeData::initPersistFields()
{
docsURL;
addField("spreadMin", TypeF32, Offset(spread_min, afxParticleEmitterConeData),
addFieldV("spreadMin", TypeRangedF32, Offset(spread_min, afxParticleEmitterConeData), &CommonValidators::PosDegreeRangeHalf,
"...");
addField("spreadMax", TypeF32, Offset(spread_max, afxParticleEmitterConeData),
addFieldV("spreadMax", TypeRangedF32, Offset(spread_max, afxParticleEmitterConeData), &CommonValidators::PosDegreeRangeHalf,
"...");
Parent::initPersistFields();
@ -416,7 +416,7 @@ void afxParticleEmitterPathData::initPersistFields()
"...");
addField("groundConformInteriors", TypeBool, Offset(ground_conform_interiors, afxParticleEmitterPathData),
"...");
addField("groundConformHeight", TypeF32, Offset(ground_conform_height, afxParticleEmitterPathData),
addFieldV("groundConformHeight", TypeRangedF32, Offset(ground_conform_height, afxParticleEmitterPathData), &CommonValidators::PositiveFloat,
"...");
Parent::initPersistFields();
@ -647,9 +647,9 @@ afxParticleEmitterDiscData::afxParticleEmitterDiscData(const afxParticleEmitterD
void afxParticleEmitterDiscData::initPersistFields()
{
docsURL;
addField("radiusMin", TypeF32, Offset(pe_radius_min, afxParticleEmitterDiscData),
addFieldV("radiusMin", TypeRangedF32, Offset(pe_radius_min, afxParticleEmitterDiscData), &CommonValidators::PositiveFloat,
"...");
addField("radiusMax", TypeF32, Offset(pe_radius_max, afxParticleEmitterDiscData),
addFieldV("radiusMax", TypeRangedF32, Offset(pe_radius_max, afxParticleEmitterDiscData), &CommonValidators::PositiveFloat,
"...");
Parent::initPersistFields();

View file

@ -140,11 +140,11 @@ EndImplementEnumType;
void afxPhraseEffectData::initPersistFields()
{
docsURL;
addField("duration", TypeF32, myOffset(duration),
addFieldV("duration", TypeRangedF32, myOffset(duration), &CommonValidators::NegDefaultF32,
"Specifies a duration for the phrase-effect. If set to infinity, the phrase-effect "
"needs to have a phraseType of continuous. Set infinite duration using "
"$AFX::INFINITE_TIME.");
addField("numLoops", TypeS32, myOffset(n_loops),
addFieldV("numLoops", TypeRangedS32, myOffset(n_loops), &CommonValidators::NegDefaultInt,
"Specifies the number of times the phrase-effect should loop. If set to infinity, "
"the phrase-effect needs to have a phraseType of continuous. Set infinite looping "
"using $AFX::INFINITE_REPEATS.");

View file

@ -73,13 +73,15 @@ afxPhysicalZoneData::afxPhysicalZoneData(const afxPhysicalZoneData& other, bool
#define myOffset(field) Offset(field, afxPhysicalZoneData)
FRangeValidator afxVelocityModRange(-40.0f, 40.0f);
FRangeValidator afxGravityModRange(-40.0f, 40.0f);
void afxPhysicalZoneData::initPersistFields()
{
docsURL;
addField("velocityMod", TypeF32, myOffset(mVelocityMod),
addFieldV("velocityMod", TypeRangedF32, myOffset(mVelocityMod), &afxVelocityModRange,
"A multiplier that biases the velocity of an object every tick it is within the "
"zone.");
addField("gravityMod", TypeF32, myOffset(mGravityMod),
addFieldV("gravityMod", TypeRangedF32, myOffset(mGravityMod), &afxGravityModRange,
"A multiplier that biases the influence of gravity on objects within the zone.");
addField("appliedForce", TypePoint3F, myOffset(mAppliedForce),
"A three-valued vector representing a directional force applied to objects withing "

View file

@ -81,7 +81,7 @@ EndImplementEnumType;
void afxPlayerMovementData::initPersistFields()
{
docsURL;
addField("speedBias", TypeF32, myOffset(speed_bias),
addFieldV("speedBias", TypeRangedF32, myOffset(speed_bias), &CommonValidators::F32Range,
"A floating-point multiplier that scales the constraint Player's movement speed.");
addField("movement", TypePoint3F, myOffset(movement),
"");

View file

@ -65,7 +65,7 @@ void afxT3DPointLightData::initPersistFields()
docsURL;
addGroup( "Light" );
addField( "radius", TypeF32, Offset( mRadius, afxT3DPointLightData ),
addFieldV( "radius", TypeRangedF32, Offset( mRadius, afxT3DPointLightData ), &CommonValidators::PositiveFloat,
"Controls the falloff of the light emission");
endGroup( "Light" );

View file

@ -69,11 +69,11 @@ void afxT3DSpotLightData::initPersistFields()
docsURL;
addGroup( "Light" );
addField( "range", TypeF32, Offset( mRange, afxT3DSpotLightData ),
addFieldV( "range", TypeRangedF32, Offset( mRange, afxT3DSpotLightData ), &CommonValidators::PositiveFloat,
"...");
addField( "innerAngle", TypeF32, Offset( mInnerConeAngle, afxT3DSpotLightData ),
addFieldV( "innerAngle", TypeRangedF32, Offset( mInnerConeAngle, afxT3DSpotLightData ), &CommonValidators::DegreeRangeQuarter,
"...");
addField( "outerAngle", TypeF32, Offset( mOuterConeAngle, afxT3DSpotLightData ),
addFieldV( "outerAngle", TypeRangedF32, Offset( mOuterConeAngle, afxT3DSpotLightData ), &CommonValidators::DegreeRangeQuarter,
"...");
endGroup( "Light" );

View file

@ -158,7 +158,7 @@ void afxZodiacData::initPersistFields()
{
docsURL;
INITPERSISTFIELD_IMAGEASSET(Texture, afxZodiacData, "An image to use as the zodiac's texture.");
addField("radius", TypeF32, Offset(radius_xy, afxZodiacData),
addFieldV("radius", TypeRangedF32, Offset(radius_xy, afxZodiacData), &CommonValidators::PositiveFloat,
"The zodiac's radius in scene units.");
addField("verticalRange", TypePoint2F, Offset(vert_range, afxZodiacData),
"For interior zodiacs only, verticalRange specifies distances above and below the "
@ -167,18 +167,18 @@ void afxZodiacData::initPersistFields()
"Specifies if the zodiac's verticalRange should scale according to changes in the "
"radius. When a zodiacs is used as an expanding shockwave, this value should be set "
"to false, otherwise the zodiac can expand to cover an entire interior.");
addField("startAngle", TypeF32, Offset(start_ang, afxZodiacData),
addFieldV("startAngle", TypeRangedF32, Offset(start_ang, afxZodiacData), &CommonValidators::DegreeRange,
"The starting angle in degrees of the zodiac's rotation.");
addField("rotationRate", TypeF32, Offset(ang_per_sec, afxZodiacData),
addFieldV("rotationRate", TypeRangedF32, Offset(ang_per_sec, afxZodiacData), &CommonValidators::DegreeRange,
"The rate of rotation in degrees-per-second. Zodiacs with a positive rotationRate "
"rotate clockwise, while those with negative values turn counter-clockwise.");
addField("growInTime", TypeF32, Offset(grow_in_time, afxZodiacData),
addFieldV("growInTime", TypeRangedF32, Offset(grow_in_time, afxZodiacData), &CommonValidators::PositiveFloat,
"A duration of time in seconds over which the zodiac grows from a zero size to its "
"full size as specified by the radius.");
addField("shrinkOutTime", TypeF32, Offset(shrink_out_time, afxZodiacData),
addFieldV("shrinkOutTime", TypeRangedF32, Offset(shrink_out_time, afxZodiacData), &CommonValidators::PositiveFloat,
"A duration of time in seconds over which the zodiac shrinks from full size to "
"invisible.");
addField("growthRate", TypeF32, Offset(growth_rate, afxZodiacData),
addFieldV("growthRate", TypeRangedF32, Offset(growth_rate, afxZodiacData), &CommonValidators::F32Range,
"A rate in meters-per-second at which the zodiac grows in size. A negative value will "
"shrink the zodiac.");
addField("color", TypeColorF, Offset(color, afxZodiacData),
@ -215,20 +215,20 @@ void afxZodiacData::initPersistFields()
addField("interiorIgnoreTransparent", TypeBool, Offset(interior_transp_ignore, afxZodiacData),
"");
addField("altitudeMax", TypeF32, Offset(altitude_max, afxZodiacData),
addFieldV("altitudeMax", TypeRangedF32, Offset(altitude_max, afxZodiacData), &CommonValidators::F32Range,
"The altitude at which zodiac becomes invisible as the result of fading out or "
"becoming too small.");
addField("altitudeFalloff", TypeF32, Offset(altitude_falloff, afxZodiacData),
addFieldV("altitudeFalloff", TypeRangedF32, Offset(altitude_falloff, afxZodiacData), &CommonValidators::F32Range,
"The altitude at which zodiac begins to fade and/or shrink.");
addField("altitudeShrinks", TypeBool, Offset(altitude_shrinks, afxZodiacData),
"When true, zodiac becomes smaller as altitude increases.");
addField("altitudeFades", TypeBool, Offset(altitude_fades, afxZodiacData),
"When true, zodiac fades out as altitude increases.");
addField("distanceMax", TypeF32, Offset(distance_max, afxZodiacData),
addFieldV("distanceMax", TypeRangedF32, Offset(distance_max, afxZodiacData), &CommonValidators::PositiveFloat,
"The distance from camera at which the zodiac becomes invisible as the result of "
"fading out.");
addField("distanceFalloff", TypeF32, Offset(distance_falloff, afxZodiacData),
addFieldV("distanceFalloff", TypeRangedF32, Offset(distance_falloff, afxZodiacData), &CommonValidators::PositiveFloat,
"The distance from camera at which the zodiac begins to fade out.");
addField("useGradientRange", TypeBool, Offset(use_grade_range, afxZodiacData),

View file

@ -114,20 +114,20 @@ void afxZodiacPlaneData::initPersistFields()
docsURL;
INITPERSISTFIELD_IMAGEASSET(Texture, afxZodiacPlaneData, "An image to use as the zodiac's texture.");
addField("radius", TypeF32, myOffset(radius_xy),
addFieldV("radius", TypeRangedF32, myOffset(radius_xy), &CommonValidators::PositiveFloat,
"The zodiac's radius in scene units.");
addField("startAngle", TypeF32, myOffset(start_ang),
addFieldV("startAngle", TypeRangedF32, myOffset(start_ang), &CommonValidators::DegreeRange,
"The starting angle in degrees of the zodiac's rotation.");
addField("rotationRate", TypeF32, myOffset(ang_per_sec),
addFieldV("rotationRate", TypeRangedF32, myOffset(ang_per_sec), &CommonValidators::DegreeRange,
"The rate of rotation in degrees-per-second. Zodiacs with a positive rotationRate "
"rotate clockwise, while those with negative values turn counter-clockwise.");
addField("growInTime", TypeF32, myOffset(grow_in_time),
addFieldV("growInTime", TypeRangedF32, myOffset(grow_in_time), &CommonValidators::PositiveFloat,
"A duration of time in seconds over which the zodiac grows from a zero size to its "
"full size as specified by the radius.");
addField("shrinkOutTime", TypeF32, myOffset(shrink_out_time),
addFieldV("shrinkOutTime", TypeRangedF32, myOffset(shrink_out_time), &CommonValidators::PositiveFloat,
"A duration of time in seconds over which the zodiac shrinks from full size to "
"invisible.");
addField("growthRate", TypeF32, myOffset(growth_rate),
addFieldV("growthRate", TypeRangedF32, myOffset(growth_rate), &CommonValidators::F32Range,
"A rate in meters-per-second at which the zodiac grows in size. A negative value will "
"shrink the zodiac.");
addField("color", TypeColorF, myOffset(color),