From 369e5a7f35b6c6e9c3a7fde4ab1fba08e4d525c8 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Wed, 16 Sep 2020 15:36:40 +0200 Subject: [PATCH] Mark InterpolatedCamera as deprecated InterpolatedCamera has already been removed from the `master` branch. This adds a deprecation notice to inform people about the upcoming removal in Godot 4.0. Its functionality could be replicated in a GDScript add-on with relative ease. --- doc/classes/InterpolatedCamera.xml | 4 ++-- scene/3d/interpolated_camera.cpp | 7 +++++++ scene/3d/interpolated_camera.h | 2 ++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/doc/classes/InterpolatedCamera.xml b/doc/classes/InterpolatedCamera.xml index 3ac7adbd7f..593b130ffe 100644 --- a/doc/classes/InterpolatedCamera.xml +++ b/doc/classes/InterpolatedCamera.xml @@ -1,10 +1,10 @@ - Camera which moves toward another node. + [i]Deprecated.[/i] Camera which moves toward another node. - InterpolatedCamera is a [Camera] which smoothly moves to match a target node's position and rotation. + [i]Deprecated (will be removed in Godot 4.0).[/i] InterpolatedCamera is a [Camera] which smoothly moves to match a target node's position and rotation. If it is not [member enabled] or does not have a valid target set, InterpolatedCamera acts like a normal Camera. diff --git a/scene/3d/interpolated_camera.cpp b/scene/3d/interpolated_camera.cpp index baf5ac4be6..f050f34b64 100644 --- a/scene/3d/interpolated_camera.cpp +++ b/scene/3d/interpolated_camera.cpp @@ -37,6 +37,8 @@ void InterpolatedCamera::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: { + WARN_DEPRECATED_MSG("InterpolatedCamera has been deprecated and will be removed in Godot 4.0."); + if (Engine::get_singleton()->is_editor_hint() && enabled) set_process_internal(false); @@ -131,6 +133,11 @@ real_t InterpolatedCamera::get_speed() const { return speed; } +String InterpolatedCamera::get_configuration_warning() const { + + return TTR("InterpolatedCamera has been deprecated and will be removed in Godot 4.0."); +} + void InterpolatedCamera::_bind_methods() { ClassDB::bind_method(D_METHOD("set_target_path", "target_path"), &InterpolatedCamera::set_target_path); diff --git a/scene/3d/interpolated_camera.h b/scene/3d/interpolated_camera.h index 7b160c66fa..b8a4f8e284 100644 --- a/scene/3d/interpolated_camera.h +++ b/scene/3d/interpolated_camera.h @@ -57,6 +57,8 @@ public: void set_interpolation_enabled(bool p_enable); bool is_interpolation_enabled() const; + String get_configuration_warning() const; + InterpolatedCamera(); };