Also implement editor property support for PoolVector2i, and PoolVector3i, and all new class support for the Dictionary and Array properties.

This commit is contained in:
Relintai 2022-03-22 01:52:54 +01:00
parent 68c0469aa5
commit beb83b286d
2 changed files with 45 additions and 0 deletions

View File

@ -3515,11 +3515,21 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ
editor->setup(Variant::POOL_VECTOR2_ARRAY);
add_property_editor(p_path, editor);
} break;
case Variant::POOL_VECTOR2I_ARRAY: {
EditorPropertyArray *editor = memnew(EditorPropertyArray);
editor->setup(Variant::POOL_VECTOR2I_ARRAY);
add_property_editor(p_path, editor);
} break;
case Variant::POOL_VECTOR3_ARRAY: {
EditorPropertyArray *editor = memnew(EditorPropertyArray);
editor->setup(Variant::POOL_VECTOR3_ARRAY);
add_property_editor(p_path, editor);
} break; // 25
case Variant::POOL_VECTOR3I_ARRAY: {
EditorPropertyArray *editor = memnew(EditorPropertyArray);
editor->setup(Variant::POOL_VECTOR3I_ARRAY);
add_property_editor(p_path, editor);
} break; // 25
case Variant::POOL_COLOR_ARRAY: {
EditorPropertyArray *editor = memnew(EditorPropertyArray);
editor->setup(Variant::POOL_COLOR_ARRAY);

View File

@ -257,9 +257,16 @@ void EditorPropertyArray::update_property() {
case Variant::POOL_VECTOR2_ARRAY: {
arrtype = "PoolVector2Array";
} break;
case Variant::POOL_VECTOR2I_ARRAY: {
arrtype = "PoolVector2iArray";
} break;
case Variant::POOL_VECTOR3_ARRAY: {
arrtype = "PoolVector3Array";
} break;
case Variant::POOL_VECTOR3I_ARRAY: {
arrtype = "PoolVector3iArray";
} break;
case Variant::POOL_COLOR_ARRAY: {
arrtype = "PoolColorArray";
@ -951,18 +958,36 @@ void EditorPropertyDictionary::update_property() {
editor->setup(-100000, 100000, 0.001, true);
prop = editor;
} break;
case Variant::VECTOR2I: {
EditorPropertyVector2i *editor = memnew(EditorPropertyVector2i);
editor->setup(-100000, 100000, true);
prop = editor;
} break;
case Variant::RECT2: {
EditorPropertyRect2 *editor = memnew(EditorPropertyRect2);
editor->setup(-100000, 100000, 0.001, true);
prop = editor;
} break;
case Variant::RECT2I: {
EditorPropertyRect2i *editor = memnew(EditorPropertyRect2i);
editor->setup(-100000, 100000, true);
prop = editor;
} break;
case Variant::VECTOR3: {
EditorPropertyVector3 *editor = memnew(EditorPropertyVector3);
editor->setup(-100000, 100000, 0.001, true);
prop = editor;
} break;
case Variant::VECTOR3I: {
EditorPropertyVector3i *editor = memnew(EditorPropertyVector3i);
editor->setup(-100000, 100000, true);
prop = editor;
} break;
case Variant::TRANSFORM2D: {
EditorPropertyTransform2D *editor = memnew(EditorPropertyTransform2D);
@ -1069,11 +1094,21 @@ void EditorPropertyDictionary::update_property() {
editor->setup(Variant::POOL_VECTOR2_ARRAY);
prop = editor;
} break;
case Variant::POOL_VECTOR2I_ARRAY: {
EditorPropertyArray *editor = memnew(EditorPropertyArray);
editor->setup(Variant::POOL_VECTOR2I_ARRAY);
prop = editor;
} break;
case Variant::POOL_VECTOR3_ARRAY: {
EditorPropertyArray *editor = memnew(EditorPropertyArray);
editor->setup(Variant::POOL_VECTOR3_ARRAY);
prop = editor;
} break;
case Variant::POOL_VECTOR3I_ARRAY: {
EditorPropertyArray *editor = memnew(EditorPropertyArray);
editor->setup(Variant::POOL_VECTOR3I_ARRAY);
prop = editor;
} break;
case Variant::POOL_COLOR_ARRAY: {
EditorPropertyArray *editor = memnew(EditorPropertyArray);
editor->setup(Variant::POOL_COLOR_ARRAY);