summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/gdnative/gdnative/pool_arrays.cpp35
-rw-r--r--modules/gdnative/gdnative_api.json49
-rw-r--r--modules/gdnative/include/gdnative/pool_arrays.h14
-rw-r--r--modules/gdscript/doc_classes/@GDScript.xml2
-rw-r--r--modules/gdscript/gdscript.cpp4
-rw-r--r--modules/gdscript/gdscript_function.cpp4
-rw-r--r--modules/gdscript/gdscript_functions.cpp1
-rw-r--r--modules/visual_script/visual_script.cpp1
-rw-r--r--modules/visual_script/visual_script_editor.cpp4
9 files changed, 107 insertions, 7 deletions
diff --git a/modules/gdnative/gdnative/pool_arrays.cpp b/modules/gdnative/gdnative/pool_arrays.cpp
index 74c540ca14..23791af67e 100644
--- a/modules/gdnative/gdnative/pool_arrays.cpp
+++ b/modules/gdnative/gdnative/pool_arrays.cpp
@@ -129,6 +129,11 @@ godot_int GDAPI godot_pool_byte_array_size(const godot_pool_byte_array *p_self)
return self->size();
}
+godot_bool GDAPI godot_pool_byte_array_empty(const godot_pool_byte_array *p_self) {
+ const PoolVector<uint8_t> *self = (const PoolVector<uint8_t> *)p_self;
+ return self->empty();
+}
+
void GDAPI godot_pool_byte_array_destroy(godot_pool_byte_array *p_self) {
((PoolVector<uint8_t> *)p_self)->~PoolVector();
}
@@ -218,6 +223,11 @@ godot_int GDAPI godot_pool_int_array_size(const godot_pool_int_array *p_self) {
return self->size();
}
+godot_bool GDAPI godot_pool_int_array_empty(const godot_pool_int_array *p_self) {
+ const PoolVector<godot_int> *self = (const PoolVector<godot_int> *)p_self;
+ return self->empty();
+}
+
void GDAPI godot_pool_int_array_destroy(godot_pool_int_array *p_self) {
((PoolVector<godot_int> *)p_self)->~PoolVector();
}
@@ -307,6 +317,11 @@ godot_int GDAPI godot_pool_real_array_size(const godot_pool_real_array *p_self)
return self->size();
}
+godot_bool GDAPI godot_pool_real_array_empty(const godot_pool_real_array *p_self) {
+ const PoolVector<godot_real> *self = (const PoolVector<godot_real> *)p_self;
+ return self->empty();
+}
+
void GDAPI godot_pool_real_array_destroy(godot_pool_real_array *p_self) {
((PoolVector<godot_real> *)p_self)->~PoolVector();
}
@@ -404,6 +419,11 @@ godot_int GDAPI godot_pool_string_array_size(const godot_pool_string_array *p_se
return self->size();
}
+godot_bool GDAPI godot_pool_string_array_empty(const godot_pool_string_array *p_self) {
+ const PoolVector<String> *self = (const PoolVector<String> *)p_self;
+ return self->empty();
+}
+
void GDAPI godot_pool_string_array_destroy(godot_pool_string_array *p_self) {
((PoolVector<String> *)p_self)->~PoolVector();
}
@@ -500,6 +520,11 @@ godot_int GDAPI godot_pool_vector2_array_size(const godot_pool_vector2_array *p_
return self->size();
}
+godot_bool GDAPI godot_pool_vector2_array_empty(const godot_pool_vector2_array *p_self) {
+ const PoolVector<Vector2> *self = (const PoolVector<Vector2> *)p_self;
+ return self->empty();
+}
+
void GDAPI godot_pool_vector2_array_destroy(godot_pool_vector2_array *p_self) {
((PoolVector<Vector2> *)p_self)->~PoolVector();
}
@@ -596,6 +621,11 @@ godot_int GDAPI godot_pool_vector3_array_size(const godot_pool_vector3_array *p_
return self->size();
}
+godot_bool GDAPI godot_pool_vector3_array_empty(const godot_pool_vector3_array *p_self) {
+ const PoolVector<Vector3> *self = (const PoolVector<Vector3> *)p_self;
+ return self->empty();
+}
+
void GDAPI godot_pool_vector3_array_destroy(godot_pool_vector3_array *p_self) {
((PoolVector<Vector3> *)p_self)->~PoolVector();
}
@@ -692,6 +722,11 @@ godot_int GDAPI godot_pool_color_array_size(const godot_pool_color_array *p_self
return self->size();
}
+godot_bool GDAPI godot_pool_color_array_empty(const godot_pool_color_array *p_self) {
+ const PoolVector<Color> *self = (const PoolVector<Color> *)p_self;
+ return self->empty();
+}
+
void GDAPI godot_pool_color_array_destroy(godot_pool_color_array *p_self) {
((PoolVector<Color> *)p_self)->~PoolVector();
}
diff --git a/modules/gdnative/gdnative_api.json b/modules/gdnative/gdnative_api.json
index 55ba4ecc1e..9e5295a936 100644
--- a/modules/gdnative/gdnative_api.json
+++ b/modules/gdnative/gdnative_api.json
@@ -91,6 +91,55 @@
["const godot_int", "p_step"],
["const godot_bool", "p_deep"]
]
+ },
+ {
+ "name": "godot_pool_byte_array_empty",
+ "return_type": "godot_bool",
+ "arguments": [
+ ["const godot_pool_byte_array *", "p_self"]
+ ]
+ },
+ {
+ "name": "godot_pool_int_array_empty",
+ "return_type": "godot_bool",
+ "arguments": [
+ ["const godot_pool_int_array *", "p_self"]
+ ]
+ },
+ {
+ "name": "godot_pool_real_array_empty",
+ "return_type": "godot_bool",
+ "arguments": [
+ ["const godot_pool_real_array *", "p_self"]
+ ]
+ },
+ {
+ "name": "godot_pool_string_array_empty",
+ "return_type": "godot_bool",
+ "arguments": [
+ ["const godot_pool_string_array *", "p_self"]
+ ]
+ },
+ {
+ "name": "godot_pool_vector2_array_empty",
+ "return_type": "godot_bool",
+ "arguments": [
+ ["const godot_pool_vector2_array *", "p_self"]
+ ]
+ },
+ {
+ "name": "godot_pool_vector3_array_empty",
+ "return_type": "godot_bool",
+ "arguments": [
+ ["const godot_pool_vector3_array *", "p_self"]
+ ]
+ },
+ {
+ "name": "godot_pool_color_array_empty",
+ "return_type": "godot_bool",
+ "arguments": [
+ ["const godot_pool_color_array *", "p_self"]
+ ]
}
]
},
diff --git a/modules/gdnative/include/gdnative/pool_arrays.h b/modules/gdnative/include/gdnative/pool_arrays.h
index 96730ab085..63e8267f0e 100644
--- a/modules/gdnative/include/gdnative/pool_arrays.h
+++ b/modules/gdnative/include/gdnative/pool_arrays.h
@@ -191,6 +191,8 @@ uint8_t GDAPI godot_pool_byte_array_get(const godot_pool_byte_array *p_self, con
godot_int GDAPI godot_pool_byte_array_size(const godot_pool_byte_array *p_self);
+godot_bool GDAPI godot_pool_byte_array_empty(const godot_pool_byte_array *p_self);
+
void GDAPI godot_pool_byte_array_destroy(godot_pool_byte_array *p_self);
// int
@@ -222,6 +224,8 @@ godot_int GDAPI godot_pool_int_array_get(const godot_pool_int_array *p_self, con
godot_int GDAPI godot_pool_int_array_size(const godot_pool_int_array *p_self);
+godot_bool GDAPI godot_pool_int_array_empty(const godot_pool_int_array *p_self);
+
void GDAPI godot_pool_int_array_destroy(godot_pool_int_array *p_self);
// real
@@ -253,6 +257,8 @@ godot_real GDAPI godot_pool_real_array_get(const godot_pool_real_array *p_self,
godot_int GDAPI godot_pool_real_array_size(const godot_pool_real_array *p_self);
+godot_bool GDAPI godot_pool_real_array_empty(const godot_pool_real_array *p_self);
+
void GDAPI godot_pool_real_array_destroy(godot_pool_real_array *p_self);
// string
@@ -284,6 +290,8 @@ godot_string GDAPI godot_pool_string_array_get(const godot_pool_string_array *p_
godot_int GDAPI godot_pool_string_array_size(const godot_pool_string_array *p_self);
+godot_bool GDAPI godot_pool_string_array_empty(const godot_pool_string_array *p_self);
+
void GDAPI godot_pool_string_array_destroy(godot_pool_string_array *p_self);
// vector2
@@ -315,6 +323,8 @@ godot_vector2 GDAPI godot_pool_vector2_array_get(const godot_pool_vector2_array
godot_int GDAPI godot_pool_vector2_array_size(const godot_pool_vector2_array *p_self);
+godot_bool GDAPI godot_pool_vector2_array_empty(const godot_pool_vector2_array *p_self);
+
void GDAPI godot_pool_vector2_array_destroy(godot_pool_vector2_array *p_self);
// vector3
@@ -346,6 +356,8 @@ godot_vector3 GDAPI godot_pool_vector3_array_get(const godot_pool_vector3_array
godot_int GDAPI godot_pool_vector3_array_size(const godot_pool_vector3_array *p_self);
+godot_bool GDAPI godot_pool_vector3_array_empty(const godot_pool_vector3_array *p_self);
+
void GDAPI godot_pool_vector3_array_destroy(godot_pool_vector3_array *p_self);
// color
@@ -377,6 +389,8 @@ godot_color GDAPI godot_pool_color_array_get(const godot_pool_color_array *p_sel
godot_int GDAPI godot_pool_color_array_size(const godot_pool_color_array *p_self);
+godot_bool GDAPI godot_pool_color_array_empty(const godot_pool_color_array *p_self);
+
void GDAPI godot_pool_color_array_destroy(godot_pool_color_array *p_self);
//
diff --git a/modules/gdscript/doc_classes/@GDScript.xml b/modules/gdscript/doc_classes/@GDScript.xml
index 1d0567dd8d..f96c4f28c8 100644
--- a/modules/gdscript/doc_classes/@GDScript.xml
+++ b/modules/gdscript/doc_classes/@GDScript.xml
@@ -21,7 +21,7 @@
<argument index="3" name="a8" type="int" default="255">
</argument>
<description>
- Returns a 32 bit color with red, green, blue and alpha channels. Each channel has 8 bits of information ranging from 0 to 255.
+ Returns a color constructed from integer red, green, blue, and alpha channels. Each channel should have 8 bits of information ranging from 0 to 255.
[code]r8[/code] red channel
[code]g8[/code] green channel
[code]b8[/code] blue channel
diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp
index db7f8d22e6..edb296437b 100644
--- a/modules/gdscript/gdscript.cpp
+++ b/modules/gdscript/gdscript.cpp
@@ -199,7 +199,7 @@ StringName GDScript::get_instance_base_type() const {
if (native.is_valid())
return native->get_name();
- if (base.is_valid())
+ if (base.is_valid() && base->is_valid())
return base->get_instance_base_type();
return StringName();
}
@@ -486,7 +486,7 @@ bool GDScript::_update_exports() {
placeholder_fallback_enabled = false;
- if (base_cache.is_valid()) {
+ if (base_cache.is_valid() && base_cache->is_valid()) {
if (base_cache->_update_exports()) {
changed = true;
}
diff --git a/modules/gdscript/gdscript_function.cpp b/modules/gdscript/gdscript_function.cpp
index 83d02e4977..d8816726ce 100644
--- a/modules/gdscript/gdscript_function.cpp
+++ b/modules/gdscript/gdscript_function.cpp
@@ -1561,14 +1561,14 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
//error
// function, file, line, error, explanation
String err_file;
- if (p_instance && p_instance->script->is_valid() && p_instance->script->path != "")
+ if (p_instance && ObjectDB::instance_validate(p_instance->owner) && p_instance->script->is_valid() && p_instance->script->path != "")
err_file = p_instance->script->path;
else if (script)
err_file = script->path;
if (err_file == "")
err_file = "<built-in>";
String err_func = name;
- if (p_instance && p_instance->script->is_valid() && p_instance->script->name != "")
+ if (p_instance && ObjectDB::instance_validate(p_instance->owner) && p_instance->script->is_valid() && p_instance->script->name != "")
err_func = p_instance->script->name + "." + err_func;
int err_line = line;
if (err_text == "") {
diff --git a/modules/gdscript/gdscript_functions.cpp b/modules/gdscript/gdscript_functions.cpp
index c4c7ba5ef7..185eb6c3fc 100644
--- a/modules/gdscript/gdscript_functions.cpp
+++ b/modules/gdscript/gdscript_functions.cpp
@@ -1274,6 +1274,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
if (err != OK) {
r_ret = Variant();
+ ERR_PRINTS(vformat("Error parsing JSON at line %s: %s", errl, errs));
}
} break;
diff --git a/modules/visual_script/visual_script.cpp b/modules/visual_script/visual_script.cpp
index 0cacd0f0b5..bb8612af6f 100644
--- a/modules/visual_script/visual_script.cpp
+++ b/modules/visual_script/visual_script.cpp
@@ -1361,6 +1361,7 @@ void VisualScript::_bind_methods() {
VisualScript::VisualScript() {
base_type = "Object";
+ is_tool_script = false;
}
StringName VisualScript::get_default_func() const {
diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp
index ca0d77f047..0db771f7c0 100644
--- a/modules/visual_script/visual_script_editor.cpp
+++ b/modules/visual_script/visual_script_editor.cpp
@@ -4221,7 +4221,7 @@ void VisualScriptEditor::_menu_option(int p_what) {
if (nd.is_valid() && nd->has_input_sequence_port())
start_node = nodes.front()->key();
else {
- EditorNode::get_singleton()->show_warning(TTR("Select atleast one node with sequence port."));
+ EditorNode::get_singleton()->show_warning(TTR("Select at least one node with sequence port."));
return;
}
} else {
@@ -4252,7 +4252,7 @@ void VisualScriptEditor::_menu_option(int p_what) {
if (nd.is_valid() && nd->has_input_sequence_port())
start_node = top_nd;
else {
- EditorNode::get_singleton()->show_warning(TTR("Select atleast one node with sequence port."));
+ EditorNode::get_singleton()->show_warning(TTR("Select at least one node with sequence port."));
return;
}
} else {