Skip to content

Commit

Permalink
Support opening custom class documentation with "Open Documentation" …
Browse files Browse the repository at this point in the history
…menu entry
  • Loading branch information
jsjtxietian committed Aug 27, 2024
1 parent 28a72fa commit b5fa2a3
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion editor/scene_tree_dock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1181,7 +1181,16 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
case TOOL_OPEN_DOCUMENTATION: {
List<Node *> selection = editor_selection->get_selected_node_list();
for (const Node *node : selection) {
ScriptEditor::get_singleton()->goto_help("class_name:" + node->get_class());
String class_name;
Ref<Script> script_base = node->get_script();
if (script_base.is_valid()) {
class_name = script_base->get_global_name();
}
if (class_name.is_empty()) {
class_name = node->get_class();
}

ScriptEditor::get_singleton()->goto_help("class_name:" + class_name);
}
EditorNode::get_singleton()->set_visible_editor(EditorNode::EDITOR_SCRIPT);
} break;
Expand Down

0 comments on commit b5fa2a3

Please sign in to comment.