Add scripting for custom property types by dogboydog · Pull Request #3971 · mapeditor/tiled (original) (raw)
…ypes.all instead) and add getter for class property members. getting members of class types does not work though
…s a list of types and move the utility methods for custom types to tiled.project
This way, the type is kept alive by the ScriptPropertyType, which avoids crashes when accessing roaming pointers. Also, since it now has a non-const reference we can make the properties writable.
…low removing members from a class
Like this it could be somewhat useful, since now the value is typed correctly.
With two overloads, one for raw integer values and one for PropertyValue, for convenience. The latter raises an error if it's not of the right type.
static_cast can be used to access the subclasses instead of storing more specifically typed shared pointers.
dogboydog marked this pull request as ready for review
…tence of member setMember, removeMember
Also, convert EditableMapObject* values to ObjectRef when setting class members. I haven't done this when getting the members, because in that case the ObjectRef anyway can't be converted to a EditableMapObject* because there is no context for looking up the object.
1.11.x has been branched so next release from master will be 1.12.
- Fixed some inaccuracies.
- Fixed some links.
- Updated signature for ClassPropertyType.setMember.
- Made EnumPropertyType.nameOf example slightly more generic by relying on PropertyValue.typeName.
bjorn mentioned this pull request
dogboydog deleted the 3419_scripting_custom_types branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})