How to filter items from BP_Config_Property_Class?
Hey all!
Using the ModConfiguration class, I created the Section Properties using the
BP Config Property Class
, it's limiting by the Base Class FGEquipmentDescriptor
.
The issue is that I couldn't find any way to filter out even more items from that list.
E.g. I would like to remove FGConsumableDescriptor
, FGDecorationDescriptor
, etc from that list.
Is there a way to hook or add a filter to that list? Maybe create my own Config Property Class BP?
Bonus: Also would be very nice to transform those texts in more User Friendly namesSolution:Jump to solution
For future references, basically how to achieve this:
Create your own Widget Class extending
Widget_CP_Base
(you can copy the whole Widget_CP_Class
)
- Here you will edit how the widget get the data and display it in the dropdown box (In my case I prepared the data in my game instance so I could re-use to validate the user input).
...19 Replies
Specifically this class:
https://github.com/satisfactorymodding/SatisfactoryModLoader/commits/master/Mods/SML/Content/Interface/UI/Menu/Mods/ConfigProperties/BP_ConfigPropertyClass.uasset
I'm sorry for the ping @Nog but looks like you added those classes right?
https://github.com/satisfactorymodding/SatisfactoryModLoader/commits/f1e961f7ccb5e073aba7a8fdfedbc1d217839421/Plugins/SML/Content/ModList/Properties/BP_ConfigPropertyString.uasset?browsing_rename_history=true&new_path=Mods/SML/Content/Interface/UI/Menu/Mods/ConfigProperties/BP_ConfigPropertyClass.uasset&original_branch=master
Maybe you could give me your advice please?
If filtering more and providing friendly names is not possible, I would be happy to try to provide a PR adding a new BP_ConfigProperty that can have a key/value struct to generate the dropdown. And then maybe a input class that provide those values (not sure if this would work) as data provider kinda of thing?
its surely possible somehow to add friendly names and filter somehow but, question just remains if it can be done in bp only. otherwise i cant really give much advice on it, i dont have the project setup anymore and too long ago to remember how those bps looked like.
You can have this custom config property in your mod for testing purposes, but if it's good enough I'd recommend PRing it
That being said you may also want to have a custom widget for it
Looks doable: see
Widget_CP_Class
, make a copy, do magic with the spaghettiI actually made it work yesterday by duplicating exactly this Widget and duplicating the
BP Config Property Class
, because the widget is not a parameter when is created (so It can't be changed).
I actually prepared a text explaining how to do, but I found myself with some bugs, I guess was too late and I was tired, but I will check soonYou can just put those duplicated things inside your mod
Did exactly that
I actually started duplicating the C++ classes, rebuilding SML and then at some point I understood how this is setup and I was like: "Hmmmmm, I don't believe that is this simple"
Maybe I can try to prepare some text to add to the documentation? You think would be helpful? (As soon as I make it work)
Not sure, if it's good enough we should just PR things in
But documentation on how to make custom config options would be interesting
I don't think we can PR my changes in, because I did it very tied to my mod (using my subsystem inside, etc)
This I can try to do
Well, I meant refactoring it in a generic way that allows your mod to use it
Also, I don't think it's safe to use a mod subsystem from config options
Config options are per-instance, subsystems are per-world
I tried to log everywhere and I saw that the game instance was created before the configuration was rendered in the UI
Ah, game instance != subsystem
Ah sorry, I used the wrong word
I just woke up, brain is malfunctioning yet
And there's a bunch of kinds of subsystems anyway, I was thinking of subsystem actors
Sorry, my bad, I wanted to say Game instance :wonke:
I clarified myself because I realised I had assumed a specific kind of subsystem
yeah I don't think the base cp_class has any customization options. I think Free Samples has a custom config widget if you want an example. sounds like you're on the right path already though
I made it work, I'm currently testing, I will post screenshots soon and how was my approach as well
Solution
For future references, basically how to achieve this:
Create your own Widget Class extending
Widget_CP_Base
(you can copy the whole Widget_CP_Class
)
- Here you will edit how the widget get the data and display it in the dropdown box (In my case I prepared the data in my game instance so I could re-use to validate the user input).
Create your own BP_ConfigPropertyClass
(This is needed because the Widget is created inside this class and you cannot change it to your newly created one)
And that's it!
In the following image you can check the result and if you want to take a look in the blueprints and how is setup in more detail, you can download my mod source code in github: https://github.com/pvm/EquipmentKeyBindingsIt only took me almost a week to figure out and finish this :hypers: Now back to the Vehicle Path name issue :LUL: