Hello everyone again!
I’ve been tinkering with a completely different part of the engine than last week and I became a bit curious of how to best design my classes to let them be easily edited from blueprint as this is something I really liked with Unity. More specifically, the ability to edit and view objects in the details pane in real time.
The specific case I’m fiddling around with now is a port of my inventory system from Unity. In my redesign to make it fit UE4’s design philosophy, I made my base inventory component and equipment components ActorComponents that I’ve attached to my actor root in the ctor. The equipment class then contains several ItemSlot objects that derive from UObject directly, and these itemslots can then host UObject derived Items that are blueprintable to make it easy to create lots of different instances that can be placed in any slot.
This seems to be working fine from hard code, but I found it a bit more tricky to make it look nice, and be easily editable from blueprint. Since the itemslots are the objects on the inventory, it is not possible to attached item blueprints directly in the editor. It would be nice if the header tool would recognize that the ItemSlot objects have UProperties themselves and create a nice nested pane in the BP editor. Instead, it seems like you have to create detail specializations for the ActorComponents and manually create these views.
My problem then becomes that the items that would need the specializing class (my itemslots) cannot be components since it doesn’t want to seem to compile if you try to nest ActorComponents and the examples I’ve found of IDetailCustomization all extend ActorComponents.
My next step I think will be to try to create IDetailCustomization specializations for both my itemslots and item base class but this solution does not feel very elegant.
Has someone else found a better way to design this?
I’ll post an excerpt of my code in the next post so you guys can have a look