Multiple Bindings in UI based on one function

I am very new in Unreal Engine Development so please excuse my unprofessional description.

I have a UI Widget there are several Text Boxes with a binding. Both bindings are using the same funktion, just with other inputs to get there text (its a counter). For every Text Box I have two buttons one to increase and one to decrease the Counter.
And for one it works but when I edit the Value of the other counter it automaticly resets the other Counter/s.

264271-ui.jpg

First of all i have a savegame in it is a int array.

All text bindings are like that the just Load an other index (SHIPINDEX) of a Array

Thats the Get Ship Count-Function first it look for a save game if theres no it creates one. If there is one it load the save. Then it returns the int of the Array index which is given as input. (And then it will be displayed by the Binding first Picture)

Thats the Funktion i use to Edit the Value of the Int. It will accomplished by the + and - Buttons. This Funktion Loads the savegame and increase or decrease the value of the Int at the Index given as Input. Then it Save the Int in the Array.

now again to my Problem for one of these Ints it workes but when i edit the Value of the other Int, the first will set to 0.
But i want that it shows both Ints and i can edit them individually.

i hope you understand what i mean, like i said before i am very new in unreal engine development and i dont now how to descripe it better.

thanks in advance

i have the same problem , i just need to know which widget is using the function

Unfortunately the existing delegates do not pass the triggering widget as they get called.

However, you can create a new widget to wrap the existing button.

Then you can either move your code to the OnClicked handler, or if it’s easier to manage at the upper level, create a new event dispatcher with extra parameters :

image

And forward the default OnClick event to your custom dispatcher with extra params :

image

Then in the upper level (container) widget you can use OnClicked2 and receive the extra params :

1 Like