Skip to content
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

Support for class properties #282

Closed
wants to merge 3 commits into from
Closed

Conversation

Deukhoofd
Copy link
Contributor

Adds support for the new class properties introduced in Tiled 1.8, as described here.

I had to write some slightly hacky code to work around the fact that its child tag is optional, which would break the parser when it tried to parse it anyway.

The new property value ClassValue differs from the other PropertyValues in that its a struct enum variant, instead of a tuple one. I did this due to the additional property type that is included in it. Having it as a struct variant feels cleaner to me than having it as a two element tuple.

@aleokdev
Copy link
Contributor

Thanks for the PR! I'll look at this on PC whenever I have time

aleokdev
aleokdev previously approved these changes Feb 19, 2024
Copy link
Contributor

@aleokdev aleokdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me, I'll let @bjorn also take a look at it

assets/tiled_class_property.tmx Outdated Show resolved Hide resolved
Copy link
Member

@bjorn bjorn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me too! I had just one suggestion.

src/properties.rs Outdated Show resolved Hide resolved
assets/tiled_class_property.tmx Outdated Show resolved Hide resolved
- Open and save the test map so we know for certain it's in line with Tiled output
- If we can't find a property type on a class property, default to an empty string instead of "class"
bjorn
bjorn previously approved these changes Feb 21, 2024
@aleokdev
Copy link
Contributor

Only thing missing are the changes in the CHANGELOG.md file, after that it's good to go! Thanks!

bjorn
bjorn previously approved these changes Feb 21, 2024
@aleokdev
Copy link
Contributor

I forgot this is a breaking change (adds new variant to PropertyValue), so it should be based against next, not current, sorry!

@bjorn bjorn changed the base branch from current to next February 26, 2024 07:33
@bjorn bjorn dismissed their stale review February 26, 2024 07:33

The base branch was changed.

@bjorn bjorn changed the base branch from next to current February 26, 2024 07:33
@bjorn
Copy link
Member

bjorn commented Feb 26, 2024

@Deukhoofd I've tried to change the base branch of the PR, but it's a bit tricky, since you've created it directly from your current branch. Unfortunately, it is not possible to change the source branch of a PR, so either you'd need to temporary point your current to next or we need a new PR.

Or we could just use this PR to update the next branch with the other changes on current... though that's a bit messy.

@aleokdev
Copy link
Contributor

Couldn't these changes be rebased on next?

@Deukhoofd Deukhoofd changed the base branch from current to next February 26, 2024 08:44
@Deukhoofd Deukhoofd changed the base branch from next to current February 26, 2024 08:45
@Deukhoofd Deukhoofd closed this Feb 26, 2024
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.

3 participants