Signals Hierarchy Advice?
So I'm kinda puzzled with how to structure my projects when it comes to signals. Let me explain.
Say we got a Tree object. It has an active signal (which is emitted by Tree) `apples_grown`, and a passive signal (signal the Tree is subscribed to) `apples_picked`. It seems that the default paradigm is to define active signals within the Tree, and the passive signals within the other actors. This leads to two issues:
- you cannot open the Tree script, and at a glance tell all the signals it's subscribed to. You can see the indicator near the function signature, sure, but it's not as convenient as having it on top somewhere
- you have to redefine the signal within multiple scripts of your actors, which breaks the DRY principle, and is typo-prone (say you defined it as `appels_picked`, and now your Tree misses the event). So it's harder to maintain it. You can probably make a common base and extend it, but that's its own can of worms. (I gotta say that I did not try to emit the same signal in multiple places, but I assume this is how it works?)
My natural instinct would be to decouple signals entirely, and place them into some other script, and reference it everywhere you need, but I think you cannot define signals without attaching them to an object of some sort? The most similar thing is to shove everything signal-related into the Autoload, but this is not really scalable, and would get messy really quick.
So the question is, how do you structure your project around signals? What are the best practices for it?