From dcf42cff86e0577d87484613d0915256b7491fcc Mon Sep 17 00:00:00 2001 From: FireForge <67974470+fire-forge@users.noreply.github.com> Date: Mon, 28 Mar 2022 15:37:01 -0500 Subject: Add "Open Documentation" button to EditorProperty context menu --- editor/editor_inspector.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'editor/editor_inspector.h') diff --git a/editor/editor_inspector.h b/editor/editor_inspector.h index d70d06c48b..9542f102cb 100644 --- a/editor/editor_inspector.h +++ b/editor/editor_inspector.h @@ -62,6 +62,7 @@ public: MENU_PASTE_PROPERTY, MENU_COPY_PROPERTY_PATH, MENU_PIN_VALUE, + MENU_OPEN_DOCUMENTATION, }; private: @@ -71,6 +72,7 @@ private: Object *object = nullptr; StringName property; String property_path; + String doc_path; int property_usage; @@ -148,6 +150,8 @@ public: Object *get_edited_object(); StringName get_edited_property() const; + void set_doc_path(const String &p_doc_path); + virtual void update_property(); void update_revert_and_pin_status(); @@ -439,7 +443,7 @@ class EditorInspector : public ScrollContainer { VBoxContainer *main_vbox = nullptr; - //map use to cache the instantiated editors + // Map used to cache the instantiated editors. HashMap> editor_property_map; List sections; HashSet pending; @@ -473,7 +477,12 @@ class EditorInspector : public ScrollContainer { int property_focusable; int update_scroll_request; - HashMap> descr_cache; + struct PropertyDocInfo { + String description; + String path; + }; + + HashMap> doc_info_cache; HashMap class_descr_cache; HashSet restart_request_props; -- cgit v1.2.3