Merge pull request #22267 from YeldhamDev/dict_array_type_fix

Properly setup EditorProperties in arrays and dictionaries
This commit is contained in:
Rémi Verschelde 2018-09-20 08:54:44 +02:00 committed by GitHub
commit 4fca3fe180
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -336,16 +336,16 @@ void EditorPropertyArray::update_property() {
} break; } break;
case Variant::INT: { case Variant::INT: {
EditorPropertyInteger *ed = memnew(EditorPropertyInteger); EditorPropertyInteger *editor = memnew(EditorPropertyInteger);
ed->setup(-100000, 100000, true, true); editor->setup(-100000, 100000, true, true);
prop = ed; prop = editor;
} break; } break;
case Variant::REAL: { case Variant::REAL: {
EditorPropertyFloat *ed = memnew(EditorPropertyFloat); EditorPropertyFloat *editor = memnew(EditorPropertyFloat);
ed->setup(-100000, 100000, 0.001, true, false, true, true); editor->setup(-100000, 100000, 0.001, true, false, true, true);
prop = ed; prop = editor;
} break; } break;
case Variant::STRING: { case Variant::STRING: {
@ -357,63 +357,63 @@ void EditorPropertyArray::update_property() {
case Variant::VECTOR2: { case Variant::VECTOR2: {
EditorPropertyVector2 *ed = memnew(EditorPropertyVector2); EditorPropertyVector2 *editor = memnew(EditorPropertyVector2);
ed->setup(-100000, 100000, 0.001, true); editor->setup(-100000, 100000, 0.001, true);
prop = ed; prop = editor;
} break; } break;
case Variant::RECT2: { case Variant::RECT2: {
EditorPropertyRect2 *ed = memnew(EditorPropertyRect2); EditorPropertyRect2 *editor = memnew(EditorPropertyRect2);
ed->setup(-100000, 100000, 0.001, true); editor->setup(-100000, 100000, 0.001, true);
prop = ed; prop = editor;
} break; } break;
case Variant::VECTOR3: { case Variant::VECTOR3: {
EditorPropertyVector3 *ed = memnew(EditorPropertyVector3); EditorPropertyVector3 *editor = memnew(EditorPropertyVector3);
ed->setup(-100000, 100000, 0.001, true); editor->setup(-100000, 100000, 0.001, true);
prop = ed; prop = editor;
} break; } break;
case Variant::TRANSFORM2D: { case Variant::TRANSFORM2D: {
EditorPropertyTransform2D *ed = memnew(EditorPropertyTransform2D); EditorPropertyTransform2D *editor = memnew(EditorPropertyTransform2D);
ed->setup(-100000, 100000, 0.001, true); editor->setup(-100000, 100000, 0.001, true);
prop = ed; prop = editor;
} break; } break;
case Variant::PLANE: { case Variant::PLANE: {
EditorPropertyPlane *ed = memnew(EditorPropertyPlane); EditorPropertyPlane *editor = memnew(EditorPropertyPlane);
ed->setup(-100000, 100000, 0.001, true); editor->setup(-100000, 100000, 0.001, true);
prop = ed; prop = editor;
} break; } break;
case Variant::QUAT: { case Variant::QUAT: {
EditorPropertyQuat *ed = memnew(EditorPropertyQuat); EditorPropertyQuat *editor = memnew(EditorPropertyQuat);
ed->setup(-100000, 100000, 0.001, true); editor->setup(-100000, 100000, 0.001, true);
prop = ed; prop = editor;
} break; } break;
case Variant::AABB: { case Variant::AABB: {
EditorPropertyAABB *ed = memnew(EditorPropertyAABB); EditorPropertyAABB *editor = memnew(EditorPropertyAABB);
ed->setup(-100000, 100000, 0.001, true); editor->setup(-100000, 100000, 0.001, true);
prop = ed; prop = editor;
} break; } break;
case Variant::BASIS: { case Variant::BASIS: {
EditorPropertyBasis *ed = memnew(EditorPropertyBasis); EditorPropertyBasis *editor = memnew(EditorPropertyBasis);
ed->setup(-100000, 100000, 0.001, true); editor->setup(-100000, 100000, 0.001, true);
prop = ed; prop = editor;
} break; } break;
case Variant::TRANSFORM: { case Variant::TRANSFORM: {
EditorPropertyTransform *ed = memnew(EditorPropertyTransform); EditorPropertyTransform *editor = memnew(EditorPropertyTransform);
ed->setup(-100000, 100000, 0.001, true); editor->setup(-100000, 100000, 0.001, true);
prop = ed; prop = editor;
} break; } break;
@ -431,8 +431,9 @@ void EditorPropertyArray::update_property() {
} break; } break;
case Variant::OBJECT: { case Variant::OBJECT: {
EditorPropertyResource *editor = memnew(EditorPropertyResource);
prop = memnew(EditorPropertyResource); editor->setup("Resource");
prop = editor;
} break; } break;
case Variant::DICTIONARY: { case Variant::DICTIONARY: {
@ -798,16 +799,16 @@ void EditorPropertyDictionary::update_property() {
} break; } break;
case Variant::INT: { case Variant::INT: {
EditorPropertyInteger *ed = memnew(EditorPropertyInteger); EditorPropertyInteger *editor = memnew(EditorPropertyInteger);
ed->setup(-100000, 100000, true, true); editor->setup(-100000, 100000, true, true);
prop = ed; prop = editor;
} break; } break;
case Variant::REAL: { case Variant::REAL: {
EditorPropertyFloat *ed = memnew(EditorPropertyFloat); EditorPropertyFloat *editor = memnew(EditorPropertyFloat);
ed->setup(-100000, 100000, 0.001, true, false, true, true); editor->setup(-100000, 100000, 0.001, true, false, true, true);
prop = ed; prop = editor;
} break; } break;
case Variant::STRING: { case Variant::STRING: {
@ -816,66 +817,65 @@ void EditorPropertyDictionary::update_property() {
} break; } break;
// math types // math types
case Variant::VECTOR2: { case Variant::VECTOR2: {
EditorPropertyVector2 *ed = memnew(EditorPropertyVector2); EditorPropertyVector2 *editor = memnew(EditorPropertyVector2);
ed->setup(-100000, 100000, 0.001, true); editor->setup(-100000, 100000, 0.001, true);
prop = ed; prop = editor;
} break; } break;
case Variant::RECT2: { case Variant::RECT2: {
EditorPropertyRect2 *ed = memnew(EditorPropertyRect2); EditorPropertyRect2 *editor = memnew(EditorPropertyRect2);
ed->setup(-100000, 100000, 0.001, true); editor->setup(-100000, 100000, 0.001, true);
prop = ed; prop = editor;
} break; } break;
case Variant::VECTOR3: { case Variant::VECTOR3: {
EditorPropertyVector3 *ed = memnew(EditorPropertyVector3); EditorPropertyVector3 *editor = memnew(EditorPropertyVector3);
ed->setup(-100000, 100000, 0.001, true); editor->setup(-100000, 100000, 0.001, true);
prop = ed; prop = editor;
} break; } break;
case Variant::TRANSFORM2D: { case Variant::TRANSFORM2D: {
EditorPropertyTransform2D *ed = memnew(EditorPropertyTransform2D); EditorPropertyTransform2D *editor = memnew(EditorPropertyTransform2D);
ed->setup(-100000, 100000, 0.001, true); editor->setup(-100000, 100000, 0.001, true);
prop = ed; prop = editor;
} break; } break;
case Variant::PLANE: { case Variant::PLANE: {
EditorPropertyPlane *ed = memnew(EditorPropertyPlane); EditorPropertyPlane *editor = memnew(EditorPropertyPlane);
ed->setup(-100000, 100000, 0.001, true); editor->setup(-100000, 100000, 0.001, true);
prop = ed; prop = editor;
} break; } break;
case Variant::QUAT: { case Variant::QUAT: {
EditorPropertyQuat *ed = memnew(EditorPropertyQuat); EditorPropertyQuat *editor = memnew(EditorPropertyQuat);
ed->setup(-100000, 100000, 0.001, true); editor->setup(-100000, 100000, 0.001, true);
prop = ed; prop = editor;
} break; } break;
case Variant::AABB: { case Variant::AABB: {
EditorPropertyAABB *ed = memnew(EditorPropertyAABB); EditorPropertyAABB *editor = memnew(EditorPropertyAABB);
ed->setup(-100000, 100000, 0.001, true); editor->setup(-100000, 100000, 0.001, true);
prop = ed; prop = editor;
} break; } break;
case Variant::BASIS: { case Variant::BASIS: {
EditorPropertyBasis *ed = memnew(EditorPropertyBasis); EditorPropertyBasis *editor = memnew(EditorPropertyBasis);
ed->setup(-100000, 100000, 0.001, true); editor->setup(-100000, 100000, 0.001, true);
prop = ed; prop = editor;
} break; } break;
case Variant::TRANSFORM: { case Variant::TRANSFORM: {
EditorPropertyTransform *ed = memnew(EditorPropertyTransform); EditorPropertyTransform *editor = memnew(EditorPropertyTransform);
ed->setup(-100000, 100000, 0.001, true); editor->setup(-100000, 100000, 0.001, true);
prop = ed; prop = editor;
} break; } break;
@ -893,8 +893,9 @@ void EditorPropertyDictionary::update_property() {
} break; } break;
case Variant::OBJECT: { case Variant::OBJECT: {
EditorPropertyResource *editor = memnew(EditorPropertyResource);
prop = memnew(EditorPropertyResource); editor->setup("Resource");
prop = editor;
} break; } break;
case Variant::DICTIONARY: { case Variant::DICTIONARY: {
@ -902,39 +903,53 @@ void EditorPropertyDictionary::update_property() {
} break; } break;
case Variant::ARRAY: { case Variant::ARRAY: {
EditorPropertyArray *editor = memnew(EditorPropertyArray);
prop = memnew(EditorPropertyArray); editor->setup(Variant::ARRAY);
prop = editor;
} break; } break;
// arrays // arrays
case Variant::POOL_BYTE_ARRAY: { case Variant::POOL_BYTE_ARRAY: {
prop = memnew(EditorPropertyArray);
EditorPropertyArray *editor = memnew(EditorPropertyArray);
editor->setup(Variant::POOL_BYTE_ARRAY);
prop = editor;
} break; } break;
case Variant::POOL_INT_ARRAY: { case Variant::POOL_INT_ARRAY: {
prop = memnew(EditorPropertyArray);
EditorPropertyArray *editor = memnew(EditorPropertyArray);
editor->setup(Variant::POOL_INT_ARRAY);
prop = editor;
} break; } break;
case Variant::POOL_REAL_ARRAY: { case Variant::POOL_REAL_ARRAY: {
prop = memnew(EditorPropertyArray); EditorPropertyArray *editor = memnew(EditorPropertyArray);
editor->setup(Variant::POOL_REAL_ARRAY);
prop = editor;
} break; } break;
case Variant::POOL_STRING_ARRAY: { case Variant::POOL_STRING_ARRAY: {
prop = memnew(EditorPropertyArray); EditorPropertyArray *editor = memnew(EditorPropertyArray);
editor->setup(Variant::POOL_STRING_ARRAY);
prop = editor;
} break; } break;
case Variant::POOL_VECTOR2_ARRAY: { case Variant::POOL_VECTOR2_ARRAY: {
prop = memnew(EditorPropertyArray); EditorPropertyArray *editor = memnew(EditorPropertyArray);
editor->setup(Variant::POOL_VECTOR2_ARRAY);
prop = editor;
} break; } break;
case Variant::POOL_VECTOR3_ARRAY: { case Variant::POOL_VECTOR3_ARRAY: {
prop = memnew(EditorPropertyArray);
EditorPropertyArray *editor = memnew(EditorPropertyArray);
editor->setup(Variant::POOL_VECTOR3_ARRAY);
prop = editor;
} break; } break;
case Variant::POOL_COLOR_ARRAY: { case Variant::POOL_COLOR_ARRAY: {
prop = memnew(EditorPropertyArray);
EditorPropertyArray *editor = memnew(EditorPropertyArray);
editor->setup(Variant::POOL_COLOR_ARRAY);
prop = editor;
} break; } break;
default: {} default: {}
} }