From cbbc0b0135ece5bb91f4f89e437974266ce58ea1 Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Sat, 13 Jan 2024 22:40:27 +0100 Subject: [PATCH] Link to online docs in the code --- editor/limbo_ai_editor_plugin.cpp | 26 +++++++++++++++++--------- editor/limbo_ai_editor_plugin.h | 4 +++- editor/task_palette.cpp | 4 ++-- util/limbo_string_names.cpp | 1 + util/limbo_string_names.h | 1 + util/limbo_utility.cpp | 26 ++++++++++++++++++++++++++ util/limbo_utility.h | 6 ++++++ 7 files changed, 56 insertions(+), 12 deletions(-) diff --git a/editor/limbo_ai_editor_plugin.cpp b/editor/limbo_ai_editor_plugin.cpp index af3ed12..4095c21 100644 --- a/editor/limbo_ai_editor_plugin.cpp +++ b/editor/limbo_ai_editor_plugin.cpp @@ -373,7 +373,7 @@ void LimboAIEditor::_on_tree_rmb(const Vector2 &p_menu_pos) { menu->add_icon_shortcut(theme_cache.rename_task_icon, LW_GET_SHORTCUT("limbo_ai/rename_task"), ACTION_RENAME); menu->add_icon_item(theme_cache.change_type_icon, TTR("Change Type"), ACTION_CHANGE_TYPE); menu->add_icon_item(theme_cache.edit_script_icon, TTR("Edit Script"), ACTION_EDIT_SCRIPT); - menu->add_icon_item(theme_cache.open_doc_icon, TTR("Open Documentation"), ACTION_OPEN_DOC); + menu->add_icon_item(theme_cache.doc_icon, TTR("Open Documentation"), ACTION_OPEN_DOC); menu->set_item_disabled(menu->get_item_index(ACTION_EDIT_SCRIPT), task->get_script() == Variant()); menu->add_separator(); @@ -436,14 +436,17 @@ void LimboAIEditor::_action_selected(int p_id) { Ref task = task_tree->get_selected(); ERR_FAIL_COND(task.is_null()); String help_class; - String res_path = task->get_path(); - if (res_path.begins_with("res://")) { - help_class = "\"" + res_path.get_basename().to_pascal_case() + "\""; - } else { + + Ref