From a864bcc773b1024d3405f66c7d81a74508279490 Mon Sep 17 00:00:00 2001 From: Giganzo <158825920+Giganzo@users.noreply.github.com> Date: Sun, 17 Nov 2024 14:10:19 +0100 Subject: [PATCH] Fix button state of grid and highlight layer in tile map layer editor --- editor/plugins/tiles/tile_map_layer_editor.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/editor/plugins/tiles/tile_map_layer_editor.cpp b/editor/plugins/tiles/tile_map_layer_editor.cpp index 16d4ee6f684..713ba4f9e12 100644 --- a/editor/plugins/tiles/tile_map_layer_editor.cpp +++ b/editor/plugins/tiles/tile_map_layer_editor.cpp @@ -3678,6 +3678,11 @@ void TileMapLayerEditor::_node_change(Node *p_node) { void TileMapLayerEditor::_notification(int p_what) { switch (p_what) { + case NOTIFICATION_READY: { + toggle_grid_button->set_pressed_no_signal(EDITOR_GET("editors/tiles_editor/display_grid")); + toggle_highlight_selected_layer_button->set_pressed_no_signal(EDITOR_GET("editors/tiles_editor/highlight_selected_layer")); + } break; + case NOTIFICATION_ENTER_TREE: { get_tree()->connect("node_added", callable_mp(this, &TileMapLayerEditor::_node_change)); get_tree()->connect("node_removed", callable_mp(this, &TileMapLayerEditor::_node_change)); @@ -4487,7 +4492,6 @@ TileMapLayerEditor::TileMapLayerEditor() { toggle_highlight_selected_layer_button = memnew(Button); toggle_highlight_selected_layer_button->set_theme_type_variation("FlatButton"); toggle_highlight_selected_layer_button->set_toggle_mode(true); - toggle_highlight_selected_layer_button->set_pressed(true); toggle_highlight_selected_layer_button->connect(SceneStringName(toggled), callable_mp(this, &TileMapLayerEditor::_highlight_selected_layer_button_toggled)); toggle_highlight_selected_layer_button->set_tooltip_text(TTR("Highlight Selected TileMap Layer")); tile_map_toolbar->add_child(toggle_highlight_selected_layer_button);