diff options
Diffstat (limited to 'editor/editor_properties.h')
-rw-r--r-- | editor/editor_properties.h | 53 |
1 files changed, 36 insertions, 17 deletions
diff --git a/editor/editor_properties.h b/editor/editor_properties.h index c1dfb5cb1e..ad36e01544 100644 --- a/editor/editor_properties.h +++ b/editor/editor_properties.h @@ -67,6 +67,7 @@ public: void set_string_name(bool p_enabled); virtual void update_property() override; void set_placeholder(const String &p_string); + void set_secret(bool p_enabled); EditorPropertyText(); }; @@ -356,6 +357,7 @@ protected: public: void setup(LayerType p_layer_type); void set_layer_name(int p_index, const String &p_name); + String get_layer_name(int p_index) const; virtual void update_property() override; EditorPropertyLayers(); }; @@ -432,7 +434,7 @@ protected: public: virtual void update_property() override; - void setup(double p_min, double p_max, double p_step, bool p_no_slider, bool p_exp_range, bool p_greater, bool p_lesser, const String &p_suffix = String(), bool p_angle_in_radians = false); + void setup(double p_min, double p_max, double p_step, bool p_hide_slider, bool p_exp_range, bool p_greater, bool p_lesser, const String &p_suffix = String(), bool p_angle_in_radians = false); EditorPropertyFloat(); }; @@ -495,7 +497,7 @@ protected: public: virtual void update_property() override; - void setup(double p_min, double p_max, double p_step, bool p_no_slider, bool p_link = false, const String &p_suffix = String()); + void setup(double p_min, double p_max, double p_step, bool p_hide_slider, bool p_link = false, const String &p_suffix = String()); EditorPropertyVector2(bool p_force_wide = false); }; @@ -512,7 +514,7 @@ protected: public: virtual void update_property() override; - void setup(double p_min, double p_max, double p_step, bool p_no_slider, const String &p_suffix = String()); + void setup(double p_min, double p_max, double p_step, bool p_hide_slider, const String &p_suffix = String()); EditorPropertyRect2(bool p_force_wide = false); }; @@ -540,7 +542,7 @@ public: virtual void update_property() override; virtual void update_using_vector(Vector3 p_vector); virtual Vector3 get_vector(); - void setup(double p_min, double p_max, double p_step, bool p_no_slider, bool p_link = false, const String &p_suffix = String(), bool p_angle_in_radians = false); + void setup(double p_min, double p_max, double p_step, bool p_hide_slider, bool p_link = false, const String &p_suffix = String(), bool p_angle_in_radians = false); EditorPropertyVector3(bool p_force_wide = false); }; @@ -560,7 +562,7 @@ protected: public: virtual void update_property() override; - void setup(int p_min, int p_max, bool p_no_slider, bool p_link = false, const String &p_suffix = String()); + void setup(int p_min, int p_max, bool p_hide_slider, bool p_link = false, const String &p_suffix = String()); EditorPropertyVector2i(bool p_force_wide = false); }; @@ -577,7 +579,7 @@ protected: public: virtual void update_property() override; - void setup(int p_min, int p_max, bool p_no_slider, const String &p_suffix = String()); + void setup(int p_min, int p_max, bool p_hide_slider, const String &p_suffix = String()); EditorPropertyRect2i(bool p_force_wide = false); }; @@ -602,7 +604,7 @@ protected: public: virtual void update_property() override; - void setup(int p_min, int p_max, bool p_no_slider, bool p_link = false, const String &p_suffix = String()); + void setup(int p_min, int p_max, bool p_hide_slider, bool p_link = false, const String &p_suffix = String()); EditorPropertyVector3i(bool p_force_wide = false); }; @@ -619,15 +621,32 @@ protected: public: virtual void update_property() override; - void setup(double p_min, double p_max, double p_step, bool p_no_slider, const String &p_suffix = String()); + void setup(double p_min, double p_max, double p_step, bool p_hide_slider, const String &p_suffix = String()); EditorPropertyPlane(bool p_force_wide = false); }; class EditorPropertyQuaternion : public EditorProperty { GDCLASS(EditorPropertyQuaternion, EditorProperty); + BoxContainer *default_layout = nullptr; EditorSpinSlider *spin[4]; bool setting = false; + + Button *warning = nullptr; + AcceptDialog *warning_dialog = nullptr; + + Label *euler_label = nullptr; + VBoxContainer *edit_custom_bc = nullptr; + EditorSpinSlider *euler[3]; + Button *edit_button = nullptr; + + Vector3 edit_euler; + void _value_changed(double p_val, const String &p_name); + void _edit_custom_value(); + void _custom_value_changed(double p_val); + void _warning_pressed(); + + bool is_grabbing_euler(); protected: virtual void _set_read_only(bool p_read_only) override; @@ -636,7 +655,7 @@ protected: public: virtual void update_property() override; - void setup(double p_min, double p_max, double p_step, bool p_no_slider, const String &p_suffix = String()); + void setup(double p_min, double p_max, double p_step, bool p_hide_slider, const String &p_suffix = String(), bool p_hide_editor = false); EditorPropertyQuaternion(); }; @@ -653,7 +672,7 @@ protected: public: virtual void update_property() override; - void setup(double p_min, double p_max, double p_step, bool p_no_slider, const String &p_suffix = String()); + void setup(double p_min, double p_max, double p_step, bool p_hide_slider, const String &p_suffix = String()); EditorPropertyVector4(); }; @@ -670,7 +689,7 @@ protected: public: virtual void update_property() override; - void setup(double p_min, double p_max, bool p_no_slider, const String &p_suffix = String()); + void setup(double p_min, double p_max, bool p_hide_slider, const String &p_suffix = String()); EditorPropertyVector4i(); }; @@ -687,7 +706,7 @@ protected: public: virtual void update_property() override; - void setup(double p_min, double p_max, double p_step, bool p_no_slider, const String &p_suffix = String()); + void setup(double p_min, double p_max, double p_step, bool p_hide_slider, const String &p_suffix = String()); EditorPropertyAABB(); }; @@ -704,7 +723,7 @@ protected: public: virtual void update_property() override; - void setup(double p_min, double p_max, double p_step, bool p_no_slider, const String &p_suffix = String()); + void setup(double p_min, double p_max, double p_step, bool p_hide_slider, const String &p_suffix = String()); EditorPropertyTransform2D(bool p_include_origin = true); }; @@ -721,7 +740,7 @@ protected: public: virtual void update_property() override; - void setup(double p_min, double p_max, double p_step, bool p_no_slider, const String &p_suffix = String()); + void setup(double p_min, double p_max, double p_step, bool p_hide_slider, const String &p_suffix = String()); EditorPropertyBasis(); }; @@ -739,7 +758,7 @@ protected: public: virtual void update_property() override; virtual void update_using_transform(Transform3D p_transform); - void setup(double p_min, double p_max, double p_step, bool p_no_slider, const String &p_suffix = String()); + void setup(double p_min, double p_max, double p_step, bool p_hide_slider, const String &p_suffix = String()); EditorPropertyTransform3D(); }; @@ -757,7 +776,7 @@ protected: public: virtual void update_property() override; virtual void update_using_transform(Projection p_transform); - void setup(double p_min, double p_max, double p_step, bool p_no_slider, const String &p_suffix = String()); + void setup(double p_min, double p_max, double p_step, bool p_hide_slider, const String &p_suffix = String()); EditorPropertyProjection(); }; @@ -835,7 +854,7 @@ class EditorPropertyResource : public EditorProperty { bool updating_theme = false; bool opened_editor = false; - void _resource_selected(const Ref<Resource> &p_resource, bool p_edit); + void _resource_selected(const Ref<Resource> &p_resource, bool p_inspect); void _resource_changed(const Ref<Resource> &p_resource); void _viewport_selected(const NodePath &p_path); |