You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-12 13:20:55 +00:00
Merge pull request #92280 from dalexeev/editor-fix-built-in-script-documentation
Editor: Fix documentation for built-in scripts
This commit is contained in:
@@ -2364,13 +2364,32 @@ void EditorHelp::_request_help(const String &p_string) {
|
||||
}
|
||||
|
||||
void EditorHelp::_help_callback(const String &p_topic) {
|
||||
String what = p_topic.get_slicec(':', 0);
|
||||
String clss = p_topic.get_slicec(':', 1);
|
||||
String name;
|
||||
if (p_topic.get_slice_count(":") == 3) {
|
||||
name = p_topic.get_slicec(':', 2);
|
||||
Vector<String> parts;
|
||||
{
|
||||
int from = 0;
|
||||
int buffer_start = 0;
|
||||
while (true) {
|
||||
const int pos = p_topic.find_char(':', from);
|
||||
if (pos < 0) {
|
||||
parts.push_back(p_topic.substr(buffer_start));
|
||||
break;
|
||||
}
|
||||
|
||||
if (pos + 1 < p_topic.length() && p_topic[pos + 1] == ':') {
|
||||
// `::` used in built-in scripts.
|
||||
from = pos + 2;
|
||||
} else {
|
||||
parts.push_back(p_topic.substr(buffer_start, pos - buffer_start));
|
||||
from = pos + 1;
|
||||
buffer_start = from;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const String what = parts[0]; // `parts` is always non-empty.
|
||||
const String clss = (parts.size() > 1) ? parts[1] : String();
|
||||
const String name = (parts.size() > 2) ? parts[2] : String();
|
||||
|
||||
_request_help(clss); // First go to class.
|
||||
|
||||
int line = 0;
|
||||
|
||||
Reference in New Issue
Block a user