diff options
Diffstat (limited to 'editor/editor_inspector.h')
-rw-r--r-- | editor/editor_inspector.h | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/editor/editor_inspector.h b/editor/editor_inspector.h index baba9ec1f4..1b93b19845 100644 --- a/editor/editor_inspector.h +++ b/editor/editor_inspector.h @@ -42,8 +42,6 @@ #include "scene/gui/spin_box.h" #include "scene/gui/texture_rect.h" -class UndoRedo; - class EditorPropertyRevert { public: static bool get_instantiated_node_original_property(Node *p_node, const StringName &p_prop, Variant &value, bool p_check_class_default = true); @@ -59,8 +57,8 @@ class EditorProperty : public Container { public: enum MenuItems { - MENU_COPY_PROPERTY, - MENU_PASTE_PROPERTY, + MENU_COPY_VALUE, + MENU_PASTE_VALUE, MENU_COPY_PROPERTY_PATH, MENU_PIN_VALUE, MENU_OPEN_DOCUMENTATION, @@ -118,11 +116,11 @@ private: Control *bottom_editor = nullptr; PopupMenu *menu = nullptr; - mutable String tooltip_text; - HashMap<StringName, Variant> cache; GDVIRTUAL0(_update_property) + GDVIRTUAL1(_set_read_only, bool) + void _update_pin_flags(); protected: @@ -154,7 +152,7 @@ public: void set_doc_path(const String &p_doc_path); virtual void update_property(); - void update_revert_and_pin_status(); + void update_editor_property_status(); virtual bool use_keying_next() const; @@ -200,8 +198,6 @@ public: void set_object_and_property(Object *p_object, const StringName &p_property); virtual Control *make_custom_tooltip(const String &p_text) const override; - String get_tooltip_text() const; - void set_draw_top_bg(bool p_draw) { draw_top_bg = p_draw; } bool can_revert_to_default() const { return can_revert; } @@ -255,18 +251,13 @@ class EditorInspectorCategory : public Control { Ref<Texture2D> icon; String label; - mutable String tooltip_text; - protected: void _notification(int p_what); - static void _bind_methods(); public: virtual Size2 get_minimum_size() const override; virtual Control *make_custom_tooltip(const String &p_text) const override; - String get_tooltip_text() const; - EditorInspectorCategory(); }; @@ -313,8 +304,6 @@ public: class EditorInspectorArray : public EditorInspectorSection { GDCLASS(EditorInspectorArray, EditorInspectorSection); - UndoRedo *undo_redo = nullptr; - enum Mode { MODE_NONE, MODE_USE_COUNT_PROPERTY, @@ -343,6 +332,7 @@ class EditorInspectorArray : public EditorInspectorSection { int begin_array_index = 0; int end_array_index = 0; + bool read_only = false; bool movable = true; bool numbered = false; @@ -408,13 +398,11 @@ protected: static void _bind_methods(); public: - void set_undo_redo(UndoRedo *p_undo_redo); - void setup_with_move_element_function(Object *p_object, String p_label, const StringName &p_array_element_prefix, int p_page, const Color &p_bg_color, bool p_foldable, bool p_movable = true, bool p_numbered = false, int p_page_length = 5, const String &p_add_item_text = ""); void setup_with_count_property(Object *p_object, String p_label, const StringName &p_count_property, const StringName &p_array_element_prefix, int p_page, const Color &p_bg_color, bool p_foldable, bool p_movable = true, bool p_numbered = false, int p_page_length = 5, const String &p_add_item_text = "", const String &p_swap_method = ""); VBoxContainer *get_vbox(int p_index); - EditorInspectorArray(); + EditorInspectorArray(bool p_read_only); }; class EditorPaginator : public HBoxContainer { @@ -448,7 +436,6 @@ public: class EditorInspector : public ScrollContainer { GDCLASS(EditorInspector, ScrollContainer); - UndoRedo *undo_redo = nullptr; enum { MAX_PLUGINS = 1024 }; @@ -548,7 +535,7 @@ class EditorInspector : public ScrollContainer { void _add_meta_confirm(); void _show_add_meta_dialog(); - void _check_meta_name(String name); + void _check_meta_name(const String &p_name); protected: static void _bind_methods(); @@ -562,8 +549,6 @@ public: static EditorProperty *instantiate_property_editor(Object *p_object, const Variant::Type p_type, const String &p_path, const PropertyHint p_hint, const String &p_hint_text, const uint32_t p_usage, const bool p_wide = false); - void set_undo_redo(UndoRedo *p_undo_redo); - String get_selected_path() const; void update_tree(); |