Remove unnecessary argument from call_on_*

This commit is contained in:
Serhii Snitsaruk 2023-03-30 23:37:21 +02:00
parent f9a42c4a04
commit 24a460be59
2 changed files with 6 additions and 9 deletions

View File

@ -100,22 +100,19 @@ void LimboState::add_event_handler(const String &p_event, const Callable &p_hand
handlers.insert(p_event, p_handler);
}
LimboState *LimboState::call_on_enter(Object *p_object, const Callable &p_callable) {
ERR_FAIL_COND_V(p_object == nullptr, this);
LimboState *LimboState::call_on_enter(const Callable &p_callable) {
ERR_FAIL_COND_V(!p_callable.is_valid(), this);
connect(LimboStringNames::get_singleton()->entered, p_callable);
return this;
}
LimboState *LimboState::call_on_exit(Object *p_object, const Callable &p_callable) {
ERR_FAIL_COND_V(p_object == nullptr, this);
LimboState *LimboState::call_on_exit(const Callable &p_callable) {
ERR_FAIL_COND_V(!p_callable.is_valid(), this);
connect(LimboStringNames::get_singleton()->exited, p_callable);
return this;
}
LimboState *LimboState::call_on_update(Object *p_object, const Callable &p_callable) {
ERR_FAIL_COND_V(p_object == nullptr, this);
LimboState *LimboState::call_on_update(const Callable &p_callable) {
ERR_FAIL_COND_V(!p_callable.is_valid(), this);
connect(LimboStringNames::get_singleton()->updated, p_callable);
return this;

View File

@ -62,9 +62,9 @@ public:
virtual bool dispatch(const String &p_event, const Variant &p_cargo);
LimboState *named(String p_name);
LimboState *call_on_enter(Object *p_object, const Callable &p_callable);
LimboState *call_on_exit(Object *p_object, const Callable &p_callable);
LimboState *call_on_update(Object *p_object, const Callable &p_callable);
LimboState *call_on_enter(const Callable &p_callable);
LimboState *call_on_exit(const Callable &p_callable);
LimboState *call_on_update(const Callable &p_callable);
_FORCE_INLINE_ String event_finished() const { return EVENT_FINISHED; }
LimboState *get_root() const;