summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorYuri Sizov <yuris@humnom.net>2022-08-12 23:57:11 +0300
committerYuri Sizov <yuris@humnom.net>2022-08-22 18:35:11 +0300
commit1a24c9e14bf1f9578eda338344c12faf66fb0e65 (patch)
treeada6f4deefe627b4a77133ef3c074e35d6f2a738 /modules
parentfdc36ad08290a8453d26fce3d8b7b13bd8cd5a1a (diff)
Make `_validate_property` a multilevel method
Diffstat (limited to 'modules')
-rw-r--r--modules/csg/csg_shape.cpp27
-rw-r--r--modules/csg/csg_shape.h4
-rw-r--r--modules/noise/fastnoise_lite.cpp18
-rw-r--r--modules/noise/fastnoise_lite.h2
-rw-r--r--modules/noise/noise_texture.cpp10
-rw-r--r--modules/noise/noise_texture.h2
-rw-r--r--modules/visual_script/visual_script_func_nodes.cpp194
-rw-r--r--modules/visual_script/visual_script_func_nodes.h8
-rw-r--r--modules/visual_script/visual_script_nodes.cpp74
-rw-r--r--modules/visual_script/visual_script_nodes.h20
-rw-r--r--modules/visual_script/visual_script_yield_nodes.cpp24
-rw-r--r--modules/visual_script/visual_script_yield_nodes.h4
12 files changed, 192 insertions, 195 deletions
diff --git a/modules/csg/csg_shape.cpp b/modules/csg/csg_shape.cpp
index 7fc6608770..457d1288f1 100644
--- a/modules/csg/csg_shape.cpp
+++ b/modules/csg/csg_shape.cpp
@@ -584,15 +584,14 @@ bool CSGShape3D::is_calculating_tangents() const {
return calculate_tangents;
}
-void CSGShape3D::_validate_property(PropertyInfo &property) const {
- bool is_collision_prefixed = property.name.begins_with("collision_");
- if ((is_collision_prefixed || property.name.begins_with("use_collision")) && is_inside_tree() && !is_root_shape()) {
+void CSGShape3D::_validate_property(PropertyInfo &p_property) const {
+ bool is_collision_prefixed = p_property.name.begins_with("collision_");
+ if ((is_collision_prefixed || p_property.name.begins_with("use_collision")) && is_inside_tree() && !is_root_shape()) {
//hide collision if not root
- property.usage = PROPERTY_USAGE_NO_EDITOR;
+ p_property.usage = PROPERTY_USAGE_NO_EDITOR;
} else if (is_collision_prefixed && !bool(get("use_collision"))) {
- property.usage = PROPERTY_USAGE_NO_EDITOR;
+ p_property.usage = PROPERTY_USAGE_NO_EDITOR;
}
- GeometryInstance3D::_validate_property(property);
}
Array CSGShape3D::get_meshes() const {
@@ -2058,18 +2057,16 @@ void CSGPolygon3D::_notification(int p_what) {
}
}
-void CSGPolygon3D::_validate_property(PropertyInfo &property) const {
- if (property.name.begins_with("spin") && mode != MODE_SPIN) {
- property.usage = PROPERTY_USAGE_NONE;
+void CSGPolygon3D::_validate_property(PropertyInfo &p_property) const {
+ if (p_property.name.begins_with("spin") && mode != MODE_SPIN) {
+ p_property.usage = PROPERTY_USAGE_NONE;
}
- if (property.name.begins_with("path") && mode != MODE_PATH) {
- property.usage = PROPERTY_USAGE_NONE;
+ if (p_property.name.begins_with("path") && mode != MODE_PATH) {
+ p_property.usage = PROPERTY_USAGE_NONE;
}
- if (property.name == "depth" && mode != MODE_DEPTH) {
- property.usage = PROPERTY_USAGE_NONE;
+ if (p_property.name == "depth" && mode != MODE_DEPTH) {
+ p_property.usage = PROPERTY_USAGE_NONE;
}
-
- CSGShape3D::_validate_property(property);
}
void CSGPolygon3D::_path_changed() {
diff --git a/modules/csg/csg_shape.h b/modules/csg/csg_shape.h
index 0b49dc4609..308d2afdc5 100644
--- a/modules/csg/csg_shape.h
+++ b/modules/csg/csg_shape.h
@@ -117,7 +117,7 @@ protected:
friend class CSGCombiner3D;
CSGBrush *_get_brush();
- virtual void _validate_property(PropertyInfo &property) const override;
+ void _validate_property(PropertyInfo &p_property) const;
public:
Array get_meshes() const;
@@ -383,7 +383,7 @@ private:
protected:
static void _bind_methods();
- virtual void _validate_property(PropertyInfo &property) const override;
+ void _validate_property(PropertyInfo &p_property) const;
void _notification(int p_what);
public:
diff --git a/modules/noise/fastnoise_lite.cpp b/modules/noise/fastnoise_lite.cpp
index b21e3247d7..06d97838f6 100644
--- a/modules/noise/fastnoise_lite.cpp
+++ b/modules/noise/fastnoise_lite.cpp
@@ -476,24 +476,24 @@ void FastNoiseLite::_bind_methods() {
BIND_ENUM_CONSTANT(DOMAIN_WARP_FRACTAL_INDEPENDENT);
}
-void FastNoiseLite::_validate_property(PropertyInfo &property) const {
- if (property.name.begins_with("cellular") && get_noise_type() != TYPE_CELLULAR) {
- property.usage = PROPERTY_USAGE_NO_EDITOR;
+void FastNoiseLite::_validate_property(PropertyInfo &p_property) const {
+ if (p_property.name.begins_with("cellular") && get_noise_type() != TYPE_CELLULAR) {
+ p_property.usage = PROPERTY_USAGE_NO_EDITOR;
return;
}
- if (property.name != "fractal_type" && property.name.begins_with("fractal") && get_fractal_type() == FRACTAL_NONE) {
- property.usage = PROPERTY_USAGE_NO_EDITOR;
+ if (p_property.name != "fractal_type" && p_property.name.begins_with("fractal") && get_fractal_type() == FRACTAL_NONE) {
+ p_property.usage = PROPERTY_USAGE_NO_EDITOR;
return;
}
- if (property.name == "fractal_ping_pong_strength" && get_fractal_type() != FRACTAL_PING_PONG) {
- property.usage = PROPERTY_USAGE_NO_EDITOR;
+ if (p_property.name == "fractal_ping_pong_strength" && get_fractal_type() != FRACTAL_PING_PONG) {
+ p_property.usage = PROPERTY_USAGE_NO_EDITOR;
return;
}
- if (property.name != "domain_warp_enabled" && property.name.begins_with("domain_warp") && !domain_warp_enabled) {
- property.usage = PROPERTY_USAGE_NO_EDITOR;
+ if (p_property.name != "domain_warp_enabled" && p_property.name.begins_with("domain_warp") && !domain_warp_enabled) {
+ p_property.usage = PROPERTY_USAGE_NO_EDITOR;
return;
}
}
diff --git a/modules/noise/fastnoise_lite.h b/modules/noise/fastnoise_lite.h
index fe8cd7ce6e..50c633b923 100644
--- a/modules/noise/fastnoise_lite.h
+++ b/modules/noise/fastnoise_lite.h
@@ -92,7 +92,7 @@ public:
protected:
static void _bind_methods();
- virtual void _validate_property(PropertyInfo &property) const override;
+ void _validate_property(PropertyInfo &p_property) const;
private:
_FastNoiseLite _noise;
diff --git a/modules/noise/noise_texture.cpp b/modules/noise/noise_texture.cpp
index 257a3ee8e6..923b420581 100644
--- a/modules/noise/noise_texture.cpp
+++ b/modules/noise/noise_texture.cpp
@@ -94,16 +94,16 @@ void NoiseTexture::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "noise", PROPERTY_HINT_RESOURCE_TYPE, "Noise"), "set_noise", "get_noise");
}
-void NoiseTexture::_validate_property(PropertyInfo &property) const {
- if (property.name == "bump_strength") {
+void NoiseTexture::_validate_property(PropertyInfo &p_property) const {
+ if (p_property.name == "bump_strength") {
if (!as_normal_map) {
- property.usage = PROPERTY_USAGE_NO_EDITOR;
+ p_property.usage = PROPERTY_USAGE_NO_EDITOR;
}
}
- if (property.name == "seamless_blend_skirt") {
+ if (p_property.name == "seamless_blend_skirt") {
if (!seamless) {
- property.usage = PROPERTY_USAGE_NO_EDITOR;
+ p_property.usage = PROPERTY_USAGE_NO_EDITOR;
}
}
}
diff --git a/modules/noise/noise_texture.h b/modules/noise/noise_texture.h
index 6c088562a1..83fbcc2d10 100644
--- a/modules/noise/noise_texture.h
+++ b/modules/noise/noise_texture.h
@@ -75,7 +75,7 @@ private:
protected:
static void _bind_methods();
- virtual void _validate_property(PropertyInfo &property) const override;
+ void _validate_property(PropertyInfo &p_property) const;
public:
void set_noise(Ref<Noise> p_noise);
diff --git a/modules/visual_script/visual_script_func_nodes.cpp b/modules/visual_script/visual_script_func_nodes.cpp
index 0750713fe3..e79d3bae8a 100644
--- a/modules/visual_script/visual_script_func_nodes.cpp
+++ b/modules/visual_script/visual_script_func_nodes.cpp
@@ -512,32 +512,32 @@ Dictionary VisualScriptFunctionCall::_get_argument_cache() const {
return method_cache;
}
-void VisualScriptFunctionCall::_validate_property(PropertyInfo &property) const {
- if (property.name == "base_type") {
+void VisualScriptFunctionCall::_validate_property(PropertyInfo &p_property) const {
+ if (p_property.name == "base_type") {
if (call_mode != CALL_MODE_INSTANCE) {
- property.usage = PROPERTY_USAGE_NO_EDITOR;
+ p_property.usage = PROPERTY_USAGE_NO_EDITOR;
}
}
- if (property.name == "base_script") {
+ if (p_property.name == "base_script") {
if (call_mode != CALL_MODE_INSTANCE) {
- property.usage = PROPERTY_USAGE_NONE;
+ p_property.usage = PROPERTY_USAGE_NONE;
}
}
- if (property.name == "basic_type") {
+ if (p_property.name == "basic_type") {
if (call_mode != CALL_MODE_BASIC_TYPE) {
- property.usage = PROPERTY_USAGE_NONE;
+ p_property.usage = PROPERTY_USAGE_NONE;
}
}
- if (property.name == "singleton") {
+ if (p_property.name == "singleton") {
if (call_mode != CALL_MODE_SINGLETON) {
- property.usage = PROPERTY_USAGE_NONE;
+ p_property.usage = PROPERTY_USAGE_NONE;
} else {
List<Engine::Singleton> names;
Engine::get_singleton()->get_singletons(&names);
- property.hint = PROPERTY_HINT_ENUM;
+ p_property.hint = PROPERTY_HINT_ENUM;
String sl;
for (const Engine::Singleton &E : names) {
if (!sl.is_empty()) {
@@ -545,41 +545,41 @@ void VisualScriptFunctionCall::_validate_property(PropertyInfo &property) const
}
sl += E.name;
}
- property.hint_string = sl;
+ p_property.hint_string = sl;
}
}
- if (property.name == "node_path") {
+ if (p_property.name == "node_path") {
if (call_mode != CALL_MODE_NODE_PATH) {
- property.usage = PROPERTY_USAGE_NONE;
+ p_property.usage = PROPERTY_USAGE_NONE;
} else {
Node *bnode = _get_base_node();
if (bnode) {
- property.hint_string = bnode->get_path(); //convert to long string
+ p_property.hint_string = bnode->get_path(); //convert to long string
}
}
}
- if (property.name == "function") {
+ if (p_property.name == "function") {
if (call_mode == CALL_MODE_BASIC_TYPE) {
- property.hint = PROPERTY_HINT_METHOD_OF_VARIANT_TYPE;
- property.hint_string = Variant::get_type_name(basic_type);
+ p_property.hint = PROPERTY_HINT_METHOD_OF_VARIANT_TYPE;
+ p_property.hint_string = Variant::get_type_name(basic_type);
} else if (call_mode == CALL_MODE_SELF && get_visual_script().is_valid()) {
- property.hint = PROPERTY_HINT_METHOD_OF_SCRIPT;
- property.hint_string = itos(get_visual_script()->get_instance_id());
+ p_property.hint = PROPERTY_HINT_METHOD_OF_SCRIPT;
+ p_property.hint_string = itos(get_visual_script()->get_instance_id());
} else if (call_mode == CALL_MODE_SINGLETON) {
Object *obj = Engine::get_singleton()->get_singleton_object(singleton);
if (obj) {
- property.hint = PROPERTY_HINT_METHOD_OF_INSTANCE;
- property.hint_string = itos(obj->get_instance_id());
+ p_property.hint = PROPERTY_HINT_METHOD_OF_INSTANCE;
+ p_property.hint_string = itos(obj->get_instance_id());
} else {
- property.hint = PROPERTY_HINT_METHOD_OF_BASE_TYPE;
- property.hint_string = base_type; //should be cached
+ p_property.hint = PROPERTY_HINT_METHOD_OF_BASE_TYPE;
+ p_property.hint_string = base_type; //should be cached
}
} else if (call_mode == CALL_MODE_INSTANCE) {
- property.hint = PROPERTY_HINT_METHOD_OF_BASE_TYPE;
- property.hint_string = base_type;
+ p_property.hint = PROPERTY_HINT_METHOD_OF_BASE_TYPE;
+ p_property.hint_string = base_type;
if (!base_script.is_empty()) {
if (!ResourceCache::has(base_script) && ScriptServer::edit_request_func) {
@@ -589,8 +589,8 @@ void VisualScriptFunctionCall::_validate_property(PropertyInfo &property) const
if (ResourceCache::has(base_script)) {
Ref<Script> script = ResourceCache::get_ref(base_script);
if (script.is_valid()) {
- property.hint = PROPERTY_HINT_METHOD_OF_SCRIPT;
- property.hint_string = itos(script->get_instance_id());
+ p_property.hint = PROPERTY_HINT_METHOD_OF_SCRIPT;
+ p_property.hint_string = itos(script->get_instance_id());
}
}
}
@@ -598,17 +598,17 @@ void VisualScriptFunctionCall::_validate_property(PropertyInfo &property) const
} else if (call_mode == CALL_MODE_NODE_PATH) {
Node *node = _get_base_node();
if (node) {
- property.hint = PROPERTY_HINT_METHOD_OF_INSTANCE;
- property.hint_string = itos(node->get_instance_id());
+ p_property.hint = PROPERTY_HINT_METHOD_OF_INSTANCE;
+ p_property.hint_string = itos(node->get_instance_id());
} else {
- property.hint = PROPERTY_HINT_METHOD_OF_BASE_TYPE;
- property.hint_string = get_base_type();
+ p_property.hint = PROPERTY_HINT_METHOD_OF_BASE_TYPE;
+ p_property.hint_string = get_base_type();
}
}
}
- if (property.name == "use_default_args") {
- property.hint = PROPERTY_HINT_RANGE;
+ if (p_property.name == "use_default_args") {
+ p_property.hint = PROPERTY_HINT_RANGE;
int mc = 0;
@@ -622,15 +622,15 @@ void VisualScriptFunctionCall::_validate_property(PropertyInfo &property) const
}
if (mc == 0) {
- property.usage = PROPERTY_USAGE_NONE; //do not show
+ p_property.usage = PROPERTY_USAGE_NONE; //do not show
} else {
- property.hint_string = "0," + itos(mc) + ",1";
+ p_property.hint_string = "0," + itos(mc) + ",1";
}
}
- if (property.name == "rpc_call_mode") {
+ if (p_property.name == "rpc_call_mode") {
if (call_mode == CALL_MODE_BASIC_TYPE) {
- property.usage = PROPERTY_USAGE_NONE;
+ p_property.usage = PROPERTY_USAGE_NONE;
}
}
}
@@ -1290,47 +1290,47 @@ VisualScriptPropertySet::AssignOp VisualScriptPropertySet::get_assign_op() const
return assign_op;
}
-void VisualScriptPropertySet::_validate_property(PropertyInfo &property) const {
- if (property.name == "base_type") {
+void VisualScriptPropertySet::_validate_property(PropertyInfo &p_property) const {
+ if (p_property.name == "base_type") {
if (call_mode != CALL_MODE_INSTANCE) {
- property.usage = PROPERTY_USAGE_NO_EDITOR;
+ p_property.usage = PROPERTY_USAGE_NO_EDITOR;
}
}
- if (property.name == "base_script") {
+ if (p_property.name == "base_script") {
if (call_mode != CALL_MODE_INSTANCE) {
- property.usage = PROPERTY_USAGE_NONE;
+ p_property.usage = PROPERTY_USAGE_NONE;
}
}
- if (property.name == "basic_type") {
+ if (p_property.name == "basic_type") {
if (call_mode != CALL_MODE_BASIC_TYPE) {
- property.usage = PROPERTY_USAGE_NONE;
+ p_property.usage = PROPERTY_USAGE_NONE;
}
}
- if (property.name == "node_path") {
+ if (p_property.name == "node_path") {
if (call_mode != CALL_MODE_NODE_PATH) {
- property.usage = PROPERTY_USAGE_NONE;
+ p_property.usage = PROPERTY_USAGE_NONE;
} else {
Node *bnode = _get_base_node();
if (bnode) {
- property.hint_string = bnode->get_path(); //convert to long string
+ p_property.hint_string = bnode->get_path(); //convert to long string
}
}
}
- if (property.name == "property") {
+ if (p_property.name == "property") {
if (call_mode == CALL_MODE_BASIC_TYPE) {
- property.hint = PROPERTY_HINT_PROPERTY_OF_VARIANT_TYPE;
- property.hint_string = Variant::get_type_name(basic_type);
+ p_property.hint = PROPERTY_HINT_PROPERTY_OF_VARIANT_TYPE;
+ p_property.hint_string = Variant::get_type_name(basic_type);
} else if (call_mode == CALL_MODE_SELF && get_visual_script().is_valid()) {
- property.hint = PROPERTY_HINT_PROPERTY_OF_SCRIPT;
- property.hint_string = itos(get_visual_script()->get_instance_id());
+ p_property.hint = PROPERTY_HINT_PROPERTY_OF_SCRIPT;
+ p_property.hint_string = itos(get_visual_script()->get_instance_id());
} else if (call_mode == CALL_MODE_INSTANCE) {
- property.hint = PROPERTY_HINT_PROPERTY_OF_BASE_TYPE;
- property.hint_string = base_type;
+ p_property.hint = PROPERTY_HINT_PROPERTY_OF_BASE_TYPE;
+ p_property.hint_string = base_type;
if (!base_script.is_empty()) {
if (!ResourceCache::has(base_script) && ScriptServer::edit_request_func) {
@@ -1340,8 +1340,8 @@ void VisualScriptPropertySet::_validate_property(PropertyInfo &property) const {
if (ResourceCache::has(base_script)) {
Ref<Script> script = ResourceCache::get_ref(base_script);
if (script.is_valid()) {
- property.hint = PROPERTY_HINT_PROPERTY_OF_SCRIPT;
- property.hint_string = itos(script->get_instance_id());
+ p_property.hint = PROPERTY_HINT_PROPERTY_OF_SCRIPT;
+ p_property.hint_string = itos(script->get_instance_id());
}
}
}
@@ -1349,16 +1349,16 @@ void VisualScriptPropertySet::_validate_property(PropertyInfo &property) const {
} else if (call_mode == CALL_MODE_NODE_PATH) {
Node *node = _get_base_node();
if (node) {
- property.hint = PROPERTY_HINT_PROPERTY_OF_INSTANCE;
- property.hint_string = itos(node->get_instance_id());
+ p_property.hint = PROPERTY_HINT_PROPERTY_OF_INSTANCE;
+ p_property.hint_string = itos(node->get_instance_id());
} else {
- property.hint = PROPERTY_HINT_PROPERTY_OF_BASE_TYPE;
- property.hint_string = get_base_type();
+ p_property.hint = PROPERTY_HINT_PROPERTY_OF_BASE_TYPE;
+ p_property.hint_string = get_base_type();
}
}
}
- if (property.name == "index") {
+ if (p_property.name == "index") {
Callable::CallError ce;
Variant v;
Variant::construct(type_cache.type, v, nullptr, 0, ce);
@@ -1369,11 +1369,11 @@ void VisualScriptPropertySet::_validate_property(PropertyInfo &property) const {
options += "," + E.name;
}
- property.hint = PROPERTY_HINT_ENUM;
- property.hint_string = options;
- property.type = Variant::STRING;
+ p_property.hint = PROPERTY_HINT_ENUM;
+ p_property.hint_string = options;
+ p_property.type = Variant::STRING;
if (options.is_empty()) {
- property.usage = PROPERTY_USAGE_NONE; //hide if type has no usable index
+ p_property.usage = PROPERTY_USAGE_NONE; //hide if type has no usable index
}
}
}
@@ -1996,47 +1996,47 @@ StringName VisualScriptPropertyGet::get_index() const {
return index;
}
-void VisualScriptPropertyGet::_validate_property(PropertyInfo &property) const {
- if (property.name == "base_type") {
+void VisualScriptPropertyGet::_validate_property(PropertyInfo &p_property) const {
+ if (p_property.name == "base_type") {
if (call_mode != CALL_MODE_INSTANCE) {
- property.usage = PROPERTY_USAGE_NO_EDITOR;
+ p_property.usage = PROPERTY_USAGE_NO_EDITOR;
}
}
- if (property.name == "base_script") {
+ if (p_property.name == "base_script") {
if (call_mode != CALL_MODE_INSTANCE) {
- property.usage = PROPERTY_USAGE_NONE;
+ p_property.usage = PROPERTY_USAGE_NONE;
}
}
- if (property.name == "basic_type") {
+ if (p_property.name == "basic_type") {
if (call_mode != CALL_MODE_BASIC_TYPE) {
- property.usage = PROPERTY_USAGE_NONE;
+ p_property.usage = PROPERTY_USAGE_NONE;
}
}
- if (property.name == "node_path") {
+ if (p_property.name == "node_path") {
if (call_mode != CALL_MODE_NODE_PATH) {
- property.usage = PROPERTY_USAGE_NONE;
+ p_property.usage = PROPERTY_USAGE_NONE;
} else {
Node *bnode = _get_base_node();
if (bnode) {
- property.hint_string = bnode->get_path(); //convert to long string
+ p_property.hint_string = bnode->get_path(); //convert to long string
}
}
}
- if (property.name == "property") {
+ if (p_property.name == "property") {
if (call_mode == CALL_MODE_BASIC_TYPE) {
- property.hint = PROPERTY_HINT_PROPERTY_OF_VARIANT_TYPE;
- property.hint_string = Variant::get_type_name(basic_type);
+ p_property.hint = PROPERTY_HINT_PROPERTY_OF_VARIANT_TYPE;
+ p_property.hint_string = Variant::get_type_name(basic_type);
} else if (call_mode == CALL_MODE_SELF && get_visual_script().is_valid()) {
- property.hint = PROPERTY_HINT_PROPERTY_OF_SCRIPT;
- property.hint_string = itos(get_visual_script()->get_instance_id());
+ p_property.hint = PROPERTY_HINT_PROPERTY_OF_SCRIPT;
+ p_property.hint_string = itos(get_visual_script()->get_instance_id());
} else if (call_mode == CALL_MODE_INSTANCE) {
- property.hint = PROPERTY_HINT_PROPERTY_OF_BASE_TYPE;
- property.hint_string = base_type;
+ p_property.hint = PROPERTY_HINT_PROPERTY_OF_BASE_TYPE;
+ p_property.hint_string = base_type;
if (!base_script.is_empty()) {
if (!ResourceCache::has(base_script) && ScriptServer::edit_request_func) {
@@ -2046,24 +2046,24 @@ void VisualScriptPropertyGet::_validate_property(PropertyInfo &property) const {
if (ResourceCache::has(base_script)) {
Ref<Script> script = ResourceCache::get_ref(base_script);
if (script.is_valid()) {
- property.hint = PROPERTY_HINT_PROPERTY_OF_SCRIPT;
- property.hint_string = itos(script->get_instance_id());
+ p_property.hint = PROPERTY_HINT_PROPERTY_OF_SCRIPT;
+ p_property.hint_string = itos(script->get_instance_id());
}
}
}
} else if (call_mode == CALL_MODE_NODE_PATH) {
Node *node = _get_base_node();
if (node) {
- property.hint = PROPERTY_HINT_PROPERTY_OF_INSTANCE;
- property.hint_string = itos(node->get_instance_id());
+ p_property.hint = PROPERTY_HINT_PROPERTY_OF_INSTANCE;
+ p_property.hint_string = itos(node->get_instance_id());
} else {
- property.hint = PROPERTY_HINT_PROPERTY_OF_BASE_TYPE;
- property.hint_string = get_base_type();
+ p_property.hint = PROPERTY_HINT_PROPERTY_OF_BASE_TYPE;
+ p_property.hint_string = get_base_type();
}
}
}
- if (property.name == "index") {
+ if (p_property.name == "index") {
Callable::CallError ce;
Variant v;
Variant::construct(type_cache, v, nullptr, 0, ce);
@@ -2074,11 +2074,11 @@ void VisualScriptPropertyGet::_validate_property(PropertyInfo &property) const {
options += "," + E.name;
}
- property.hint = PROPERTY_HINT_ENUM;
- property.hint_string = options;
- property.type = Variant::STRING;
+ p_property.hint = PROPERTY_HINT_ENUM;
+ p_property.hint_string = options;
+ p_property.type = Variant::STRING;
if (options.is_empty()) {
- property.usage = PROPERTY_USAGE_NONE; //hide if type has no usable index
+ p_property.usage = PROPERTY_USAGE_NONE; //hide if type has no usable index
}
}
}
@@ -2322,9 +2322,9 @@ StringName VisualScriptEmitSignal::get_signal() const {
return name;
}
-void VisualScriptEmitSignal::_validate_property(PropertyInfo &property) const {
- if (property.name == "signal") {
- property.hint = PROPERTY_HINT_ENUM;
+void VisualScriptEmitSignal::_validate_property(PropertyInfo &p_property) const {
+ if (p_property.name == "signal") {
+ p_property.hint = PROPERTY_HINT_ENUM;
List<StringName> sigs;
List<MethodInfo> base_sigs;
@@ -2349,7 +2349,7 @@ void VisualScriptEmitSignal::_validate_property(PropertyInfo &property) const {
ml += E.name;
}
- property.hint_string = ml;
+ p_property.hint_string = ml;
}
}
diff --git a/modules/visual_script/visual_script_func_nodes.h b/modules/visual_script/visual_script_func_nodes.h
index 886ed7bc81..70f601307b 100644
--- a/modules/visual_script/visual_script_func_nodes.h
+++ b/modules/visual_script/visual_script_func_nodes.h
@@ -75,7 +75,7 @@ private:
Dictionary _get_argument_cache() const;
protected:
- virtual void _validate_property(PropertyInfo &property) const override;
+ void _validate_property(PropertyInfo &p_property) const;
static void _bind_methods();
@@ -187,7 +187,7 @@ private:
void _adjust_input_index(PropertyInfo &pinfo) const;
protected:
- virtual void _validate_property(PropertyInfo &property) const override;
+ void _validate_property(PropertyInfo &p_property) const;
static void _bind_methods();
@@ -275,7 +275,7 @@ private:
void _adjust_input_index(PropertyInfo &pinfo) const;
protected:
- virtual void _validate_property(PropertyInfo &property) const override;
+ void _validate_property(PropertyInfo &p_property) const;
static void _bind_methods();
@@ -330,7 +330,7 @@ private:
StringName name;
protected:
- virtual void _validate_property(PropertyInfo &property) const override;
+ void _validate_property(PropertyInfo &p_property) const;
static void _bind_methods();
diff --git a/modules/visual_script/visual_script_nodes.cpp b/modules/visual_script/visual_script_nodes.cpp
index 5907e6a489..f02a79a617 100644
--- a/modules/visual_script/visual_script_nodes.cpp
+++ b/modules/visual_script/visual_script_nodes.cpp
@@ -1299,8 +1299,8 @@ StringName VisualScriptVariableGet::get_variable() const {
return variable;
}
-void VisualScriptVariableGet::_validate_property(PropertyInfo &property) const {
- if (property.name == "var_name" && get_visual_script().is_valid()) {
+void VisualScriptVariableGet::_validate_property(PropertyInfo &p_property) const {
+ if (p_property.name == "var_name" && get_visual_script().is_valid()) {
Ref<VisualScript> vs = get_visual_script();
List<StringName> vars;
vs->get_variable_list(&vars);
@@ -1314,8 +1314,8 @@ void VisualScriptVariableGet::_validate_property(PropertyInfo &property) const {
vhint += E.operator String();
}
- property.hint = PROPERTY_HINT_ENUM;
- property.hint_string = vhint;
+ p_property.hint = PROPERTY_HINT_ENUM;
+ p_property.hint_string = vhint;
}
}
@@ -1409,8 +1409,8 @@ StringName VisualScriptVariableSet::get_variable() const {
return variable;
}
-void VisualScriptVariableSet::_validate_property(PropertyInfo &property) const {
- if (property.name == "var_name" && get_visual_script().is_valid()) {
+void VisualScriptVariableSet::_validate_property(PropertyInfo &p_property) const {
+ if (p_property.name == "var_name" && get_visual_script().is_valid()) {
Ref<VisualScript> vs = get_visual_script();
List<StringName> vars;
vs->get_variable_list(&vars);
@@ -1424,8 +1424,8 @@ void VisualScriptVariableSet::_validate_property(PropertyInfo &property) const {
vhint += E.operator String();
}
- property.hint = PROPERTY_HINT_ENUM;
- property.hint_string = vhint;
+ p_property.hint = PROPERTY_HINT_ENUM;
+ p_property.hint_string = vhint;
}
}
@@ -1533,11 +1533,11 @@ Variant VisualScriptConstant::get_constant_value() const {
return value;
}
-void VisualScriptConstant::_validate_property(PropertyInfo &property) const {
- if (property.name == "value") {
- property.type = type;
+void VisualScriptConstant::_validate_property(PropertyInfo &p_property) const {
+ if (p_property.name == "value") {
+ p_property.type = type;
if (type == Variant::NIL) {
- property.usage = PROPERTY_USAGE_NONE; //do not save if nil
+ p_property.usage = PROPERTY_USAGE_NONE; //do not save if nil
}
}
}
@@ -1982,17 +1982,17 @@ VisualScriptNodeInstance *VisualScriptClassConstant::instantiate(VisualScriptIns
return instance;
}
-void VisualScriptClassConstant::_validate_property(PropertyInfo &property) const {
- if (property.name == "constant") {
+void VisualScriptClassConstant::_validate_property(PropertyInfo &p_property) const {
+ if (p_property.name == "constant") {
List<String> constants;
ClassDB::get_integer_constant_list(base_type, &constants, true);
- property.hint_string = "";
+ p_property.hint_string = "";
for (const String &E : constants) {
- if (!property.hint_string.is_empty()) {
- property.hint_string += ",";
+ if (!p_property.hint_string.is_empty()) {
+ p_property.hint_string += ",";
}
- property.hint_string += E;
+ p_property.hint_string += E;
}
}
}
@@ -2115,21 +2115,21 @@ VisualScriptNodeInstance *VisualScriptBasicTypeConstant::instantiate(VisualScrip
return instance;
}
-void VisualScriptBasicTypeConstant::_validate_property(PropertyInfo &property) const {
- if (property.name == "constant") {
+void VisualScriptBasicTypeConstant::_validate_property(PropertyInfo &p_property) const {
+ if (p_property.name == "constant") {
List<StringName> constants;
Variant::get_constants_for_type(type, &constants);
if (constants.size() == 0) {
- property.usage = PROPERTY_USAGE_NONE;
+ p_property.usage = PROPERTY_USAGE_NONE;
return;
}
- property.hint_string = "";
+ p_property.hint_string = "";
for (const StringName &E : constants) {
- if (!property.hint_string.is_empty()) {
- property.hint_string += ",";
+ if (!p_property.hint_string.is_empty()) {
+ p_property.hint_string += ",";
}
- property.hint_string += String(E);
+ p_property.hint_string += String(E);
}
}
}
@@ -2344,7 +2344,7 @@ VisualScriptEngineSingleton::TypeGuess VisualScriptEngineSingleton::guess_output
return tg;
}
-void VisualScriptEngineSingleton::_validate_property(PropertyInfo &property) const {
+void VisualScriptEngineSingleton::_validate_property(PropertyInfo &p_property) const {
String cc;
List<Engine::Singleton> singletons;
@@ -2362,8 +2362,8 @@ void VisualScriptEngineSingleton::_validate_property(PropertyInfo &property) con
cc += E.name;
}
- property.hint = PROPERTY_HINT_ENUM;
- property.hint_string = cc;
+ p_property.hint = PROPERTY_HINT_ENUM;
+ p_property.hint_string = cc;
}
void VisualScriptEngineSingleton::_bind_methods() {
@@ -2525,9 +2525,9 @@ VisualScriptSceneNode::TypeGuess VisualScriptSceneNode::guess_output_type(TypeGu
return tg;
}
-void VisualScriptSceneNode::_validate_property(PropertyInfo &property) const {
+void VisualScriptSceneNode::_validate_property(PropertyInfo &p_property) const {
#ifdef TOOLS_ENABLED
- if (property.name == "node_path") {
+ if (p_property.name == "node_path") {
Ref<Script> script = get_visual_script();
if (!script.is_valid()) {
return;
@@ -2552,7 +2552,7 @@ void VisualScriptSceneNode::_validate_property(PropertyInfo &property) const {
return;
}
- property.hint_string = script_node->get_path();
+ p_property.hint_string = script_node->get_path();
}
#endif
}
@@ -2646,7 +2646,7 @@ VisualScriptSceneTree::TypeGuess VisualScriptSceneTree::guess_output_type(TypeGu
return tg;
}
-void VisualScriptSceneTree::_validate_property(PropertyInfo &property) const {
+void VisualScriptSceneTree::_validate_property(PropertyInfo &p_property) const {
}
void VisualScriptSceneTree::_bind_methods() {
@@ -3757,9 +3757,9 @@ VisualScriptNodeInstance *VisualScriptInputAction::instantiate(VisualScriptInsta
return instance;
}
-void VisualScriptInputAction::_validate_property(PropertyInfo &property) const {
- if (property.name == "action") {
- property.hint = PROPERTY_HINT_ENUM;
+void VisualScriptInputAction::_validate_property(PropertyInfo &p_property) const {
+ if (p_property.name == "action") {
+ p_property.hint = PROPERTY_HINT_ENUM;
String actions;
List<PropertyInfo> pinfo;
@@ -3785,7 +3785,7 @@ void VisualScriptInputAction::_validate_property(PropertyInfo &property) const {
actions += al[i];
}
- property.hint_string = actions;
+ p_property.hint_string = actions;
}
}
@@ -3935,7 +3935,7 @@ VisualScriptNodeInstance *VisualScriptDeconstruct::instantiate(VisualScriptInsta
return instance;
}
-void VisualScriptDeconstruct::_validate_property(PropertyInfo &property) const {
+void VisualScriptDeconstruct::_validate_property(PropertyInfo &p_property) const {
}
void VisualScriptDeconstruct::_bind_methods() {
diff --git a/modules/visual_script/visual_script_nodes.h b/modules/visual_script/visual_script_nodes.h
index 35e3c490cd..72a99b9fd2 100644
--- a/modules/visual_script/visual_script_nodes.h
+++ b/modules/visual_script/visual_script_nodes.h
@@ -269,7 +269,7 @@ class VisualScriptVariableGet : public VisualScriptNode {
StringName variable;
protected:
- virtual void _validate_property(PropertyInfo &property) const override;
+ void _validate_property(PropertyInfo &p_property) const;
static void _bind_methods();
public:
@@ -301,7 +301,7 @@ class VisualScriptVariableSet : public VisualScriptNode {
StringName variable;
protected:
- virtual void _validate_property(PropertyInfo &property) const override;
+ void _validate_property(PropertyInfo &p_property) const;
static void _bind_methods();
public:
@@ -334,7 +334,7 @@ class VisualScriptConstant : public VisualScriptNode {
Variant value;
protected:
- virtual void _validate_property(PropertyInfo &property) const override;
+ void _validate_property(PropertyInfo &p_property) const;
static void _bind_methods();
public:
@@ -478,7 +478,7 @@ class VisualScriptClassConstant : public VisualScriptNode {
protected:
static void _bind_methods();
- virtual void _validate_property(PropertyInfo &property) const override;
+ void _validate_property(PropertyInfo &p_property) const;
public:
virtual int get_output_sequence_port_count() const override;
@@ -514,7 +514,7 @@ class VisualScriptBasicTypeConstant : public VisualScriptNode {
protected:
static void _bind_methods();
- virtual void _validate_property(PropertyInfo &property) const override;
+ void _validate_property(PropertyInfo &p_property) const;
public:
virtual int get_output_sequence_port_count() const override;
@@ -598,7 +598,7 @@ class VisualScriptEngineSingleton : public VisualScriptNode {
String singleton;
protected:
- void _validate_property(PropertyInfo &property) const override;
+ void _validate_property(PropertyInfo &p_property) const;
static void _bind_methods();
@@ -633,7 +633,7 @@ class VisualScriptSceneNode : public VisualScriptNode {
NodePath path;
protected:
- virtual void _validate_property(PropertyInfo &property) const override;
+ void _validate_property(PropertyInfo &p_property) const;
static void _bind_methods();
public:
@@ -665,7 +665,7 @@ class VisualScriptSceneTree : public VisualScriptNode {
GDCLASS(VisualScriptSceneTree, VisualScriptNode);
protected:
- virtual void _validate_property(PropertyInfo &property) const override;
+ void _validate_property(PropertyInfo &p_property) const;
static void _bind_methods();
public:
@@ -1010,7 +1010,7 @@ public:
Mode mode;
protected:
- virtual void _validate_property(PropertyInfo &property) const override;
+ void _validate_property(PropertyInfo &p_property) const;
static void _bind_methods();
@@ -1058,7 +1058,7 @@ class VisualScriptDeconstruct : public VisualScriptNode {
void _set_elem_cache(const Array &p_elements);
Array _get_elem_cache() const;
- virtual void _validate_property(PropertyInfo &property) const override;
+ void _validate_property(PropertyInfo &p_property) const;
protected:
static void _bind_methods();
diff --git a/modules/visual_script/visual_script_yield_nodes.cpp b/modules/visual_script/visual_script_yield_nodes.cpp
index 96e91a0baf..05dbe102f5 100644
--- a/modules/visual_script/visual_script_yield_nodes.cpp
+++ b/modules/visual_script/visual_script_yield_nodes.cpp
@@ -171,10 +171,10 @@ double VisualScriptYield::get_wait_time() {
return wait_time;
}
-void VisualScriptYield::_validate_property(PropertyInfo &property) const {
- if (property.name == "wait_time") {
+void VisualScriptYield::_validate_property(PropertyInfo &p_property) const {
+ if (p_property.name == "wait_time") {
if (yield_mode != YIELD_WAIT) {
- property.usage = PROPERTY_USAGE_NONE;
+ p_property.usage = PROPERTY_USAGE_NONE;
}
}
}
@@ -417,26 +417,26 @@ VisualScriptYieldSignal::CallMode VisualScriptYieldSignal::get_call_mode() const
return call_mode;
}
-void VisualScriptYieldSignal::_validate_property(PropertyInfo &property) const {
- if (property.name == "base_type") {
+void VisualScriptYieldSignal::_validate_property(PropertyInfo &p_property) const {
+ if (p_property.name == "base_type") {
if (call_mode != CALL_MODE_INSTANCE) {
- property.usage = PROPERTY_USAGE_NO_EDITOR;
+ p_property.usage = PROPERTY_USAGE_NO_EDITOR;
}
}
- if (property.name == "node_path") {
+ if (p_property.name == "node_path") {
if (call_mode != CALL_MODE_NODE_PATH) {
- property.usage = PROPERTY_USAGE_NONE;
+ p_property.usage = PROPERTY_USAGE_NONE;
} else {
Node *bnode = _get_base_node();
if (bnode) {
- property.hint_string = bnode->get_path(); //convert to long string
+ p_property.hint_string = bnode->get_path(); //convert to long string
}
}
}
- if (property.name == "signal") {
- property.hint = PROPERTY_HINT_ENUM;
+ if (p_property.name == "signal") {
+ p_property.hint = PROPERTY_HINT_ENUM;
List<MethodInfo> methods;
@@ -460,7 +460,7 @@ void VisualScriptYieldSignal::_validate_property(PropertyInfo &property) const {
ml += E;
}
- property.hint_string = ml;
+ p_property.hint_string = ml;
}
}
diff --git a/modules/visual_script/visual_script_yield_nodes.h b/modules/visual_script/visual_script_yield_nodes.h
index a7bf4e8a78..248f2b6e94 100644
--- a/modules/visual_script/visual_script_yield_nodes.h
+++ b/modules/visual_script/visual_script_yield_nodes.h
@@ -50,7 +50,7 @@ private:
double wait_time;
protected:
- virtual void _validate_property(PropertyInfo &property) const override;
+ void _validate_property(PropertyInfo &p_property) const;
static void _bind_methods();
@@ -103,7 +103,7 @@ private:
StringName _get_base_type() const;
protected:
- virtual void _validate_property(PropertyInfo &property) const override;
+ void _validate_property(PropertyInfo &p_property) const;
static void _bind_methods();