summaryrefslogtreecommitdiff
path: root/editor/doc/doc_data.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/doc/doc_data.cpp')
-rw-r--r--editor/doc/doc_data.cpp33
1 files changed, 17 insertions, 16 deletions
diff --git a/editor/doc/doc_data.cpp b/editor/doc/doc_data.cpp
index 542dca74e0..91a29f5717 100644
--- a/editor/doc/doc_data.cpp
+++ b/editor/doc/doc_data.cpp
@@ -58,7 +58,7 @@ void DocData::merge_from(const DocData &p_data) {
for (int i = 0; i < c.methods.size(); i++) {
- MethodDoc &m = c.methods[i];
+ MethodDoc &m = c.methods.write[i];
for (int j = 0; j < cf.methods.size(); j++) {
@@ -72,13 +72,13 @@ void DocData::merge_from(const DocData &p_data) {
Vector<bool> arg_used;
arg_used.resize(arg_count);
for (int l = 0; l < arg_count; ++l)
- arg_used[l] = false;
+ arg_used.write[l] = false;
// also there is no guarantee that argument ordering will match, so we
// have to check one by one so we make sure we have an exact match
for (int k = 0; k < arg_count; ++k) {
for (int l = 0; l < arg_count; ++l)
if (cf.methods[j].arguments[k].type == m.arguments[l].type && !arg_used[l]) {
- arg_used[l] = true;
+ arg_used.write[l] = true;
break;
}
}
@@ -98,7 +98,7 @@ void DocData::merge_from(const DocData &p_data) {
for (int i = 0; i < c.signals.size(); i++) {
- MethodDoc &m = c.signals[i];
+ MethodDoc &m = c.signals.write[i];
for (int j = 0; j < cf.signals.size(); j++) {
@@ -113,7 +113,7 @@ void DocData::merge_from(const DocData &p_data) {
for (int i = 0; i < c.constants.size(); i++) {
- ConstantDoc &m = c.constants[i];
+ ConstantDoc &m = c.constants.write[i];
for (int j = 0; j < cf.constants.size(); j++) {
@@ -128,7 +128,7 @@ void DocData::merge_from(const DocData &p_data) {
for (int i = 0; i < c.properties.size(); i++) {
- PropertyDoc &p = c.properties[i];
+ PropertyDoc &p = c.properties.write[i];
for (int j = 0; j < cf.properties.size(); j++) {
@@ -146,7 +146,7 @@ void DocData::merge_from(const DocData &p_data) {
for (int i = 0; i < c.theme_properties.size(); i++) {
- PropertyDoc &p = c.theme_properties[i];
+ PropertyDoc &p = c.theme_properties.write[i];
for (int j = 0; j < cf.theme_properties.size(); j++) {
@@ -535,13 +535,14 @@ void DocData::generate(bool p_basic_types) {
}
List<StringName> constants;
- Variant::get_numeric_constants_for_type(Variant::Type(i), &constants);
+ Variant::get_constants_for_type(Variant::Type(i), &constants);
for (List<StringName>::Element *E = constants.front(); E; E = E->next()) {
ConstantDoc constant;
constant.name = E->get();
- constant.value = itos(Variant::get_numeric_constant_value(Variant::Type(i), E->get()));
+ Variant value = Variant::get_constant_value(Variant::Type(i), E->get());
+ constant.value = value.get_type() == Variant::INT ? itos(value) : value.get_construct_string();
c.constants.push_back(constant);
}
}
@@ -1020,7 +1021,7 @@ Error DocData::save_classes(const String &p_default_path, const Map<String, Stri
for (int i = 0; i < c.methods.size(); i++) {
- MethodDoc &m = c.methods[i];
+ const MethodDoc &m = c.methods[i];
String qualifiers;
if (m.qualifiers != "")
@@ -1040,7 +1041,7 @@ Error DocData::save_classes(const String &p_default_path, const Map<String, Stri
for (int j = 0; j < m.arguments.size(); j++) {
- ArgumentDoc &a = m.arguments[j];
+ const ArgumentDoc &a = m.arguments[j];
String enum_text;
if (a.enumeration != String()) {
@@ -1075,7 +1076,7 @@ Error DocData::save_classes(const String &p_default_path, const Map<String, Stri
if (c.properties[i].enumeration != String()) {
enum_text = " enum=\"" + c.properties[i].enumeration + "\"";
}
- PropertyDoc &p = c.properties[i];
+ const PropertyDoc &p = c.properties[i];
_write_string(f, 2, "<member name=\"" + p.name + "\" type=\"" + p.type + "\" setter=\"" + p.setter + "\" getter=\"" + p.getter + "\"" + enum_text + ">");
_write_string(f, 3, p.description.strip_edges().xml_escape());
_write_string(f, 2, "</member>");
@@ -1090,11 +1091,11 @@ Error DocData::save_classes(const String &p_default_path, const Map<String, Stri
_write_string(f, 1, "<signals>");
for (int i = 0; i < c.signals.size(); i++) {
- MethodDoc &m = c.signals[i];
+ const MethodDoc &m = c.signals[i];
_write_string(f, 2, "<signal name=\"" + m.name + "\">");
for (int j = 0; j < m.arguments.size(); j++) {
- ArgumentDoc &a = m.arguments[j];
+ const ArgumentDoc &a = m.arguments[j];
_write_string(f, 3, "<argument index=\"" + itos(j) + "\" name=\"" + a.name.xml_escape() + "\" type=\"" + a.type.xml_escape() + "\">");
_write_string(f, 3, "</argument>");
}
@@ -1113,7 +1114,7 @@ Error DocData::save_classes(const String &p_default_path, const Map<String, Stri
for (int i = 0; i < c.constants.size(); i++) {
- ConstantDoc &k = c.constants[i];
+ const ConstantDoc &k = c.constants[i];
if (k.enumeration != String()) {
_write_string(f, 2, "<constant name=\"" + k.name + "\" value=\"" + k.value + "\" enum=\"" + k.enumeration + "\">");
} else {
@@ -1132,7 +1133,7 @@ Error DocData::save_classes(const String &p_default_path, const Map<String, Stri
_write_string(f, 1, "<theme_items>");
for (int i = 0; i < c.theme_properties.size(); i++) {
- PropertyDoc &p = c.theme_properties[i];
+ const PropertyDoc &p = c.theme_properties[i];
_write_string(f, 2, "<theme_item name=\"" + p.name + "\" type=\"" + p.type + "\">");
_write_string(f, 2, "</theme_item>");
}