Merge pull request #1927 from aws-lumberyard-dev/GroupToggleSwitch

Created a toggle switch to enable and disable groups through the Edit Context
This commit is contained in:
Chris Galvan
2021-08-02 15:46:45 -05:00
committed by GitHub
8 changed files with 396 additions and 45 deletions
@@ -236,6 +236,17 @@ namespace AZ
*/
ClassBuilder* ClassElement(Crc32 elementIdCrc, const char* description);
/**
* Declare element with attributes that belong to the class SerializeContext::Class, this is a logical structure, you can have one or more GroupElementToggles.
* T must be a boolean variable that will enable and disable each DataElement attached to this structure.
* \param description - Descriptive name of the field that will typically appear in a tooltip.
* \param memberVariable - reference to the member variable so we can bind to serialization data.
*/
template<class T>
ClassBuilder* GroupElementToggle(const char* description, T memberVariable);
/**
* Declare element with an associated UI handler that does not represent a specific class member variable.
* \param uiId - name of a UI handler used to display the element
@@ -515,6 +526,15 @@ namespace AZ
return this;
}
//=========================================================================
// ClassElement
//=========================================================================
template<class T>
inline EditContext::ClassBuilder* EditContext::ClassBuilder::GroupElementToggle(const char* name, T memberVariable)
{
return DataElement(AZ::Edit::ClassElements::Group, memberVariable, name, name, "");
}
//=========================================================================
// UIElement
//=========================================================================