Fix editing custom data for tilesets
This commit is contained in:
parent
27b2ba667c
commit
38305a2ad0
1 changed files with 10 additions and 0 deletions
|
|
@ -6952,6 +6952,16 @@ bool TileData::_get(const StringName &p_name, Variant &r_ret) const {
|
|||
}
|
||||
}
|
||||
#endif // NAVIGATION_2D_DISABLED
|
||||
else if (components.size() == 1 && components[0].begins_with("custom_data_") && components[0].trim_prefix("custom_data_").is_valid_int()) {
|
||||
// Custom data layers.
|
||||
int layer_index = components[0].trim_prefix("custom_data_").to_int();
|
||||
ERR_FAIL_COND_V(layer_index < 0, false);
|
||||
if (layer_index >= custom_data.size()) {
|
||||
return false;
|
||||
}
|
||||
r_ret = get_custom_data_by_layer_id(layer_index);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue