mirror of
https://github.com/godotengine/godot.git
synced 2024-11-11 06:33:10 +00:00
Merge pull request #53522 from groud/read_only_tile_layout
This commit is contained in:
commit
3d05b94212
@ -72,6 +72,7 @@ void TileSet::set_tile_shape(TileSet::TileShape p_shape) {
|
||||
|
||||
terrain_bits_meshes_dirty = true;
|
||||
tile_meshes_dirty = true;
|
||||
notify_property_list_changed();
|
||||
emit_changed();
|
||||
}
|
||||
TileSet::TileShape TileSet::get_tile_shape() const {
|
||||
@ -2685,6 +2686,14 @@ void TileSet::_get_property_list(List<PropertyInfo> *p_list) const {
|
||||
p_list->push_back(PropertyInfo(Variant::ARRAY, "tile_proxies/alternative_level", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR));
|
||||
}
|
||||
|
||||
void TileSet::_validate_property(PropertyInfo &property) const {
|
||||
if (property.name == "tile_layout" && tile_shape == TILE_SHAPE_SQUARE) {
|
||||
property.usage ^= PROPERTY_USAGE_READ_ONLY;
|
||||
} else if (property.name == "tile_offset_axis" && tile_shape == TILE_SHAPE_SQUARE) {
|
||||
property.usage ^= PROPERTY_USAGE_READ_ONLY;
|
||||
}
|
||||
}
|
||||
|
||||
void TileSet::_bind_methods() {
|
||||
// Sources management.
|
||||
ClassDB::bind_method(D_METHOD("get_next_source_id"), &TileSet::get_next_source_id);
|
||||
|
@ -180,6 +180,7 @@ protected:
|
||||
bool _set(const StringName &p_name, const Variant &p_value);
|
||||
bool _get(const StringName &p_name, Variant &r_ret) const;
|
||||
void _get_property_list(List<PropertyInfo> *p_list) const;
|
||||
virtual void _validate_property(PropertyInfo &property) const override;
|
||||
|
||||
private:
|
||||
// --- TileSet data ---
|
||||
|
Loading…
Reference in New Issue
Block a user