-
-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a timer_started
signal to Timer node
#11229
Comments
I don't think it's a common pattern to emit signals when the user code calls a method, since you have full control over this already. Signals are only helpful if something outside of your control happens (e.g. UI interactions) which you need to be informed about. For listening on |
I don't disagree and I'm sure there are better ways like you the one you mentioned. I also understand that you have control of when the timer is started outside of As I said, I haven't had the need for this very often and it's not like it would solve a big issue. In my opinion, it would be a good option to have but it's just a suggestion. |
This feels tangentially related to |
timer_started
signal to Timer node
Also #6791 |
Describe the project you are working on
Plugin development
Describe the problem or limitation you are having in your project
I found that when developing tools and plugins, it would be nice to have a
timer_started
signal available to sync up systems/features. For example, if you need to stress test some system for X amount of time. Having an_on_timer_started()
could help initiate this stress test.I've also had the need to use it outside of plugin development. Timed UI notifications that might temporarily disable some buttons, ability timers could've been used to initiate something functionality while an ability is active. Instead of making an ability signal in that case, one could both
timer_started
andtimer_timeout
to do the same thing.Describe the feature / enhancement and how it helps to overcome the problem or limitation
Frankly, this isn't a overtly necessary or immensely helpful as I've only needed it a couple of times but it would be nice to have. It's also very easy to implement a custom signal that you emit anytime you start the timer, but having a built in signal would be easier and more approachable for beginners I think.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
I have no engine dev or C++ experience but I just looked at the code for the
timeout
signal and just duplicated it to create and emit astarted
signal when the timer is started. I'm sure there's more needed or I did something incorrect.timer.cpp
timer.zip
If this enhancement will not be used often, can it be worked around with a few lines of script?
Like I said, this can easily be replicated by creating your own signal in a scene with any timer and emitting it as you call
x_timer.start()
.Is there a reason why this should be core and not an add-on in the asset library?
Yes, this would be such a small addition to an already existing node that it wouldn't be realistic to add as an add-on/plugin.
The text was updated successfully, but these errors were encountered: