Implement and expose property hint in TileSet custom data layer#119591
Open
poohcom1 wants to merge 1 commit into
Open
Implement and expose property hint in TileSet custom data layer#119591poohcom1 wants to merge 1 commit into
poohcom1 wants to merge 1 commit into
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem(s) does this PR solve?
This PR implements and exposes
PropertyHintand hint string information for custom data layers in TileSet through scripting, so that developers will be able to have greater control over the editing and validation of custom data, such as specifying enums or resource type. It introduces 4 new methods toTileSet; getters and setters forhintandhint_stringin the same fashion as the existingnameandtypeproperties:Here's an example of how it can be used:
2026-05-19.21-07-59.mp4
In its current state, it is best used in a custom resource class, with the setters called in
_get_property_list()to prevent caching issues.Note that unlike
custom_data_layer_x/nameandcustom_data_layer_x/type, hint and hint string are not listed inget_property_list()since it doesn't need to be serialized for runtime. However, this can be added later if we do implement editor features.Additional information
This is intentionally a barebones implementation; there is no attempt to make a user-friendly editor or scripting API beyond exposing the raw values.
The goal is to expose the feature for advanced users and addon creators, similar to
_validate_property(). If addons are insufficient or if the community wants further UX improvements, further improvements could easily be built on top of this change as editor and/or scripting implementation (I go into a bit more detail in godotengine/godot-proposals#14874).Once this PR is merged, I'll add further documentation as follow-ups to elaborate on how the new APIs should be used, i.e. why it should be called in
_get_property_list()and in a tool script, etc.