From da0913771538fd9b1ca538615fd9aa0388608466 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Sat, 9 May 2020 09:42:18 -0400 Subject: Merge audio; handle mouse events --- src/components/EventListener.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/components') diff --git a/src/components/EventListener.hpp b/src/components/EventListener.hpp index 77a004e..c39b6ad 100644 --- a/src/components/EventListener.hpp +++ b/src/components/EventListener.hpp @@ -42,10 +42,11 @@ public: return *this; } - void tryListener(const std::string& name, sol::table& self) + template + void tryListener(const std::string& name, sol::table& self, Args... args) { if (listeners[name] == sol::type::function) - listeners[name](self); + listeners[name](self, args...); } void serialize([[maybe_unused]] cereal::JSONOutputArchive& ar) final {} -- cgit v1.2.3