Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add meta link to open script editor from script doc #100868

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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_image(get_editor_theme_icon(SNAME("Script")));
class_desc->add_text(" " + TTR("Open Script"));
class_desc->pop();
}

bool has_description = false;

// Brief description
Expand Down