Help with Details Panel Customization.

Hello, for a while now I’ve been trying to customize my Details panel.

I’ve been following this guide but am having some troubles.
(Also, the official unreal documentation is very vague and I can’t get anything working there)

I’ve created the custom class that extends IDetailCustomization (Note, it compiles fine, ignore the error underlines).

I’ve binded it in my GameInstance constructor. (I’ve also tried putting this in other class constructors)

But my struct is unchanged in the UE4 editor. (My struct shown below)

My understanding is that the UE4 editor category should have been changed to read ‘Extra info’, with some extra stuff added. But nothing has changed.

I know I’m doing something wrong but can’t figure out what, as there isn’t a lot of documentation on it, and what’s there is quite vague.

Thanks!

A couple of things wrong.

For USTRUCTs, you need to derive from IPropertyTypeCustomization and use RegisterCustomPropertyTypeLayout. RegisterCustomClassLayout is for UCLASSs only. This is covered in the guide you linked.

The correct place to register customizations is in the startup function of an editor module. There’s a tutorial here, not sure if it’s fully up to date.

I’ve never tried to register a customization for a struct used in a data table, but I guess it will probably work if you fix the above issues. I wrote a tutorial on customization here which may interest you, but it doesn’t cover struct customization so is probably of no use in this particular case.

Thanks for all the info kamrann! That Module link was super useful, just got the module added (after hours of errors lol).

As for the editor though, the guide I linked reads:

This led me to believe that IDetailCustomization works for Structs as well, and is more powerful. But I supposed that’s for classes only?

For my dialogue system there’s really only 3 things I want to achieve.

  1. Hide/Show properties based on a selected Enum.
  2. Put properties next to each other, possible reduce their width.
  3. If possible, remove the dropdowns from Arrays, and just list the elements under each other.

(An NPC could have up to 50 messages, so it would be ideal if each one didn’t take up half the screen lol.)


Would IPropertyTypeCustomization allow these things? And if you have any other tips they’re be appreciated, as this is all new to me.
Thanks!!

Yep you can do that using IPropertyTypeCustomization. For the enum selection, you can register a visibility delegate to each dependent property, that checks the current value of your MsgType property to determine if other properties should be visible or hidden.

As for array customization, I have a feeling that has it’s own customization interface, but I’ve not tried to do it. One thing that can help reduce the indentation is to add Meta=(ShowOnlyInnerProperties) to any struct property declaration. Pretty sure it works with properties that are an array of structs too, though I’m not totally sure if it plays nice when customizations are registered for the struct.

Okay so no matter what I do, I still can’t get it to affect anything, despite hours and hours of trying different things, google searches, etc.

I’ve got the module in and working (displays a Log at startup)

I’ve created a class that extends IPropertyTypeCustomization, with the name FDMsgCustomization (Struct name + Cusomization).
100% of the ‘CustomizeHeader(…)’ code shown in the guide causes errors, so instead I just put a log to see if it’s actually executing.

I then implemented it in my KnightsQuestEditor module’s cpp like so:

Managed to get it compiling without errors, but no logs ever appear in unreal, thus it’s probably not executing.

I read in an Answers post somewhere that you need to put your ‘AKNIGHTSQUEST_API’ in front of the struct, but doing so also did nothing. :frowning:

Edit: Then I see stuff like this

Looks like his struct is within the customization class. Does it have to be in there?

Ah, I noticed this previously but forgot to mention it - you need to drop the prefix letter from the type when you identify it by string. So pass “DMsg” as the first argument to RegisterCustomPropertyTypeLayout. Likewise drop the ‘U’ or ‘A’ any time you identify a UObject/AActor-derived class by name.

And no, generally your type will be in a header inside your game/runtime module, but your customization class should be in your editor module. Also, the name of the customization class is irrelevant. I think if you adjust the string as above, you’ll be good to go.

Ah yes, that worked! And it was even mentioned in that first guide, which I read over about 7 times and happened to miss every time! Whoops.

Now comes the fun part of getting all the info to display again, but that should be 100x easier.

Thanks so much kamrann, you’ve been a tremendous help!

Edit: With almost no documentation aside from the Code Api, doing anything with IPropertyTypeCustomization is just as difficult if not more.

One thing that could help is always look at editor code, search for references of


IPropertyTypeCustomization

or if you are using something like VAX (which I highly encourage to do) you can locate that interface class middle mouse click on it and it should list derived classes. From there you can explore how each class handles things and learn things that won’t be mentioned in documentation for quite some time. I must say Epic improved docs a lot (I was whining a lot about it) since I started using UE couple years ago but on this front there is still a LOT to improve. .)