@@ -165,9 +165,7 @@ void EditorMainScreen4D::_on_view_menu_id_pressed(const int p_id) {
165
165
_4d_editor_config_file->save (_4d_editor_config_file_path);
166
166
} break ;
167
167
case VIEW_ITEM_CAMERA_SETTINGS: {
168
- #if GODOT_VERSION_MAJOR > 4 || (GODOT_VERSION_MAJOR == 4 && GODOT_VERSION_MINOR >= 4)
169
168
_camera_settings_dialog->popup_centered (Size2 (400 , 300 ) * EDSCALE);
170
- #endif
171
169
} break ;
172
170
}
173
171
}
@@ -428,15 +426,15 @@ void EditorMainScreen4D::setup(EditorUndoRedoManager *p_undo_redo_manager) {
428
426
429
427
_camera_settings = memnew (EditorCameraSettings4D);
430
428
_camera_settings->setup (this , _4d_editor_config_file, _4d_editor_config_file_path);
431
- #if GODOT_VERSION_MAJOR > 4 || (GODOT_VERSION_MAJOR == 4 && GODOT_VERSION_MINOR >= 4)
432
- // Set up the camera settings dialog as long as this is Godot >= 4.4.
433
429
_camera_settings_dialog = memnew (ConfirmationDialog);
434
430
_camera_settings_dialog->set_name (StringName (" CameraSettingsDialog" ));
435
431
_camera_settings_dialog->set_title (TTR (" Editor Camera Settings" ));
436
432
_camera_settings_inspector = memnew (EditorInspector);
437
433
_camera_settings_inspector->set_name (StringName (" CameraSettingsInspector" ));
438
434
_camera_settings_inspector->set_anchors_and_offsets_preset (Control::PRESET_FULL_RECT);
439
435
_camera_settings_inspector->set_custom_minimum_size (Size2 (400 , 200 ) * EDSCALE);
436
+ #if GODOT_MODULE || (GODOT_VERSION_MAJOR > 4 || (GODOT_VERSION_MAJOR == 4 && GODOT_VERSION_MINOR >= 4))
437
+ // Set up the camera settings dialog as long as this is Godot >= 4.4.
440
438
_camera_settings_inspector->edit (_camera_settings);
441
439
_camera_settings_dialog->add_child (_camera_settings_inspector);
442
440
add_child (_camera_settings_dialog);
@@ -454,8 +452,10 @@ void EditorMainScreen4D::setup(EditorUndoRedoManager *p_undo_redo_manager) {
454
452
}
455
453
456
454
EditorMainScreen4D::~EditorMainScreen4D () {
457
- #if GODOT_VERSION_MAJOR > 4 || (GODOT_VERSION_MAJOR == 4 && GODOT_VERSION_MINOR >= 4)
455
+ #if GODOT_MODULE || ( GODOT_VERSION_MAJOR > 4 || (GODOT_VERSION_MAJOR == 4 && GODOT_VERSION_MINOR >= 4) )
458
456
_camera_settings_inspector->edit (nullptr );
459
- memdelete (_camera_settings);
460
457
#endif
458
+ if (_camera_settings != nullptr ) {
459
+ memdelete (_camera_settings);
460
+ }
461
461
}
0 commit comments