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.cpp56
1 files changed, 35 insertions, 21 deletions
diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp
index e6df00b48c..2b58d105de 100644
--- a/editor/editor_help.cpp
+++ b/editor/editor_help.cpp
@@ -30,6 +30,7 @@
#include "editor_help.h"
+#include "core/os/input.h"
#include "core/os/keyboard.h"
#include "doc_data_compressed.gen.h"
#include "editor/plugins/script_editor_plugin.h"
@@ -257,16 +258,17 @@ void EditorHelp::_add_method(const DocData::MethodDoc &p_method, bool p_overview
}
class_desc->push_color(symbol_color);
- class_desc->add_text(p_method.arguments.size() || is_vararg ? "( " : "(");
+ class_desc->add_text("(");
class_desc->pop();
for (int j = 0; j < p_method.arguments.size(); j++) {
class_desc->push_color(text_color);
if (j > 0)
class_desc->add_text(", ");
- _add_type(p_method.arguments[j].type, p_method.arguments[j].enumeration);
- class_desc->add_text(" ");
+
_add_text(p_method.arguments[j].name);
+ class_desc->add_text(": ");
+ _add_type(p_method.arguments[j].type, p_method.arguments[j].enumeration);
if (p_method.arguments[j].default_value != "") {
class_desc->push_color(symbol_color);
@@ -291,7 +293,7 @@ void EditorHelp::_add_method(const DocData::MethodDoc &p_method, bool p_overview
}
class_desc->push_color(symbol_color);
- class_desc->add_text(p_method.arguments.size() || is_vararg ? " )" : ")");
+ class_desc->add_text(")");
class_desc->pop();
if (p_method.qualifiers != "") {
@@ -424,7 +426,7 @@ void EditorHelp::_update_doc() {
class_desc->push_color(title_color);
class_desc->push_font(doc_title_font);
- class_desc->add_text(TTR("Brief Description:"));
+ class_desc->add_text(TTR("Brief Description"));
class_desc->pop();
class_desc->pop();
@@ -451,7 +453,7 @@ void EditorHelp::_update_doc() {
section_line.push_back(Pair<String, int>(TTR("Properties"), class_desc->get_line_count() - 2));
class_desc->push_color(title_color);
class_desc->push_font(doc_title_font);
- class_desc->add_text(TTR("Properties:"));
+ class_desc->add_text(TTR("Properties"));
class_desc->pop();
class_desc->pop();
@@ -487,6 +489,10 @@ void EditorHelp::_update_doc() {
describe = true;
}
+ if (cd.properties[i].overridden) {
+ describe = false;
+ }
+
class_desc->push_cell();
class_desc->push_font(doc_code_font);
class_desc->push_color(headline_color);
@@ -504,7 +510,7 @@ void EditorHelp::_update_doc() {
if (cd.properties[i].default_value != "") {
class_desc->push_color(symbol_color);
- class_desc->add_text(" [default: ");
+ class_desc->add_text(cd.properties[i].overridden ? " [override: " : " [default: ");
class_desc->pop();
class_desc->push_color(value_color);
_add_text(_fix_constant(cd.properties[i].default_value));
@@ -547,7 +553,7 @@ void EditorHelp::_update_doc() {
section_line.push_back(Pair<String, int>(TTR("Methods"), class_desc->get_line_count() - 2));
class_desc->push_color(title_color);
class_desc->push_font(doc_title_font);
- class_desc->add_text(TTR("Methods:"));
+ class_desc->add_text(TTR("Methods"));
class_desc->pop();
class_desc->pop();
@@ -618,7 +624,7 @@ void EditorHelp::_update_doc() {
section_line.push_back(Pair<String, int>(TTR("Theme Properties"), class_desc->get_line_count() - 2));
class_desc->push_color(title_color);
class_desc->push_font(doc_title_font);
- class_desc->add_text(TTR("Theme Properties:"));
+ class_desc->add_text(TTR("Theme Properties"));
class_desc->pop();
class_desc->pop();
@@ -685,7 +691,7 @@ void EditorHelp::_update_doc() {
section_line.push_back(Pair<String, int>(TTR("Signals"), class_desc->get_line_count() - 2));
class_desc->push_color(title_color);
class_desc->push_font(doc_title_font);
- class_desc->add_text(TTR("Signals:"));
+ class_desc->add_text(TTR("Signals"));
class_desc->pop();
class_desc->pop();
@@ -702,15 +708,16 @@ void EditorHelp::_update_doc() {
_add_text(cd.signals[i].name);
class_desc->pop();
class_desc->push_color(symbol_color);
- class_desc->add_text(cd.signals[i].arguments.size() ? "( " : "(");
+ class_desc->add_text("(");
class_desc->pop();
for (int j = 0; j < cd.signals[i].arguments.size(); j++) {
class_desc->push_color(text_color);
if (j > 0)
class_desc->add_text(", ");
- _add_type(cd.signals[i].arguments[j].type);
- class_desc->add_text(" ");
+
_add_text(cd.signals[i].arguments[j].name);
+ class_desc->add_text(": ");
+ _add_type(cd.signals[i].arguments[j].type);
if (cd.signals[i].arguments[j].default_value != "") {
class_desc->push_color(symbol_color);
@@ -723,7 +730,7 @@ void EditorHelp::_update_doc() {
}
class_desc->push_color(symbol_color);
- class_desc->add_text(cd.signals[i].arguments.size() ? " )" : ")");
+ class_desc->add_text(")");
class_desc->pop();
class_desc->pop(); // end monofont
if (cd.signals[i].description != "") {
@@ -770,7 +777,7 @@ void EditorHelp::_update_doc() {
section_line.push_back(Pair<String, int>(TTR("Enumerations"), class_desc->get_line_count() - 2));
class_desc->push_color(title_color);
class_desc->push_font(doc_title_font);
- class_desc->add_text(TTR("Enumerations:"));
+ class_desc->add_text(TTR("Enumerations"));
class_desc->pop();
class_desc->pop();
class_desc->push_indent(1);
@@ -856,7 +863,7 @@ void EditorHelp::_update_doc() {
section_line.push_back(Pair<String, int>(TTR("Constants"), class_desc->get_line_count() - 2));
class_desc->push_color(title_color);
class_desc->push_font(doc_title_font);
- class_desc->add_text(TTR("Constants:"));
+ class_desc->add_text(TTR("Constants"));
class_desc->pop();
class_desc->pop();
class_desc->push_indent(1);
@@ -916,7 +923,7 @@ void EditorHelp::_update_doc() {
description_line = class_desc->get_line_count() - 2;
class_desc->push_color(title_color);
class_desc->push_font(doc_title_font);
- class_desc->add_text(TTR("Class Description:"));
+ class_desc->add_text(TTR("Class Description"));
class_desc->pop();
class_desc->pop();
@@ -938,7 +945,7 @@ void EditorHelp::_update_doc() {
{
class_desc->push_color(title_color);
class_desc->push_font(doc_title_font);
- class_desc->add_text(TTR("Online Tutorials:"));
+ class_desc->add_text(TTR("Online Tutorials"));
class_desc->pop();
class_desc->pop();
class_desc->push_indent(1);
@@ -980,7 +987,7 @@ void EditorHelp::_update_doc() {
section_line.push_back(Pair<String, int>(TTR("Property Descriptions"), class_desc->get_line_count() - 2));
class_desc->push_color(title_color);
class_desc->push_font(doc_title_font);
- class_desc->add_text(TTR("Property Descriptions:"));
+ class_desc->add_text(TTR("Property Descriptions"));
class_desc->pop();
class_desc->pop();
@@ -989,6 +996,9 @@ void EditorHelp::_update_doc() {
for (int i = 0; i < cd.properties.size(); i++) {
+ if (cd.properties[i].overridden)
+ continue;
+
property_line[cd.properties[i].name] = class_desc->get_line_count() - 2;
class_desc->push_table(2);
@@ -1090,7 +1100,7 @@ void EditorHelp::_update_doc() {
section_line.push_back(Pair<String, int>(TTR("Method Descriptions"), class_desc->get_line_count() - 2));
class_desc->push_color(title_color);
class_desc->push_font(doc_title_font);
- class_desc->add_text(TTR("Method Descriptions:"));
+ class_desc->add_text(TTR("Method Descriptions"));
class_desc->pop();
class_desc->pop();
@@ -1807,5 +1817,9 @@ void FindBar::_search_text_changed(const String &p_text) {
void FindBar::_search_text_entered(const String &p_text) {
- search_next();
+ if (Input::get_singleton()->is_key_pressed(KEY_SHIFT)) {
+ search_prev();
+ } else {
+ search_next();
+ }
}