Skip to content

Commit

Permalink
Merge pull request #99357 from Giganzo/tile-map-grid-button
Browse files Browse the repository at this point in the history
Fix button state of grid and highlight layer in tile map layer editor
  • Loading branch information
Repiteo committed Dec 23, 2024
2 parents 98c5267 + a864bcc commit e041356
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion editor/plugins/tiles/tile_map_layer_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -4487,7 +4492,6 @@ TileMapLayerEditor::TileMapLayerEditor() {
toggle_highlight_selected_layer_button = memnew(Button);
toggle_highlight_selected_layer_button->set_theme_type_variation(SceneStringName(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);
Expand Down

0 comments on commit e041356

Please sign in to comment.