summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-06-30 21:30:17 -0300
committerJuan Linietsky <reduzio@gmail.com>2017-06-30 21:35:05 -0300
commit2a3e00c8c7e6f997b12864755a3df3b9bd3cca05 (patch)
tree807a72e686f76fcf44ecd5fb2e6834545d98b38f /core
parente2e73ec906d0671c870ff64eefd15dfc86abaaec (diff)
-Many fixes to VisualScript, fixed property names, etc.
-Added ability to set/get a field in GetSet, as well as assignment ops -Added a Select node -Fixed update bugs related to variable list and exported properties, closes #9458
Diffstat (limited to 'core')
-rw-r--r--core/variant_op.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/core/variant_op.cpp b/core/variant_op.cpp
index c4dee5c8a4..5fda6b1473 100644
--- a/core/variant_op.cpp
+++ b/core/variant_op.cpp
@@ -1109,11 +1109,11 @@ void Variant::set(const Variant &p_index, const Variant &p_value, bool *r_valid)
const String *str = reinterpret_cast<const String *>(p_index._data._mem);
Vector2 *v = reinterpret_cast<Vector2 *>(_data._mem);
- if (*str == "x" || *str == "width") {
+ if (*str == "x") {
valid = true;
v->x = p_value;
return;
- } else if (*str == "y" || *str == "height") {
+ } else if (*str == "y") {
valid = true;
v->y = p_value;
return;
@@ -1177,7 +1177,7 @@ void Variant::set(const Variant &p_index, const Variant &p_value, bool *r_valid)
valid = true;
v->elements[1] = p_value;
return;
- } else if (*str == "o") {
+ } else if (*str == "origin") {
valid = true;
v->elements[2] = p_value;
return;
@@ -1572,10 +1572,10 @@ Variant Variant::get(const Variant &p_index, bool *r_valid) const {
const String *str = reinterpret_cast<const String *>(p_index._data._mem);
const Vector2 *v = reinterpret_cast<const Vector2 *>(_data._mem);
- if (*str == "x" || *str == "width") {
+ if (*str == "x") {
valid = true;
return v->x;
- } else if (*str == "y" || *str == "height") {
+ } else if (*str == "y") {
valid = true;
return v->y;
}
@@ -1657,7 +1657,7 @@ Variant Variant::get(const Variant &p_index, bool *r_valid) const {
} else if (*str == "y") {
valid = true;
return v->elements[1];
- } else if (*str == "o") {
+ } else if (*str == "origin") {
valid = true;
return v->elements[2];
}
@@ -2105,8 +2105,6 @@ void Variant::get_property_list(List<PropertyInfo> *p_list) const {
p_list->push_back(PropertyInfo(Variant::REAL, "x"));
p_list->push_back(PropertyInfo(Variant::REAL, "y"));
- p_list->push_back(PropertyInfo(Variant::REAL, "width"));
- p_list->push_back(PropertyInfo(Variant::REAL, "height"));
} break; // 5
case RECT2: {
@@ -2127,7 +2125,7 @@ void Variant::get_property_list(List<PropertyInfo> *p_list) const {
p_list->push_back(PropertyInfo(Variant::VECTOR2, "x"));
p_list->push_back(PropertyInfo(Variant::VECTOR2, "y"));
- p_list->push_back(PropertyInfo(Variant::VECTOR2, "o"));
+ p_list->push_back(PropertyInfo(Variant::VECTOR2, "origin"));
} break;
case PLANE: {