FyroxEngine / Fyrox

3D and 2D game engine written in Rust
https://fyrox.rs
MIT License
7.64k stars 343 forks source link

`VecPropertyEditor`/`ArrayPropertyEditor` does not use registered property editors to generate editors for items #357

Closed mrDIMAS closed 1 year ago

mrDIMAS commented 2 years ago

VecPropertyEditor and ArrayPropertyEditor requires that item T: Inspect + ..., which is very restrictive is makes impossible to correctly handle collections of simple types (f32, u32, String). Currently the engine provides hacky implementations for standard types, where each implementation returns self as a "subproperty" of a type.

More to that: these editors do not use registered editors to generate editors for items, for example having a VecPropertyEditor<Foo> will not use FooPropertyEditor (let's assume it exists), but instead it will create Inspector widget for every item. This is very annoying and forces to create wrappers that have single field. In case of wrapper, generated Inspector will use correct property editor (FooPropertyEditor).