@@ -1045,6 +1045,13 @@ void TileSetAtlasSourceEditor::_update_toolbar() {
10451045 }
10461046}
10471047
1048+ void TileSetAtlasSourceEditor::_update_buttons () {
1049+ tool_paint_button->set_disabled (read_only);
1050+ tool_paint_button->set_tooltip_text (read_only ? TTR (" TileSet is in read-only mode. Make the resource unique to edit TileSet properties." ) : TTR (" Paint properties." ));
1051+ tools_settings_erase_button->set_disabled (read_only);
1052+ tool_advanced_menu_button->set_disabled (read_only);
1053+ }
1054+
10481055void TileSetAtlasSourceEditor::_tile_atlas_control_mouse_exited () {
10491056 hovered_base_tile_coords = TileSetSource::INVALID_ATLAS_COORDS;
10501057 tile_atlas_control->queue_redraw ();
@@ -2212,10 +2219,7 @@ void TileSetAtlasSourceEditor::edit(Ref<TileSet> p_tile_set, TileSetAtlasSource
22122219 tool_setup_atlas_source_button->set_pressed (true );
22132220 }
22142221
2215- // Disable buttons in read-only mode.
2216- tool_paint_button->set_disabled (read_only);
2217- tools_settings_erase_button->set_disabled (read_only);
2218- tool_advanced_menu_button->set_disabled (read_only);
2222+ _update_buttons ();
22192223
22202224 // Update everything.
22212225 _update_source_inspector ();
@@ -2458,10 +2462,7 @@ void TileSetAtlasSourceEditor::_notification(int p_what) {
24582462 read_only = EditorNode::get_singleton ()->is_resource_read_only (tile_set);
24592463 }
24602464
2461- // Disable buttons in read-only mode.
2462- tool_paint_button->set_disabled (read_only);
2463- tools_settings_erase_button->set_disabled (read_only);
2464- tool_advanced_menu_button->set_disabled (read_only);
2465+ _update_buttons ();
24652466
24662467 // Update everything.
24672468 _update_source_inspector ();
@@ -2545,7 +2546,6 @@ TileSetAtlasSourceEditor::TileSetAtlasSourceEditor() {
25452546 tool_paint_button->set_theme_type_variation (" FlatButton" );
25462547 tool_paint_button->set_toggle_mode (true );
25472548 tool_paint_button->set_button_group (tools_button_group);
2548- tool_paint_button->set_tooltip_text (TTR (" Paint properties." ));
25492549 toolbox->add_child (tool_paint_button);
25502550
25512551 // Tile inspector.
@@ -2647,6 +2647,7 @@ TileSetAtlasSourceEditor::TileSetAtlasSourceEditor() {
26472647 tool_settings->add_child (outside_tiles_warning);
26482648
26492649 _update_toolbar ();
2650+ _update_buttons ();
26502651
26512652 // Right side of toolbar.
26522653 Control *middle_space = memnew (Control);
0 commit comments