summaryrefslogtreecommitdiff
path: root/editor/plugins
diff options
context:
space:
mode:
authorYuri Sizov <11782833+YuriSizov@users.noreply.github.com>2023-03-13 16:58:31 +0100
committerGitHub <noreply@github.com>2023-03-13 16:58:31 +0100
commit30e81fcc26ee4e9394abe2504c6dd613b06a85db (patch)
tree9f1cfef5f96c0392260646f03addce85f4604772 /editor/plugins
parenteb503fb461f996ae9fb56c0525abed784e9ed8db (diff)
parent857cd853dee0ebd553621ec4c29f16d7ca79085a (diff)
Merge pull request #74866 from YuriSizov/4.0-cherrypicks
Cherry-picks for the 4.0 branch (future 4.0.1) - 1st batch
Diffstat (limited to 'editor/plugins')
-rw-r--r--editor/plugins/tiles/tile_set_atlas_source_editor.cpp2
-rw-r--r--editor/plugins/tiles/tiles_editor_plugin.cpp6
2 files changed, 6 insertions, 2 deletions
diff --git a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp
index fcefbb7d06..235e34d9b5 100644
--- a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp
+++ b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp
@@ -648,7 +648,7 @@ void TileSetAtlasSourceEditor::_update_tile_data_editors() {
if (!tile_data_editors.has("texture_origin")) {
TileDataTextureOriginEditor *tile_data_texture_origin_editor = memnew(TileDataTextureOriginEditor);
tile_data_texture_origin_editor->hide();
- tile_data_texture_origin_editor->setup_property_editor(Variant::VECTOR2, "texture_origin");
+ tile_data_texture_origin_editor->setup_property_editor(Variant::VECTOR2I, "texture_origin");
tile_data_texture_origin_editor->connect("needs_redraw", callable_mp((CanvasItem *)tile_atlas_control_unscaled, &Control::queue_redraw));
tile_data_texture_origin_editor->connect("needs_redraw", callable_mp((CanvasItem *)alternative_tiles_control_unscaled, &Control::queue_redraw));
tile_data_editors["texture_origin"] = tile_data_texture_origin_editor;
diff --git a/editor/plugins/tiles/tiles_editor_plugin.cpp b/editor/plugins/tiles/tiles_editor_plugin.cpp
index 78522dfa73..1682d07e13 100644
--- a/editor/plugins/tiles/tiles_editor_plugin.cpp
+++ b/editor/plugins/tiles/tiles_editor_plugin.cpp
@@ -145,7 +145,10 @@ void TilesEditorPlugin::_tile_map_changed() {
void TilesEditorPlugin::_update_editors() {
// If tile_map is not edited, we change the edited only if we are not editing a tile_set.
- tileset_editor->edit(tile_set);
+ if (tile_set.is_valid()) {
+ tileset_editor->edit(tile_set);
+ }
+
TileMap *tile_map = Object::cast_to<TileMap>(ObjectDB::get_instance(tile_map_id));
if (tile_map) {
tilemap_editor->edit(tile_map);
@@ -158,6 +161,7 @@ void TilesEditorPlugin::_update_editors() {
// Make sure the tile set editor is visible if we have one assigned.
tileset_editor_button->set_visible(is_visible && tile_set.is_valid());
+ tilemap_editor_button->set_visible(is_visible && tile_map);
// Update visibility of bottom panel buttons.
if (tileset_editor_button->is_pressed() && !tile_set.is_valid()) {