summaryrefslogtreecommitdiff
path: root/editor/editor_help.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_help.cpp')
-rw-r--r--editor/editor_help.cpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp
index d2883cab07..198a52fef2 100644
--- a/editor/editor_help.cpp
+++ b/editor/editor_help.cpp
@@ -37,6 +37,8 @@
#include "os/keyboard.h"
#define CONTRIBUTE_URL "http://docs.godotengine.org/en/latest/community/contributing/updating_the_class_reference.html"
+#define CONTRIBUTE2_URL "https://github.com/godotengine/godot-docs"
+#define REQUEST_URL "https://github.com/godotengine/godot-docs/issues/new"
void EditorHelpSearch::popup() {
@@ -1290,6 +1292,46 @@ Error EditorHelp::_goto_desc(const String &p_class, int p_vscr) {
class_desc->add_newline();
}
+ {
+
+ class_desc->push_color(title_color);
+ class_desc->push_font(doc_title_font);
+ class_desc->add_text(TTR("Online Tutorials:"));
+ class_desc->pop();
+ class_desc->pop();
+ class_desc->push_indent(1);
+
+ class_desc->push_font(doc_code_font);
+
+ class_desc->add_newline();
+ // class_desc->add_newline();
+
+ Vector<String> tutorials = cd.tutorials.split_spaces();
+ if (tutorials.size() != 0) {
+
+ for (int i = 0; i < tutorials.size(); i++) {
+ String link = tutorials[i];
+ String linktxt = link;
+ int seppos = linktxt.find("//");
+ if (seppos != -1) {
+ linktxt = link.right(seppos + 2);
+ }
+
+ class_desc->push_color(symbol_color);
+ class_desc->append_bbcode("[url=" + link + "]" + linktxt + "[/url]");
+ class_desc->pop();
+ class_desc->add_newline();
+ }
+ } else {
+ class_desc->push_color(comment_color);
+ class_desc->append_bbcode(TTR("There are currently no tutorials for this class, you can [color=$color][url=$url]contribute one[/url][/color] or [color=$color][url=$url2]request one[/url][/color].").replace("$url2", REQUEST_URL).replace("$url", CONTRIBUTE2_URL).replace("$color", link_color_text));
+ class_desc->pop();
+ }
+ class_desc->pop();
+ class_desc->pop();
+ class_desc->add_newline();
+ class_desc->add_newline();
+ }
if (property_descr) {
section_line.push_back(Pair<String, int>(TTR("Properties"), class_desc->get_line_count() - 2));