Skip to content

Implement and expose property hint in TileSet custom data layer#119591

Open
poohcom1 wants to merge 1 commit into
godotengine:masterfrom
poohcom1:feature/tileset-property-hint
Open

Implement and expose property hint in TileSet custom data layer#119591
poohcom1 wants to merge 1 commit into
godotengine:masterfrom
poohcom1:feature/tileset-property-hint

Conversation

@poohcom1
Copy link
Copy Markdown
Contributor

@poohcom1 poohcom1 commented May 20, 2026

What problem(s) does this PR solve?

This PR implements and exposes PropertyHint and 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 to TileSet; getters and setters for hint and hint_string in the same fashion as the existing name and type properties:

set_custom_data_layer_property_hint(layer_index: int, hint: PropertyHint) -> void
set_custom_data_layer_property_hint_string(layer_index: int, hint_string: String) -> void

get_custom_data_layer_property_hint(layer_index: int) -> PropertyHint
get_custom_data_layer_property_hint_string(layer_index: int) -> String

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/name and custom_data_layer_x/type, hint and hint string are not listed in get_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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

2 participants