Skip to content

Adds a new FieldDescriptor struct#1727

Open
marauder2k7 wants to merge 3 commits into
TorqueGameEngines:developmentfrom
marauder2k9-torque:AddField-ControlStruct-AddVisibility-control
Open

Adds a new FieldDescriptor struct#1727
marauder2k7 wants to merge 3 commits into
TorqueGameEngines:developmentfrom
marauder2k9-torque:AddField-ControlStruct-AddVisibility-control

Conversation

@marauder2k7
Copy link
Copy Markdown
Contributor

@marauder2k7 marauder2k7 commented May 3, 2026

Use the field descriptor struct to add fields instead of the overloads Adds a visibility function to control whether a field is visible in the inspector

EG:

ADD_FIELD("soundFile", TypeAssetLooseFilePath, Offset(mSoundFile, SoundAsset))
            .doc("Path to the sound file.")
            .elements(SFXPlayList::SFXPlaylistSettings::NUM_SLOTS)
            .visibility(&_visibleFunction)
            .onSet(&_setSoundFile);

the grammar can change to make these easier to work with, review changes carefully.

This PR is ready and includes a visibility toggle for the inspector, this should make things cleaner for the inspector of certain classes that include arrays of entries, shouldnt allow setting value 22 if value 1 has nothing in it for example.

@marauder2k7 marauder2k7 marked this pull request as draft May 4, 2026 13:54
Use the field descriptor struct to add fields instead of the overloads
Adds a visibility function to control whether a field is visible in the inspector

EG:
ADD_FIELD("soundFile", TypeAssetLooseFilePath, Offset(mSoundFile, SoundAsset))
            .doc("Path to the sound file.")
            .elements(SFXPlayList::SFXPlaylistSettings::NUM_SLOTS)
            .onSet(&_setSoundFile);

the grammar can change to make these easier to work with, review changes carefully
Convert sound asset to use the new field constructors
Also add a simple example of the visibility control.
If we define an array field have every other field inside that array declared inherit its element count. Can be override with a .elements(N) if N is > 1.
@marauder2k7 marauder2k7 force-pushed the AddField-ControlStruct-AddVisibility-control branch from 6829ac2 to 7155801 Compare May 11, 2026 21:51
@marauder2k7 marauder2k7 marked this pull request as ready for review May 19, 2026 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant