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

cute_tiled: overload class with type #363

Merged
merged 1 commit into from
Nov 7, 2023
Merged

Conversation

konsumer
Copy link
Contributor

@konsumer konsumer commented Oct 16, 2023

This is related to #362
Newer versions of Tiled seem to use this the same way as earlier type so this just uses the same struct-field.

This is related to RandyGaul#362 
Newer versions of Tiled seem to use this the same way as earlier `type` so this just uses the same field.
@konsumer konsumer changed the title overload class with type cute_tiled: overload class with type Oct 16, 2023
while (cute_tiled_peak(m) != ',' && cute_tiled_peak(m) != '}') cute_tiled_next(m);
if (cute_tiled_peak(m) == '}') continue;
// This is technically different than type, but it used the same way in newer versions of Tiled
cute_tiled_intern_string(m, &object->type);
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems strange to load class into type. Should we not have a type case that would load type? While the JSON Map Format documents both types as strings, it seems weird to mix the two.

Copy link
Owner

Choose a reason for hiding this comment

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

What better way to represent a class, than as a string? I think I recall entire objects can be stored there, but, for now at least parsing the string is better than nothing.

Copy link
Contributor

@RobLoach RobLoach Oct 16, 2023

Choose a reason for hiding this comment

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

As a string makes sense. I'm more concerned about class being loaded into type.

Objects don't even have a class associated with them, so if anything, the class case should be removed entirely:
https://doc.mapeditor.org/en/stable/reference/json-map-format/#object

Copy link
Contributor Author

@konsumer konsumer Oct 16, 2023

Choose a reason for hiding this comment

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

I added more notes on #362 somehow class is sometimes used instead of type. it's the same data, but in some situations it will name it one or the other, this just puts that same data in type struct-field. This doesn't remove type case which does the same thing.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, that makes sense. Thanks for some of the context 👍..... Since class isn't a property associated with object, seems like this is a fine addition to have.

@RandyGaul RandyGaul merged commit 3a89769 into RandyGaul:master Nov 7, 2023
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