diff options
Diffstat (limited to 'editor/editor_help.cpp')
-rw-r--r-- | editor/editor_help.cpp | 74 |
1 files changed, 62 insertions, 12 deletions
diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index 26d793cf65..d1f765a312 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -48,9 +48,9 @@ void EditorHelp::_init_colors() { text_color = get_color("default_color", "RichTextLabel"); headline_color = get_color("headline_color", "EditorHelp"); base_type_color = title_color.linear_interpolate(text_color, 0.5); - comment_color = text_color * Color(1, 1, 1, 0.6); + comment_color = text_color * Color(1, 1, 1, 0.4); symbol_color = comment_color; - value_color = text_color * Color(1, 1, 1, 0.4); + value_color = text_color * Color(1, 1, 1, 0.6); qualifier_color = text_color * Color(1, 1, 1, 0.8); type_color = get_color("accent_color", "Editor").linear_interpolate(text_color, 0.5); class_desc->add_color_override("selection_color", get_color("accent_color", "Editor") * Color(1, 1, 1, 0.4)); @@ -258,9 +258,11 @@ void EditorHelp::_add_method(const DocData::MethodDoc &p_method, bool p_overview if (p_method.arguments[j].default_value != "") { class_desc->push_color(symbol_color); - class_desc->add_text("="); + class_desc->add_text(" = "); class_desc->pop(); + class_desc->push_color(value_color); _add_text(_fix_constant(p_method.arguments[j].default_value)); + class_desc->pop(); } class_desc->pop(); @@ -389,7 +391,6 @@ void EditorHelp::_update_doc() { if (prev) { class_desc->add_text(" , "); - prev = false; } _add_type(E->get().name); @@ -416,6 +417,7 @@ void EditorHelp::_update_doc() { class_desc->pop(); class_desc->add_newline(); + class_desc->add_newline(); class_desc->push_color(text_color); class_desc->push_font(doc_font); class_desc->push_indent(1); @@ -441,6 +443,7 @@ void EditorHelp::_update_doc() { class_desc->pop(); class_desc->pop(); + class_desc->add_newline(); class_desc->push_indent(1); class_desc->push_table(2); class_desc->set_table_column_expand(1, 1); @@ -470,13 +473,15 @@ void EditorHelp::_update_doc() { if (cd.properties[i].description != "") { describe = true; } + class_desc->push_cell(); + class_desc->push_font(doc_code_font); + class_desc->push_color(headline_color); + if (describe) { class_desc->push_meta("@member " + cd.properties[i].name); } - class_desc->push_font(doc_code_font); - class_desc->push_color(headline_color); _add_text(cd.properties[i].name); if (describe) { @@ -484,8 +489,21 @@ void EditorHelp::_update_doc() { property_descr = true; } + if (cd.properties[i].default_value != "") { + class_desc->push_color(symbol_color); + class_desc->add_text(" [default: "); + class_desc->pop(); + class_desc->push_color(value_color); + _add_text(_fix_constant(cd.properties[i].default_value)); + class_desc->pop(); + class_desc->push_color(symbol_color); + class_desc->add_text("]"); + class_desc->pop(); + } + class_desc->pop(); class_desc->pop(); + class_desc->pop(); } @@ -519,6 +537,7 @@ void EditorHelp::_update_doc() { class_desc->pop(); class_desc->pop(); + class_desc->add_newline(); class_desc->push_font(doc_code_font); class_desc->push_indent(1); class_desc->push_table(2); @@ -540,7 +559,6 @@ void EditorHelp::_update_doc() { class_desc->pop(); //cell class_desc->push_cell(); class_desc->pop(); //cell - any_previous = false; } String group_prefix; @@ -611,6 +629,19 @@ void EditorHelp::_update_doc() { class_desc->push_color(headline_color); _add_text(cd.theme_properties[i].name); class_desc->pop(); + + if (cd.theme_properties[i].default_value != "") { + class_desc->push_color(symbol_color); + class_desc->add_text(" [default: "); + class_desc->pop(); + class_desc->push_color(value_color); + _add_text(_fix_constant(cd.theme_properties[i].default_value)); + class_desc->pop(); + class_desc->push_color(symbol_color); + class_desc->add_text("]"); + class_desc->pop(); + } + class_desc->pop(); if (cd.theme_properties[i].description != "") { @@ -669,7 +700,7 @@ void EditorHelp::_update_doc() { if (cd.signals[i].arguments[j].default_value != "") { class_desc->push_color(symbol_color); - class_desc->add_text("="); + class_desc->add_text(" = "); class_desc->pop(); _add_text(cd.signals[i].arguments[j].default_value); } @@ -775,7 +806,7 @@ void EditorHelp::_update_doc() { class_desc->add_text(" = "); class_desc->pop(); class_desc->push_color(value_color); - _add_text(enum_list[i].value); + _add_text(_fix_constant(enum_list[i].value)); class_desc->pop(); class_desc->pop(); if (enum_list[i].description != "") { @@ -841,7 +872,7 @@ void EditorHelp::_update_doc() { class_desc->add_text(" = "); class_desc->pop(); class_desc->push_color(value_color); - _add_text(constants[i].value); + _add_text(_fix_constant(constants[i].value)); class_desc->pop(); class_desc->pop(); @@ -876,6 +907,7 @@ void EditorHelp::_update_doc() { class_desc->pop(); class_desc->add_newline(); + class_desc->add_newline(); class_desc->push_color(text_color); class_desc->push_font(doc_font); class_desc->push_indent(1); @@ -960,6 +992,21 @@ void EditorHelp::_update_doc() { class_desc->push_color(headline_color); _add_text(cd.properties[i].name); class_desc->pop(); // color + + if (cd.properties[i].default_value != "") { + class_desc->push_color(symbol_color); + class_desc->add_text(" [default: "); + class_desc->pop(); // color + + class_desc->push_color(value_color); + _add_text(_fix_constant(cd.properties[i].default_value)); + class_desc->pop(); // color + + class_desc->push_color(symbol_color); + class_desc->add_text("]"); + class_desc->pop(); // color + } + class_desc->pop(); // font class_desc->pop(); // cell @@ -1000,6 +1047,7 @@ void EditorHelp::_update_doc() { class_desc->pop(); // table class_desc->add_newline(); + class_desc->add_newline(); class_desc->push_color(text_color); class_desc->push_font(doc_font); @@ -1042,6 +1090,8 @@ void EditorHelp::_update_doc() { class_desc->pop(); class_desc->add_newline(); + class_desc->add_newline(); + class_desc->push_color(text_color); class_desc->push_font(doc_font); class_desc->push_indent(1); @@ -1284,7 +1334,7 @@ static void _add_text_to_rt(const String &p_bbcode, RichTextLabel *p_rt) { end = bbcode.length(); String image = bbcode.substr(brk_end + 1, end - brk_end - 1); - Ref<Texture> texture = ResourceLoader::load(base_path + "/" + image, "Texture"); + Ref<Texture> texture = ResourceLoader::load(base_path.plus_file(image), "Texture"); if (texture.is_valid()) p_rt->add_image(texture); @@ -1340,7 +1390,7 @@ static void _add_text_to_rt(const String &p_bbcode, RichTextLabel *p_rt) { String fnt = tag.substr(5, tag.length()); - Ref<Font> font = ResourceLoader::load(base_path + "/" + fnt, "Font"); + Ref<Font> font = ResourceLoader::load(base_path.plus_file(fnt), "Font"); if (font.is_valid()) p_rt->push_font(font); else { |