Hi everyone
i need some help on one of the following function:
CreateButton(_BackgroungTexture:texture, _ContentText : string, _Callback(: widget_message) : void) : canvas =
{
var btnCanvas : canvas = canvas{}
btnContent : button_slot = CreateWidgetContent(_BackgroungTexture, _ContentText)
case (m_ButtonSetting.GetFontType())
{
EButtonFont.None =>
var btn : button = button{Slot := btnContent}
btnCanvas.AddWidget(GetDefaultCanvasSlot(btn))
btn.OnClick().Subscribe(_Callback)
EButtonFont.Loud =>
var buttonLoud : button_loud = button_loud{DefaultText:=StringToMessage(_ContentText)}
buttonLoud.OnClick().Subscribe(_Callback)
btnCanvas.AddWidget(GetDefaultCanvasSlot(buttonLoud))
btnCanvas.AddWidget(GetDefaultCanvasSlot(btnContent.Widget))
EButtonFont.Regular =>
var buttonRegular : button_regular = button_regular{DefaultText:=StringToMessage(_ContentText)}
buttonRegular.OnClick().Subscribe(_Callback)
btnCanvas.AddWidget(GetDefaultCanvasSlot(buttonRegular))
btnCanvas.AddWidget(GetDefaultCanvasSlot(btnContent.Widget))
EButtonFont.Quiet =>
var buttonQuiet : button_quiet = button_quiet{DefaultText:=StringToMessage(_ContentText)}
buttonQuiet.OnClick().Subscribe(_Callback)
btnCanvas.AddWidget(GetDefaultCanvasSlot(buttonQuiet))
btnCanvas.AddWidget(GetDefaultCanvasSlot(btnContent.Widget))
}
return btnCanvas
}
because when I try to build my scripts I have this error:
Script error 3502: Using a value of type type{(:t->void):cancelable} as a value of type type{(:widget_message->void):cancelable} is not yet implemented.
In fact I have four errors but it’s four times the same on different lines ^^’
In summary, I would like to be able to register a function in the Onclick event as part of the parameters of my function which constructs my button!
I’m not sure I’m very clear in my explanations ^^’
if anyone has a solution to solve my error or another method to do this!
I’m open to ideas ^^
Thanks in advance ^^