Hey!
I’m working on a Ui system for a learning project, and I have a list of Skills. The skills are using a struct that I reference to a skill widget that’s inside a list/scroll box. What I would like to do is press on the skill, then press on one of my button/slots, then that will assign that skill to that slot. Then I would use it by pressing the button/slot.
Thank you all for your time!
you might find it easier to handle if the widgets just report something generic, like simply if button is pressed and what index the button is.
So then if your skill system creates a widget and populates the list with current skills, you know which skill it is by the index of the button. That way your buttons don’t have to be related to the skill system and can be reused elsewhere in the project. The onyl thing buttons do is report if they are pressed and what their index is.
So the basic communication is like this:
- skill system creates a widget and for each skill, adds a button to a list
- skill system binds to button press events
- on button press event, get the index and match it with a given skill, then you can do whatever you want from there
2 Likes