diff --git a/editor/task_palette.cpp b/editor/task_palette.cpp index ee8b104..9aa6cf9 100644 --- a/editor/task_palette.cpp +++ b/editor/task_palette.cpp @@ -188,14 +188,7 @@ void TaskPalette::_menu_action_selected(int p_id) { ERR_FAIL_COND(context_task.is_empty()); switch (p_id) { case MENU_OPEN_DOC: { - String help_class; - if (context_task.begins_with("res://")) { - help_class = context_task; - } else { - // Assuming context task is core class. - help_class = context_task; - } - LimboUtility::get_singleton()->open_doc_class(help_class); + LimboUtility::get_singleton()->open_doc_class(context_task); } break; case MENU_EDIT_SCRIPT: { ERR_FAIL_COND(!context_task.begins_with("res://")); diff --git a/util/limbo_utility.cpp b/util/limbo_utility.cpp index bd7f8a4..9e49f18 100644 --- a/util/limbo_utility.cpp +++ b/util/limbo_utility.cpp @@ -288,6 +288,8 @@ Variant LimboUtility::perform_operation(Operation p_operation, const Variant &le return ret; } +#ifdef TOOLS_ENABLED + Ref LimboUtility::add_shortcut(const String &p_path, const String &p_name, Key p_keycode) { Ref sc = memnew(Shortcut); sc->set_name(p_name); @@ -341,6 +343,8 @@ void LimboUtility::open_doc_class(const String &p_class_name) { #endif } +#endif // ! TOOLS_ENABLED + void LimboUtility::_bind_methods() { ClassDB::bind_method(D_METHOD("decorate_var", "p_variable"), &LimboUtility::decorate_var); ClassDB::bind_method(D_METHOD("get_status_name", "p_status"), &LimboUtility::get_status_name); diff --git a/util/limbo_utility.h b/util/limbo_utility.h index 84b4ad4..10c10e1 100644 --- a/util/limbo_utility.h +++ b/util/limbo_utility.h @@ -42,7 +42,9 @@ class LimboUtility : public Object { GDCLASS(LimboUtility, Object); private: +#ifdef TOOLS_ENABLED HashMap> shortcuts; +#endif // TOOLS_ENABLED public: enum CheckType : unsigned int { @@ -86,6 +88,7 @@ public: String get_operation_string(Operation p_operation) const; Variant perform_operation(Operation p_operation, const Variant &left_value, const Variant &right_value); +#ifdef TOOLS_ENABLED Ref add_shortcut(const String &p_path, const String &p_name, Key p_keycode = LW_KEY(NONE)); bool is_shortcut(const String &p_path, const Ref &p_event) const; Ref get_shortcut(const String &p_path) const; @@ -93,6 +96,7 @@ public: void open_doc_introduction(); void open_doc_online(); void open_doc_class(const String &p_class_name); +#endif // TOOLS_ENABLED LimboUtility(); ~LimboUtility();