mirror of
https://github.com/geode-sdk/geode.git
synced 2025-03-24 03:39:56 -04:00
you cant use getMod in a source file, silly
This commit is contained in:
parent
96fee44064
commit
c02dc7d08b
2 changed files with 6 additions and 8 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include "Event.hpp"
|
||||
#include "Loader.hpp"
|
||||
#include "Mod.hpp"
|
||||
#include <matjson.hpp>
|
||||
|
||||
namespace geode::ipc {
|
||||
|
@ -64,5 +65,9 @@ namespace geode::ipc {
|
|||
IPCFilter(IPCFilter const&) = default;
|
||||
};
|
||||
|
||||
std::monostate listen(std::string const& messageID, matjson::Value(*callback)(IPCEvent*));
|
||||
inline void listen(std::string const& messageID, matjson::Value(*callback)(IPCEvent*)) {
|
||||
(void) new EventListener(
|
||||
callback, IPCFilter(getMod()->getID(), messageID)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,13 +5,6 @@
|
|||
|
||||
using namespace geode::prelude;
|
||||
|
||||
std::monostate ipc::listen(std::string const& messageID, matjson::Value(*callback)(IPCEvent*)) {
|
||||
(void) new EventListener(
|
||||
callback, IPCFilter(getMod()->getID(), messageID)
|
||||
);
|
||||
return std::monostate();
|
||||
}
|
||||
|
||||
ipc::IPCEvent::IPCEvent(
|
||||
void* rawPipeHandle,
|
||||
std::string const& targetModID,
|
||||
|
|
Loading…
Add table
Reference in a new issue