summaryrefslogtreecommitdiff
path: root/modules/gridmap
diff options
context:
space:
mode:
authorJakob Bouchard <24767889+jakobbouchard@users.noreply.github.com>2022-02-16 09:17:55 -0500
committerJakob Bouchard <24767889+jakobbouchard@users.noreply.github.com>2022-02-16 13:03:05 -0500
commit6553f5c242865f9aadbe2fdab6db6876c44ac472 (patch)
treedbd6922a056a26a57fe0b62551bbfabed512fd99 /modules/gridmap
parent98b97d34df7f3ab2cafc3847358c231c3d357b40 (diff)
Convert _notification methods to switch - Chunk C
Diffstat (limited to 'modules/gridmap')
-rw-r--r--modules/gridmap/grid_map.cpp5
-rw-r--r--modules/gridmap/grid_map_editor_plugin.cpp20
2 files changed, 14 insertions, 11 deletions
diff --git a/modules/gridmap/grid_map.cpp b/modules/gridmap/grid_map.cpp
index 6df7835855..cfeb03df4c 100644
--- a/modules/gridmap/grid_map.cpp
+++ b/modules/gridmap/grid_map.cpp
@@ -703,8 +703,8 @@ void GridMap::_notification(int p_what) {
RS::get_singleton()->instance_set_scenario(baked_meshes[i].instance, get_world_3d()->get_scenario());
RS::get_singleton()->instance_set_transform(baked_meshes[i].instance, get_global_transform());
}
-
} break;
+
case NOTIFICATION_TRANSFORM_CHANGED: {
Transform3D new_xform = get_global_transform();
if (new_xform == last_transform) {
@@ -721,6 +721,7 @@ void GridMap::_notification(int p_what) {
RS::get_singleton()->instance_set_transform(baked_meshes[i].instance, get_global_transform());
}
} break;
+
case NOTIFICATION_EXIT_WORLD: {
for (const KeyValue<OctantKey, Octant *> &E : octant_map) {
_octant_exit_world(E.key);
@@ -732,8 +733,8 @@ void GridMap::_notification(int p_what) {
for (int i = 0; i < baked_meshes.size(); i++) {
RS::get_singleton()->instance_set_scenario(baked_meshes[i].instance, RID());
}
-
} break;
+
case NOTIFICATION_VISIBILITY_CHANGED: {
_update_visibility();
} break;
diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp
index a7f93a6ce9..80856d37c2 100644
--- a/modules/gridmap/grid_map_editor_plugin.cpp
+++ b/modules/gridmap/grid_map_editor_plugin.cpp
@@ -1456,15 +1456,17 @@ GridMapEditor::~GridMapEditor() {
}
void GridMapEditorPlugin::_notification(int p_what) {
- if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) {
- switch ((int)EditorSettings::get_singleton()->get("editors/grid_map/editor_side")) {
- case 0: { // Left.
- Node3DEditor::get_singleton()->move_control_to_left_panel(grid_map_editor);
- } break;
- case 1: { // Right.
- Node3DEditor::get_singleton()->move_control_to_right_panel(grid_map_editor);
- } break;
- }
+ switch (p_what) {
+ case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
+ switch ((int)EditorSettings::get_singleton()->get("editors/grid_map/editor_side")) {
+ case 0: { // Left.
+ Node3DEditor::get_singleton()->move_control_to_left_panel(grid_map_editor);
+ } break;
+ case 1: { // Right.
+ Node3DEditor::get_singleton()->move_control_to_right_panel(grid_map_editor);
+ } break;
+ }
+ } break;
}
}