Hello, Since im working in an skilltree for my game i decided to do a simple custo scaleform class , since every skill is in fact just a UILoader with no text i made a copy of the button class and widget, and changed it to how i liked
Now, this works i can set the icon of every skill trough an array but since the icons are clickeable and they all do the same action(Set theyr current icon to another UILoader once clicked)
So at first i tried using a single eventListener and added it to all my buttons like this
Now the function thet gets called
But my issue is that every time the widget is clicked the index is always 0, it never changes so this is exactly where i am stuck, since i cant find a way to get the current selected button/skill
Unless i manually add a diferent event listener for every skill but i really want to avoid that
Any help as usual is appreciated
Now, this works i can set the icon of every skill trough an array but since the icons are clickeable and they all do the same action(Set theyr current icon to another UILoader once clicked)
So at first i tried using a single eventListener and added it to all my buttons like this
Code:
case ('ISlot0'): // islot = GFxClikWidget array ISlot[0] = GFxClikWidget(Widget); ISlot[0].AddEventListener('CLIK_click',SlotPress); break; case ('ISlot1'): ISlot[1] = GFxClikWidget(Widget); ISlot[1].AddEventListener('CLIK_click',SlotPress); break;
Now the function thet gets called
Code:
function SlotPress(GFxClikWidget.EventData ev) { local int index; local string iconPath; index = ev.index; ISlot[i].GetString("icon"); // alredy changed the class to allow me to do this skillPreview.SetString("source",iconPath); // and now just set the icon }
Unless i manually add a diferent event listener for every skill but i really want to avoid that
Any help as usual is appreciated

Comment