From b77911bdcd4235436011eb1bc3791c79ae13e9a6 Mon Sep 17 00:00:00 2001 From: Areloch Date: Sat, 4 May 2024 09:56:04 -0500 Subject: [PATCH] Exposes the SceneObjectTypeMasks as an enum type, allowing it to be utilized in inspectors. Updated Trigger triggeredBy field to utilize new enum type for editing Updated MaterialDefinition's animFlags field to utilize appropriate enum type for editing Fixed image reference in bitmask inspectorField type to use correct image asset name --- Engine/source/T3D/trigger.cpp | 3 +- Engine/source/console/simObject.cpp | 29 +++++++++++++++++++ Engine/source/console/simObject.h | 3 ++ .../source/gui/editor/guiInspectorTypes.cpp | 4 +-- .../source/materials/materialDefinition.cpp | 10 +++++-- 5 files changed, 43 insertions(+), 6 deletions(-) diff --git a/Engine/source/T3D/trigger.cpp b/Engine/source/T3D/trigger.cpp index 1fa807ce2..0320d6208 100644 --- a/Engine/source/T3D/trigger.cpp +++ b/Engine/source/T3D/trigger.cpp @@ -38,7 +38,6 @@ #include "T3D/physics/physicsBody.h" #include "T3D/physics/physicsCollision.h" - bool Trigger::smRenderTriggers = false; //----------------------------------------------------------------------------- @@ -381,7 +380,7 @@ void Trigger::initPersistFields() addField("TripOnce", TypeBool, Offset(mTripOnce, Trigger),"Do we trigger callacks just the once?"); addField("TripCondition", TypeRealString, Offset(mTripCondition, Trigger),"evaluation condition to trip callbacks (true/false)"); - addField("TrippedBy", TypeS32, Offset(mTrippedBy, Trigger), "typemask filter"); + addField("TrippedBy", TypeGameTypeMasksType, Offset(mTrippedBy, Trigger), "typemask filter"); addProtectedField("enterCommand", TypeCommand, Offset(mEnterCommand, Trigger), &setEnterCmd, &defaultProtectedGetFn, "The command to execute when an object enters this trigger. Object id stored in %%obj. Maximum 1023 characters." ); addProtectedField("leaveCommand", TypeCommand, Offset(mLeaveCommand, Trigger), &setLeaveCmd, &defaultProtectedGetFn, diff --git a/Engine/source/console/simObject.cpp b/Engine/source/console/simObject.cpp index 926827c86..6fe643ab3 100644 --- a/Engine/source/console/simObject.cpp +++ b/Engine/source/console/simObject.cpp @@ -44,6 +44,35 @@ #include "sim/netObject.h" +ImplementBitfieldType(GameTypeMasksType, + "The type of animation effect to apply to this material.\n" + "@ingroup GFX\n\n") +{ SceneObjectTypes::StaticObjectType, "StaticObjectType", "Static Objects.\n" }, +{ SceneObjectTypes::EnvironmentObjectType, "EnvironmentObjectType" , "Objects considered part of the background or environment of a level.\n" }, +{ SceneObjectTypes::TerrainObjectType, "TerrainObjectType" , "Terrain Objects.\n" }, +{ SceneObjectTypes::WaterObjectType, "WaterObjectType", "Water Objects.\n" }, +{ SceneObjectTypes::TriggerObjectType, "TriggerObjectType", "Interactive Trigger Objects.\n" }, +{ SceneObjectTypes::MarkerObjectType, "MarkerObjectType", "Marker Objects, utilized primarily for tooling.\n" }, +{ SceneObjectTypes::GameBaseObjectType, "GameBaseObjectType", "Any Gamebase-based Objects. Objects generally associated to gameplay functionality.\n" }, +{ SceneObjectTypes::ShapeBaseObjectType, "ShapeBaseObjectType", "Any Gamebase-based Objects. Objects generally associated to gameplay functionality.\n" }, +{ SceneObjectTypes::CameraObjectType, "CameraObjectType", "Camera Objects.\n" }, +{ SceneObjectTypes::StaticShapeObjectType, "StaticShapeObjectType", "Static Shape Objects. Distinct from StaticObjectType in that Static Shapes have additional functionality and behaviors.\n" }, +{ SceneObjectTypes::DynamicShapeObjectType, "DynamicShapeObjectType", "Any sort of Dynamic Object.\n" }, +{ SceneObjectTypes::PlayerObjectType, "PlayerObjectType", "Player Objects.\n" }, +{ SceneObjectTypes::ItemObjectType, "ItemObjectType", "Item Objects.\n" }, +{ SceneObjectTypes::VehicleObjectType, "VehicleObjectType", "Any sort of Vehicle Object.\n" }, +{ SceneObjectTypes::VehicleBlockerObjectType, "VehicleBlockerObjectType", "\n" }, +{ SceneObjectTypes::ProjectileObjectType, "ProjectileObjectType", "Projectiles.\n" }, +{ SceneObjectTypes::ExplosionObjectType, "ExplosionObjectType", "Explosion and Effects.\n" }, +{ SceneObjectTypes::CorpseObjectType, "CorpseObjectType", "Corpses of controlled objects.\n" }, +{ SceneObjectTypes::DebrisObjectType, "DebrisObjectType", "Debris or debris-like things such as shell casings.\n" }, +{ SceneObjectTypes::PhysicalZoneObjectType, "PhysicalZoneObjectType", "Physical Zones. Distinct from triggers in that they have physics forces applications.\n" }, +{ SceneObjectTypes::LightObjectType, "LightObjectType", "Lights.\n" }, +{ SceneObjectTypes::PathShapeObjectType, "PathShapeObjectType", "Path-following Objects.\n" }, +{ SceneObjectTypes::TurretObjectType, "TurretObjectType", "Turret Objects.\n" }, + +EndImplementBitfieldType; + IMPLEMENT_CONOBJECT( SimObject ); // See full description in the new CHM manual diff --git a/Engine/source/console/simObject.h b/Engine/source/console/simObject.h index 7588f0aec..563f86e12 100644 --- a/Engine/source/console/simObject.h +++ b/Engine/source/console/simObject.h @@ -40,6 +40,7 @@ #ifndef _TAML_CALLBACKS_H_ #include "persistence/taml/tamlCallbacks.h" #endif +#include "T3D/objectTypes.h" class Stream; class LightManager; @@ -1009,6 +1010,8 @@ public: virtual void reloadReset() { } }; +typedef SceneObjectTypes GameTypeMasksType; +DefineBitfieldType(GameTypeMasksType); /// Smart SimObject pointer. /// diff --git a/Engine/source/gui/editor/guiInspectorTypes.cpp b/Engine/source/gui/editor/guiInspectorTypes.cpp index 39b59d1ea..89477418b 100644 --- a/Engine/source/gui/editor/guiInspectorTypes.cpp +++ b/Engine/source/gui/editor/guiInspectorTypes.cpp @@ -1459,7 +1459,7 @@ void GuiInspectorTypeBitMask32::consoleInit() Parent::consoleInit(); // Set this to be the inspector type for all bitfield console types. - + for( ConsoleBaseType* type = ConsoleBaseType::getListHead(); type != NULL; type = type->getListNext() ) if( type->getTypeInfo() && type->getTypeInfo()->isBitfield() ) type->setInspectorFieldType( "GuiInspectorTypeBitMask32" ); @@ -1583,7 +1583,7 @@ GuiControl* GuiInspectorTypeBitMask32Helper::constructEditControl() mButton->setField( "Command", szBuffer ); mButton->setField( "buttonType", "ToggleButton" ); mButton->setDataField( StringTable->insert("Profile"), NULL, "GuiInspectorButtonProfile" ); - mButton->setBitmap(StringTable->insert("ToolsModule:arrowBtn_image") ); + mButton->setBitmap(StringTable->insert("ToolsModule:arrowBtn_n_image") ); mButton->setStateOn( true ); mButton->setExtent( 16, 16 ); mButton->registerObject(); diff --git a/Engine/source/materials/materialDefinition.cpp b/Engine/source/materials/materialDefinition.cpp index e496d3e61..056d6e001 100644 --- a/Engine/source/materials/materialDefinition.cpp +++ b/Engine/source/materials/materialDefinition.cpp @@ -77,7 +77,13 @@ ImplementBitfieldType(MaterialAnimType, { Material::Rotate, "Rotate" , "Rotate the material around a point.\n" }, { Material::Wave, "Wave" , "Warps the material with an animation using Sin, Triangle or Square mathematics.\n" }, { Material::Scale, "Scale", "Scales the material larger and smaller with a pulsing effect.\n" }, -{ Material::Sequence, "Sequence", "Enables the material to have multiple frames of animation in its imagemap.\n" } +{ Material::Sequence, "Sequence", "Enables the material to have multiple frames of animation in its imagemap.\n" }, +{ Material::Sequence, "SequenceA", "Enables the material to have multiple frames of animation in its imagemap.\n" }, +{ Material::Sequence, "SequenceB", "Enables the material to have multiple frames of animation in its imagemap.\n" }, +{ Material::Sequence, "SequenceC", "Enables the material to have multiple frames of animation in its imagemap.\n" }, +{ Material::Sequence, "SequenceD", "Enables the material to have multiple frames of animation in its imagemap.\n" }, +{ Material::Sequence, "SequenceE", "Enables the material to have multiple frames of animation in its imagemap.\n" }, +{ Material::Sequence, "SequenceF", "Enables the material to have multiple frames of animation in its imagemap.\n" } EndImplementBitfieldType; ImplementEnumType(MaterialBlendOp, @@ -357,7 +363,7 @@ void Material::initPersistFields() endGroup("Lighting Properties"); addGroup("Animation Properties"); - addField("animFlags", TYPEID< AnimType >(), Offset(mAnimFlags, Material), MAX_STAGES, + addField("animFlags", TypeMaterialAnimType, Offset(mAnimFlags, Material), MAX_STAGES, "The types of animation to play on this material."); addField("scrollDir", TypePoint2F, Offset(mScrollDir, Material), MAX_STAGES,