You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-10 13:00:37 +00:00
Convert _notification methods to switch - Chunk C
This commit is contained in:
@@ -3359,15 +3359,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();
|
||||
@@ -3375,11 +3376,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()) {
|
||||
@@ -3388,7 +3391,7 @@ void TileMapEditor::_notification(int p_what) {
|
||||
tile_map->set_selected_layer(-1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user