1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-10 13:00:37 +00:00

Merge pull request #58187 from jakobbouchard/notification-switch-chunk-c

Convert _notification methods to switch - Chunk C
This commit is contained in:
Rémi Verschelde
2022-02-16 20:58:55 +01:00
committed by GitHub
37 changed files with 378 additions and 327 deletions

View File

@@ -3374,15 +3374,16 @@ TileMapEditorTerrainsPlugin::~TileMapEditorTerrainsPlugin() {
void TileMapEditor::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_ENTER_TREE:
case NOTIFICATION_THEME_CHANGED:
case NOTIFICATION_THEME_CHANGED: {
missing_tile_texture = get_theme_icon(SNAME("StatusWarning"), SNAME("EditorIcons"));
warning_pattern_texture = get_theme_icon(SNAME("WarningPattern"), SNAME("EditorIcons"));
advanced_menu_button->set_icon(get_theme_icon(SNAME("Tools"), SNAME("EditorIcons")));
toggle_grid_button->set_icon(get_theme_icon(SNAME("Grid"), SNAME("EditorIcons")));
toggle_grid_button->set_pressed(EditorSettings::get_singleton()->get("editors/tiles_editor/display_grid"));
toogle_highlight_selected_layer_button->set_icon(get_theme_icon(SNAME("TileMapHighlightSelected"), SNAME("EditorIcons")));
break;
case NOTIFICATION_INTERNAL_PROCESS:
} break;
case NOTIFICATION_INTERNAL_PROCESS: {
if (is_visible_in_tree() && tileset_changed_needs_update) {
_update_bottom_panel();
_update_layers_selection();
@@ -3390,11 +3391,13 @@ void TileMapEditor::_notification(int p_what) {
CanvasItemEditor::get_singleton()->update_viewport();
tileset_changed_needs_update = false;
}
break;
case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED:
} break;
case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
toggle_grid_button->set_pressed(EditorSettings::get_singleton()->get("editors/tiles_editor/display_grid"));
break;
case NOTIFICATION_VISIBILITY_CHANGED:
} break;
case NOTIFICATION_VISIBILITY_CHANGED: {
TileMap *tile_map = Object::cast_to<TileMap>(ObjectDB::get_instance(tile_map_id));
if (tile_map) {
if (is_visible_in_tree()) {
@@ -3403,7 +3406,7 @@ void TileMapEditor::_notification(int p_what) {
tile_map->set_selected_layer(-1);
}
}
break;
} break;
}
}