vexe / VFW

MIT License
491 stars 67 forks source link

Inline on serializable classes to avoid deep nesting? #102

Closed oxysoft closed 7 years ago

oxysoft commented 7 years ago

I have something like this which I expose from a class which is a ScriptableObject

[Serializable]
public class NamedSkillProc
{
    public string name;
    public SkillProc proc;
}

where SkillProc is another Serializable. proc has to be expanded whereas it would be cleaner if I could inline it at the same level as name. Is this possible?

Thanks

oxysoft commented 7 years ago

I have added several new modifiers to the Obj enum that allow me to do this quite easily.

And also a single Inline modifiers which combines AlwaysExpand, NoHeader and NoIndent to achieve what I wanted in this issue. I'm not sure I want to do a pull request to implement these into VFW since I'm not very familiar with the VFW internals and the code that I wrote to achieve the aboves is not very pretty.

p.s. VFW is a gift from the heavens, and is so much more powerful than what Unity provides us by default. I wanted to gouge my eyes out when I had to write custom drawers a few months ago and saw that not only could I not just work with the bare objects and had to use SerializedProperties instead, but also that I had to calculate the rectangles myself to draw shit because you cannot use EditorGUILayout. This is such a piece of shit API, and I'm so thankful for what you've enabled with VFW

I was able to do something like this with some of my own attributes and changes to VFW listed above.

The fact that I can do all of this with just attributes blows my mind