I want to make a player who clicked a button on my main canvas to be shown the Class Selector UI, but in order to do that, I need an agent. How can I get that within this function?
HandleSelectedUIButton(Message : widget_message) : void =
if (PlayerUI := GetPlayerUI[Message.Player], MyUI := MaybeMyUIPerPlayer[Message.Player]?, SelectedButton := text_button_base[Message.Source]):
Print("Player selected {SelectedButton.GetText()}")
PlayerUI.RemoveWidget(MyUI)
if (set MaybeMyUIPerPlayer[Message.Player] = false) {}
var SelectedButtonText : string = SelectedButton.GetText()
MainLoopDevice.Stop()
if (SelectedButtonText = "Box Fights"):
BoxFightsClassUiDevice.Show(*Agent : agent*)
*The italicized code is where the error occurs: “Data definitions at this scope must be initialized with a value.” I am new to using Verse, any help is appreciated.