diff --git a/loader/include/Geode/loader/Dispatch.hpp b/loader/include/Geode/loader/Dispatch.hpp index 3be80092..40e71815 100644 --- a/loader/include/Geode/loader/Dispatch.hpp +++ b/loader/include/Geode/loader/Dispatch.hpp @@ -37,6 +37,8 @@ namespace geode { using Ev = DispatchEvent; using Callback = ListenerResult(Args...); + EventListenerPool* getPool() const override; + ListenerResult handle(utils::MiniFunction fn, Ev* event) { if (event->getID() == m_id) { return std::apply(fn, event->getArgs()); diff --git a/loader/src/loader/Dispatch.cpp b/loader/src/loader/Dispatch.cpp new file mode 100644 index 00000000..8b84a126 --- /dev/null +++ b/loader/src/loader/Dispatch.cpp @@ -0,0 +1,15 @@ +#include +#include +#include +#include + +using namespace geode::prelude; + +static std::unordered_map s_pools; + +EventListenerPool* DispatchFilter::getPool() const { + if (s_pools.count(m_id) == 0) { + s_pools[m_id] = new DefaultEventListenerPool(); + } + return s_pools[m_id]; +} \ No newline at end of file