-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for 'class' type property in TMX files #7438
Conversation
There's already an open PR for that: #7007 |
I think your linked PR is not related to this issue. Your linked PR is for the general object type in Tiled. One object can have one type. The "type" got changed to "class" at some point but I think that was reverted or can be changed in Tiled how you want to store it. This PR however is related to object properties of type class. An object in Tiled can have multiple properties and one of the types is "class" which itself can reference other class properties. So, imo, those two things are different and the separate PRs make sense. |
Oh yeah my bad! PR seems good in that case 👍 |
So I finally did some digging into this class property thing as I've never used it. I was pretty confused at first. Since I couldn't figure out why none of my map exports contained any values. Until I found out that the only values altered from the default in the class were exported. There is an option to export the custom class structure into an xml or json. We could parse this to get that info, I guess. But I'm not sure if we are asking too much of the user. Since we don't even have a test ready for this I believe this should be shelved for now and I will put it towards the back of the Tiled Cleanup list until we have some more time to look at it. |
I personally would highly appreciate it because I have a custom loader right now just for this. Would be good if it works out of the box. I try to find some time in the next two weeks to enhance this PR. Regarding your comments:
|
These are all great points. I'm just the wrong person to look at this since I was unsure of the use cases for this and did not want to make any assumptions. My use of tiledmaps may be a bit less complex than others. But I fully support adding every feature we can get in here. So feel free to have a go at it. 👍 |
Solves #7432
Adds a new condition in
BaseTmxMapLoader.loadProperties()
to check if the type of a property is 'class' and loads the property appropriately.This isn't to be confused with the type/class of an object, for which there is already support for. Tiled allows specific properties of an object to be typed by a class, not just the object itself.
Tests are missing.