schedule function system

This commit is contained in:
camila314 2022-04-02 01:04:49 -05:00
parent c39ae373fd
commit 2bedb68c31

View file

@ -57,6 +57,8 @@ namespace geode {
using exportmemfn_t = void(Mod::*)(std::string const&, unknownmemfn_t);
using exportfn_t = void(Mod::*)(std::string const&, unknownfn_t);
using loadfn_t = void(*)(Mod*);
struct ScheduledExport {
std::string m_selector;
std::variant<unknownmemfn_t, unknownfn_t> m_func;
@ -66,7 +68,7 @@ namespace geode {
std::vector<ScheduledHook> m_scheduledHooks;
std::vector<ScheduledLog> m_scheduledLogs;
std::vector<ScheduledExport> m_scheduledExports;
std::vector<loadfn_t> m_scheduledFunctions;
public:
@ -121,6 +123,8 @@ namespace geode {
*/
GEODE_DLL void logInfo(std::string const& info, Severity severity);
GEODE_DLL void scheduleOnLoad(loadfn_t fn);
protected:
GEODE_DLL void exportAPIFunctionInternal(std::string const& selector, unknownmemfn_t fn);
GEODE_DLL void exportAPIFunctionInternal(std::string const& selector, unknownfn_t fn);