diff options
Diffstat (limited to 'core/variant.cpp')
-rw-r--r-- | core/variant.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/core/variant.cpp b/core/variant.cpp index 81d10f379a..31321dc0f3 100644 --- a/core/variant.cpp +++ b/core/variant.cpp @@ -1559,72 +1559,78 @@ Variant::operator String() const { case VECTOR2_ARRAY: { DVector<Vector2> vec = operator DVector<Vector2>(); - String str; + String str("["); for(int i=0;i<vec.size();i++) { if (i>0) str+=", "; str=str+Variant( vec[i] ); } + str += "]"; return str; } break; case VECTOR3_ARRAY: { DVector<Vector3> vec = operator DVector<Vector3>(); - String str; + String str("["); for(int i=0;i<vec.size();i++) { if (i>0) str+=", "; str=str+Variant( vec[i] ); } + str += "]"; return str; } break; case STRING_ARRAY: { DVector<String> vec = operator DVector<String>(); - String str; + String str("["); for(int i=0;i<vec.size();i++) { if (i>0) str+=", "; str=str+vec[i]; } + str += "]"; return str; } break; case INT_ARRAY: { DVector<int> vec = operator DVector<int>(); - String str; + String str("["); for(int i=0;i<vec.size();i++) { if (i>0) str+=", "; str=str+itos(vec[i]); } + str += "]"; return str; } break; case REAL_ARRAY: { DVector<real_t> vec = operator DVector<real_t>(); - String str; + String str("["); for(int i=0;i<vec.size();i++) { if (i>0) str+=", "; str=str+rtos(vec[i]); } + str += "]"; return str; } break; case ARRAY: { Array arr = operator Array(); - String str; + String str("["); for (int i=0; i<arr.size(); i++) { if (i) str+=", "; str += String(arr[i]); }; + str += "]"; return str; } break; |