I know what signals are for and how they transmit information. That's what every google result is about. I want to know how to put one together, because no page seems interested in that. How do I fix this signal so it gets noticed?
I want to make a dynamic calendar screen, but I don't want it updating every frame, that's not optimal. Instead, I want to use a signal to tell it to update when it opens. The days on the calendar are Panels in a GridContainer. In the button that opens the calendar, I have this code:
signal calendarupdate
func _ready():
var button = self
button.pressed.connect(self._button_pressed)
func _button_pressed():
%CalendarPanel.visible = true
%ButtonsGrid.visible = false
calendarupdate.emit()```
And in the class script for the panels, this code:
```extends Panel
class_name CalendarPanel
signal calendarupdate
func _ready():
calendarupdate.connect(update)
func update():
queue_free()```
Simple enough. I'll know if it works when I open the calendar and there's nothing there. Then I can modify `update()` to actually do what I want. But nothing is happening...
Are they each looking for their own separate `calendarupdate` signal? That seems to defeat the point of having a broadcast like this instead of directly running functions. But if I don't redefine it, `update()` can't find it... do I need to specifically tie it to the button that sends the signal? (That seems to ALSO defeat the point, I'm using a signal so I *don't* need to jump through all of Godot's weird hoops to have the instances know where each other are.)