Godot Version
4.2.1
Question
I have function that creates menu based on dictionary passed as parameter.
It is working as intended except on a line where I need to connect the button with the metod.
When I explicitly name the method as string it works if I instead use a variable that concatenates a couple of strings and use it instad it doesnt work.
this doesnt work
var buttonName="Continue"
var dicConnect={}
var action = "on_button_"+buttonName+"_pressed"
dicConnect[buttonName] = Callable(self, action)
dicMenuItem[buttonName].connect("pressed",dicConnect[buttonName])
this works
var buttonName="Continue"
var dicConnect={}
dicConnect[buttonName] = Callable(self, "on_button_Continue_pressed")
dicMenuItem[buttonName].connect("pressed",dicConnect[buttonName])