summaryrefslogtreecommitdiff
path: root/editor/editor_help.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-12-13 20:13:01 +0100
committerGitHub <noreply@github.com>2019-12-13 20:13:01 +0100
commitd14f1947a432f3d62641bb95316313c569f71b30 (patch)
tree65f0e0a0ac1a8a30118d650f87b711083ce113f3 /editor/editor_help.cpp
parent81f513ddc6faf16c5e3d08c0637b188003f194c3 (diff)
parent249c2c4615c486696e997ea5af1a507a3f761522 (diff)
Merge pull request #34327 from timothyqiu/types-doc
Makes int and bool types clickable in documentation
Diffstat (limited to 'editor/editor_help.cpp')
-rw-r--r--editor/editor_help.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp
index 4f7432cd65..9b7f255e46 100644
--- a/editor/editor_help.cpp
+++ b/editor/editor_help.cpp
@@ -185,11 +185,11 @@ void EditorHelp::_class_desc_resized() {
void EditorHelp::_add_type(const String &p_type, const String &p_enum) {
String t = p_type;
- if (t == "")
+ if (t.empty())
t = "void";
- bool can_ref = (t != "int" && t != "real" && t != "bool" && t != "void") || p_enum != String();
+ bool can_ref = (t != "void") || !p_enum.empty();
- if (p_enum != String()) {
+ if (!p_enum.empty()) {
if (p_enum.get_slice_count(".") > 1) {
t = p_enum.get_slice(".", 1);
} else {
@@ -200,7 +200,7 @@ void EditorHelp::_add_type(const String &p_type, const String &p_enum) {
const Color type_color = get_color("accent_color", "Editor").linear_interpolate(text_color, 0.5);
class_desc->push_color(type_color);
if (can_ref) {
- if (p_enum == "") {
+ if (p_enum.empty()) {
class_desc->push_meta("#" + t); //class
} else {
class_desc->push_meta("$" + p_enum); //class