#UI Event bubble up?
1 messages · Page 1 of 1 (latest)
You could connect to their gui_input signal to handle it from elsewhere
Yeah, looking at that but it seems less than ideal. What I'd really like is for buttons toggled event to bubble up.
You could create your own signals
What I'm looking to avoid doing is having to wire anything up in the child controls themselves.
I think I've settled on this approach:
public void OnReady() {
foreach(Button childButton in GetChildren().OfType<Button>()) {
int rate = childButton.GetMeta("Rate").As<int>();
childButton.Toggled += toggleState => StrategicTimer.TimeMultiplier = toggleState ? rate : 0;
}
}
Which I don't love, but should work.