Skip to content

Commit

Permalink
Add meta link to open script editor from script doc
Browse files Browse the repository at this point in the history
  • Loading branch information
pcvonz committed Dec 28, 2024
1 parent 99a8ab7 commit ab4a29e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion editor/editor_help.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,9 @@ void EditorHelp::_class_list_select(const String &p_select) {
}

void EditorHelp::_class_desc_select(const String &p_select) {
if (p_select.begins_with("$")) { // Enum.
if (p_select.begins_with("res://")) { // Srcript, open in editor
ScriptEditor::get_singleton()->open_file(p_select);
} else if (p_select.begins_with("$")) { // Enum.
const String link = p_select.substr(1);

String enum_class_name;
Expand Down Expand Up @@ -1047,6 +1049,15 @@ void EditorHelp::_update_doc() {
_pop_normal_font();
}

// Add link to script
if (cd.is_script_doc) {
class_desc->add_newline();
class_desc->push_meta(cd.script_path);
class_desc->add_text("Open in editor");
class_desc->pop();
class_desc->add_newline();
}

bool has_description = false;

// Brief description
Expand Down

0 comments on commit ab4a29e

Please sign in to comment.