Add chainable listen function to EventHandler

This commit is contained in:
camila314 2025-01-30 01:21:42 -06:00
parent 6cb2662b0a
commit c1cae85672

View file

@ -19,5 +19,10 @@ namespace geode::event::v2 {
template <typename T>
struct EventHandler : public EventListener<WrapFilter<T>> {
EventHandler(std::function<bool(T*)> filterFunc) : EventListener<WrapFilter<T>>(WrapFilter(filterFunc)) {}
EventHandler& listen(std::function<ListenerResult(T*)> fn) {
bind(fn);
return *this;
}
};
}