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

Add has_custom_data() to TileData #101488

Merged
merged 1 commit into from
Jan 13, 2025
Merged

Conversation

chocola-mint
Copy link
Contributor

This PR adds the method has_custom_data to TileData, allowing users to check if a data layer exists or not.

Closes godotengine/godot-proposals#11317

Copy link
Member

@AThousandShips AThousandShips left a comment

Choose a reason for hiding this comment

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

I'd approve but I think this should be added as a method to TileSet as well, as: has_custom_data_layer or has_custom_data_layer_by_name

That method would just be:

return custom_data_layers_by_name.has(p_value);

And then have this method call it directly

Copy link
Member

@AThousandShips AThousandShips left a comment

Choose a reason for hiding this comment

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

The naming is something I think the team should also weigh in on, but this is a good change IMO, needs a review from the 2D nodes team but otherwise this looks good!

Copy link
Member

@groud groud left a comment

Choose a reason for hiding this comment

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

LGTM. And I think the naming is good, as it's consistent with get_custom_data_layer_by_name.

@akien-mga akien-mga modified the milestones: 4.x, 4.4 Jan 13, 2025
@akien-mga akien-mga changed the title Add has_custom_data() to TileData Add has_custom_data() to TileData Jan 13, 2025
@akien-mga akien-mga merged commit 232ab3d into godotengine:master Jan 13, 2025
20 checks passed
@akien-mga
Copy link
Member

Thanks!

@chocola-mint chocola-mint deleted the fix-11317 branch January 14, 2025 05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add has_custom_data() to TileData
4 participants