diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-03-07 15:12:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-07 15:12:15 +0100 |
commit | c487f1e85464181754ce48761dff7e241f27f994 (patch) | |
tree | 37bddb123c30b7b2eaeb40ba8e1928bb757ada69 /scene/resources | |
parent | afd0df79215c260f3b9a9544e5ca1b606f4365c0 (diff) | |
parent | 4be282a269bb298c04afb4741fe0f5f99716cd59 (diff) |
Merge pull request #46643 from YeldhamDev/hide_all_the_things
Hide more options of disabled properties
Diffstat (limited to 'scene/resources')
-rw-r--r-- | scene/resources/camera_effects.cpp | 2 | ||||
-rw-r--r-- | scene/resources/camera_effects.h | 5 | ||||
-rw-r--r-- | scene/resources/style_box.cpp | 7 | ||||
-rw-r--r-- | scene/resources/style_box.h | 1 |
4 files changed, 9 insertions, 6 deletions
diff --git a/scene/resources/camera_effects.cpp b/scene/resources/camera_effects.cpp index 00312fc7b2..34c6bc05bc 100644 --- a/scene/resources/camera_effects.cpp +++ b/scene/resources/camera_effects.cpp @@ -145,7 +145,6 @@ void CameraEffects::_update_override_exposure() { // Private methods, constructor and destructor -#ifdef TOOLS_ENABLED void CameraEffects::_validate_property(PropertyInfo &property) const { if ((!dof_blur_far_enabled && (property.name == "dof_blur_far_distance" || property.name == "dof_blur_far_transition")) || (!dof_blur_near_enabled && (property.name == "dof_blur_near_distance" || property.name == "dof_blur_near_transition")) || @@ -153,7 +152,6 @@ void CameraEffects::_validate_property(PropertyInfo &property) const { property.usage = PROPERTY_USAGE_NOEDITOR; } } -#endif void CameraEffects::_bind_methods() { // DOF blur diff --git a/scene/resources/camera_effects.h b/scene/resources/camera_effects.h index 51fb2b6cf7..b9338f4806 100644 --- a/scene/resources/camera_effects.h +++ b/scene/resources/camera_effects.h @@ -57,12 +57,9 @@ private: float override_exposure = 1.0; void _update_override_exposure(); -#ifdef TOOLS_ENABLED - void _validate_property(PropertyInfo &property) const override; -#endif - protected: static void _bind_methods(); + void _validate_property(PropertyInfo &property) const override; public: virtual RID get_rid() const override; diff --git a/scene/resources/style_box.cpp b/scene/resources/style_box.cpp index 9b80224c3f..2159f1bc97 100644 --- a/scene/resources/style_box.cpp +++ b/scene/resources/style_box.cpp @@ -460,6 +460,7 @@ Point2 StyleBoxFlat::get_shadow_offset() const { void StyleBoxFlat::set_anti_aliased(const bool &p_anti_aliased) { anti_aliased = p_anti_aliased; emit_changed(); + notify_property_list_changed(); } bool StyleBoxFlat::is_anti_aliased() const { @@ -781,6 +782,12 @@ float StyleBoxFlat::get_style_margin(Side p_side) const { return border_width[p_side]; } +void StyleBoxFlat::_validate_property(PropertyInfo &property) const { + if (!anti_aliased && property.name == "anti_aliasing_size") { + property.usage = PROPERTY_USAGE_NOEDITOR; + } +} + void StyleBoxFlat::_bind_methods() { ClassDB::bind_method(D_METHOD("set_bg_color", "color"), &StyleBoxFlat::set_bg_color); ClassDB::bind_method(D_METHOD("get_bg_color"), &StyleBoxFlat::get_bg_color); diff --git a/scene/resources/style_box.h b/scene/resources/style_box.h index 8a273afbfd..dd5c873a00 100644 --- a/scene/resources/style_box.h +++ b/scene/resources/style_box.h @@ -159,6 +159,7 @@ class StyleBoxFlat : public StyleBox { protected: virtual float get_style_margin(Side p_side) const override; static void _bind_methods(); + void _validate_property(PropertyInfo &property) const override; public: //Color |