You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-11 13:10:58 +00:00
Allow some non-integer built-in constants in gdscript
This commit is contained in:
@@ -1214,6 +1214,18 @@ Error EditorHelp::_goto_desc(const String &p_class, int p_vscr) {
|
||||
|
||||
constant_line[constants[i].name] = class_desc->get_line_count() - 2;
|
||||
class_desc->push_font(doc_code_font);
|
||||
|
||||
if (constants[i].value.begins_with("Color(") && constants[i].value.ends_with(")")) {
|
||||
String stripped = constants[i].value.replace(" ", "").replace("Color(", "").replace(")", "");
|
||||
Vector<float> color = stripped.split_floats(",");
|
||||
if (color.size() >= 3) {
|
||||
class_desc->push_color(Color(color[0], color[1], color[2]));
|
||||
static const CharType prefix[3] = { 0x25CF /* filled circle */, ' ', 0 };
|
||||
class_desc->add_text(String(prefix));
|
||||
class_desc->pop();
|
||||
}
|
||||
}
|
||||
|
||||
class_desc->push_color(headline_color);
|
||||
_add_text(constants[i].name);
|
||||
class_desc->pop();
|
||||
@@ -1223,6 +1235,7 @@ Error EditorHelp::_goto_desc(const String &p_class, int p_vscr) {
|
||||
class_desc->push_color(value_color);
|
||||
_add_text(constants[i].value);
|
||||
class_desc->pop();
|
||||
|
||||
class_desc->pop();
|
||||
if (constants[i].description != "") {
|
||||
class_desc->push_font(doc_font);
|
||||
|
||||
Reference in New Issue
Block a user