summaryrefslogtreecommitdiff
path: root/editor/editor_properties.h
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_properties.h')
-rw-r--r--editor/editor_properties.h90
1 files changed, 49 insertions, 41 deletions
diff --git a/editor/editor_properties.h b/editor/editor_properties.h
index 61c11f4534..6f097fb5df 100644
--- a/editor/editor_properties.h
+++ b/editor/editor_properties.h
@@ -5,8 +5,8 @@
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
+/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -41,10 +41,10 @@
class EditorPropertyNil : public EditorProperty {
GDCLASS(EditorPropertyNil, EditorProperty);
- LineEdit *text;
+ LineEdit *text = nullptr;
public:
- virtual void update_property();
+ virtual void update_property() override;
EditorPropertyNil();
};
@@ -62,7 +62,7 @@ protected:
public:
void set_string_name(bool p_enabled);
- virtual void update_property();
+ virtual void update_property() override;
void set_placeholder(const String &p_string);
EditorPropertyText();
};
@@ -84,7 +84,7 @@ protected:
static void _bind_methods();
public:
- virtual void update_property();
+ virtual void update_property() override;
EditorPropertyMultilineText();
};
@@ -100,7 +100,7 @@ protected:
public:
void setup(const Vector<String> &p_options, bool p_string_name = false);
- virtual void update_property();
+ virtual void update_property() override;
EditorPropertyTextEnum();
};
@@ -125,7 +125,7 @@ protected:
public:
void setup(const Vector<String> &p_extensions, bool p_folder, bool p_global);
void set_save_mode();
- virtual void update_property();
+ virtual void update_property() override;
EditorPropertyPath();
};
@@ -145,7 +145,7 @@ protected:
public:
void setup(const String &p_base_type, const String &p_selected_type);
- virtual void update_property();
+ virtual void update_property() override;
EditorPropertyClassName();
};
@@ -179,7 +179,7 @@ protected:
public:
void setup(Type p_hint, const String &p_hint_text);
- virtual void update_property();
+ virtual void update_property() override;
EditorPropertyMember();
};
@@ -193,7 +193,7 @@ protected:
static void _bind_methods();
public:
- virtual void update_property();
+ virtual void update_property() override;
EditorPropertyCheck();
};
@@ -208,7 +208,7 @@ protected:
public:
void setup(const Vector<String> &p_options);
- virtual void update_property();
+ virtual void update_property() override;
void set_option_button_clip(bool p_enable);
EditorPropertyEnum();
};
@@ -226,7 +226,7 @@ protected:
public:
void setup(const Vector<String> &p_options);
- virtual void update_property();
+ virtual void update_property() override;
EditorPropertyFlags();
};
@@ -258,7 +258,7 @@ protected:
public:
void setup(LayerType p_layer_type);
- virtual void update_property();
+ virtual void update_property() override;
EditorPropertyLayers();
};
@@ -272,7 +272,7 @@ protected:
static void _bind_methods();
public:
- virtual void update_property();
+ virtual void update_property() override;
void setup(int64_t p_min, int64_t p_max, int64_t p_step, bool p_allow_greater, bool p_allow_lesser);
EditorPropertyInteger();
};
@@ -287,7 +287,7 @@ protected:
static void _bind_methods();
public:
- virtual void update_property();
+ virtual void update_property() override;
void setup(const String &p_base_type);
EditorPropertyObjectID();
};
@@ -302,7 +302,7 @@ protected:
static void _bind_methods();
public:
- virtual void update_property();
+ 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);
EditorPropertyFloat();
};
@@ -343,7 +343,7 @@ protected:
static void _bind_methods();
public:
- virtual void update_property();
+ virtual void update_property() override;
void setup(bool p_full, bool p_flip);
EditorPropertyEasing();
};
@@ -359,7 +359,7 @@ protected:
static void _bind_methods();
public:
- virtual void update_property();
+ virtual void update_property() override;
void setup(double p_min, double p_max, double p_step, bool p_no_slider);
EditorPropertyVector2(bool p_force_wide = false);
};
@@ -375,7 +375,7 @@ protected:
static void _bind_methods();
public:
- virtual void update_property();
+ virtual void update_property() override;
void setup(double p_min, double p_max, double p_step, bool p_no_slider);
EditorPropertyRect2(bool p_force_wide = false);
};
@@ -391,7 +391,9 @@ protected:
static void _bind_methods();
public:
- virtual void update_property();
+ 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);
EditorPropertyVector3(bool p_force_wide = false);
};
@@ -407,7 +409,7 @@ protected:
static void _bind_methods();
public:
- virtual void update_property();
+ virtual void update_property() override;
void setup(int p_min, int p_max, bool p_no_slider);
EditorPropertyVector2i(bool p_force_wide = false);
};
@@ -423,7 +425,7 @@ protected:
static void _bind_methods();
public:
- virtual void update_property();
+ virtual void update_property() override;
void setup(int p_min, int p_max, bool p_no_slider);
EditorPropertyRect2i(bool p_force_wide = false);
};
@@ -439,7 +441,7 @@ protected:
static void _bind_methods();
public:
- virtual void update_property();
+ virtual void update_property() override;
void setup(int p_min, int p_max, bool p_no_slider);
EditorPropertyVector3i(bool p_force_wide = false);
};
@@ -455,7 +457,7 @@ protected:
static void _bind_methods();
public:
- virtual void update_property();
+ virtual void update_property() override;
void setup(double p_min, double p_max, double p_step, bool p_no_slider);
EditorPropertyPlane(bool p_force_wide = false);
};
@@ -471,7 +473,7 @@ protected:
static void _bind_methods();
public:
- virtual void update_property();
+ virtual void update_property() override;
void setup(double p_min, double p_max, double p_step, bool p_no_slider);
EditorPropertyQuat();
};
@@ -487,7 +489,7 @@ protected:
static void _bind_methods();
public:
- virtual void update_property();
+ virtual void update_property() override;
void setup(double p_min, double p_max, double p_step, bool p_no_slider);
EditorPropertyAABB();
};
@@ -503,7 +505,7 @@ protected:
static void _bind_methods();
public:
- virtual void update_property();
+ virtual void update_property() override;
void setup(double p_min, double p_max, double p_step, bool p_no_slider);
EditorPropertyTransform2D();
};
@@ -519,7 +521,7 @@ protected:
static void _bind_methods();
public:
- virtual void update_property();
+ virtual void update_property() override;
void setup(double p_min, double p_max, double p_step, bool p_no_slider);
EditorPropertyBasis();
};
@@ -535,7 +537,8 @@ protected:
static void _bind_methods();
public:
- virtual void update_property();
+ virtual void update_property() override;
+ virtual void update_using_transform(Transform p_transform);
void setup(double p_min, double p_max, double p_step, bool p_no_slider);
EditorPropertyTransform();
};
@@ -546,12 +549,15 @@ class EditorPropertyColor : public EditorProperty {
void _color_changed(const Color &p_color);
void _popup_closed();
void _picker_created();
+ void _picker_opening();
+
+ Color last_color;
protected:
static void _bind_methods();
public:
- virtual void update_property();
+ virtual void update_property() override;
void setup(bool p_show_alpha);
EditorPropertyColor();
};
@@ -574,7 +580,7 @@ protected:
void _notification(int p_what);
public:
- virtual void update_property();
+ virtual void update_property() override;
void setup(const NodePath &p_base_hint, Vector<StringName> p_valid_types, bool p_use_path_from_scene_root = true);
EditorPropertyNodePath();
};
@@ -584,7 +590,7 @@ class EditorPropertyRID : public EditorProperty {
Label *label;
public:
- virtual void update_property();
+ virtual void update_property() override;
EditorPropertyRID();
};
@@ -592,7 +598,6 @@ class EditorPropertyResource : public EditorProperty {
GDCLASS(EditorPropertyResource, EditorProperty);
enum MenuOption {
-
OBJ_MENU_LOAD = 0,
OBJ_MENU_EDIT = 1,
OBJ_MENU_CLEAR = 2,
@@ -649,16 +654,19 @@ class EditorPropertyResource : public EditorProperty {
bool opened_editor;
+ bool updating_theme = false;
+ void _update_property_bg();
+
protected:
static void _bind_methods();
void _notification(int p_what);
public:
- virtual void update_property();
+ virtual void update_property() override;
void setup(const String &p_base_type);
- void collapse_all_folding();
- void expand_all_folding();
+ void collapse_all_folding() override;
+ void expand_all_folding() override;
void set_use_sub_inspector(bool p_enable);
@@ -672,10 +680,10 @@ class EditorInspectorDefaultPlugin : public EditorInspectorPlugin {
GDCLASS(EditorInspectorDefaultPlugin, EditorInspectorPlugin);
public:
- virtual bool can_handle(Object *p_object);
- virtual void parse_begin(Object *p_object);
- virtual bool parse_property(Object *p_object, Variant::Type p_type, const String &p_path, PropertyHint p_hint, const String &p_hint_text, int p_usage, bool p_wide = false);
- virtual void parse_end();
+ virtual bool can_handle(Object *p_object) override;
+ virtual void parse_begin(Object *p_object) override;
+ virtual bool parse_property(Object *p_object, Variant::Type p_type, const String &p_path, PropertyHint p_hint, const String &p_hint_text, int p_usage, bool p_wide = false) override;
+ virtual void parse_end() override;
};
#endif // EDITOR_PROPERTIES_H