diff options
author | Michael Alexsander <michaelalexsander@protonmail.com> | 2021-03-03 20:51:35 -0300 |
---|---|---|
committer | Michael Alexsander <michaelalexsander@protonmail.com> | 2021-03-03 20:51:35 -0300 |
commit | 4be282a269bb298c04afb4741fe0f5f99716cd59 (patch) | |
tree | 21fb04b65b3e5a2e0df3090d673e8bb9790ebe3f /scene/2d/camera_2d.cpp | |
parent | 864caf571164dea655a7c1f9d9b423195653dee2 (diff) |
Hide more options of disabled properties
Diffstat (limited to 'scene/2d/camera_2d.cpp')
-rw-r--r-- | scene/2d/camera_2d.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp index c5ac4e1a05..9030cc4263 100644 --- a/scene/2d/camera_2d.cpp +++ b/scene/2d/camera_2d.cpp @@ -569,6 +569,7 @@ void Camera2D::_set_old_smoothing(float p_enable) { void Camera2D::set_enable_follow_smoothing(bool p_enabled) { smoothing_enabled = p_enabled; + notify_property_list_changed(); } bool Camera2D::is_follow_smoothing_enabled() const { @@ -642,6 +643,12 @@ bool Camera2D::is_margin_drawing_enabled() const { return margin_drawing_enabled; } +void Camera2D::_validate_property(PropertyInfo &property) const { + if (!smoothing_enabled && property.name == "smoothing_speed") { + property.usage = PROPERTY_USAGE_NOEDITOR; + } +} + void Camera2D::_bind_methods() { ClassDB::bind_method(D_METHOD("set_offset", "offset"), &Camera2D::set_offset); ClassDB::bind_method(D_METHOD("get_offset"), &Camera2D::get_offset); |