aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/squirrel/squirrel.h
diff options
context:
space:
mode:
authorEmma Miler <emma.pi@protonmail.com>2023-04-11 20:49:16 +0200
committerGitHub <noreply@github.com>2023-04-11 20:49:16 +0200
commit450d0b1ed437cf37b4309af952af8904f3f07768 (patch)
tree3f0fd39b5663b5c3f4b9e76c70cc4987f22d66c7 /NorthstarDLL/squirrel/squirrel.h
parent72da1da5b4c04ccc1154853a308cab6459c60b79 (diff)
downloadNorthstarLauncher-450d0b1ed437cf37b4309af952af8904f3f07768.tar.gz
NorthstarLauncher-450d0b1ed437cf37b4309af952af8904f3f07768.zip
Plugin system v2 (#343)
* Some work * Rewrite gamestate presence * Add plugin system logger * Format changes * Format chjange * Fix gamestate stuff * some callback stuff * move around invite stuff * move invite to funcs * fix presence server data * Actually call InformSQVMCreated * bruh * Fix TODO's * Formatting * Fix filters * Add InformDLLLoads * Fix plugin handle always being 0 * Formatting * Fix merge issues * Formatting * Mods can add files compiled at SQVM init * Some Small Fixes * Add changes from review * Fix load failure * Add new squirrel functions * actually call InformSQVMDestroyed * add CreateObject function * answers to complaints * remove snake cases from GameStatePresence --------- Co-authored-by: cat_or_not <41955154+catornot@users.noreply.github.com>
Diffstat (limited to 'NorthstarDLL/squirrel/squirrel.h')
-rw-r--r--NorthstarDLL/squirrel/squirrel.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/NorthstarDLL/squirrel/squirrel.h b/NorthstarDLL/squirrel/squirrel.h
index 5708c836..4a28409f 100644
--- a/NorthstarDLL/squirrel/squirrel.h
+++ b/NorthstarDLL/squirrel/squirrel.h
@@ -3,6 +3,7 @@
#include "squirrelclasstypes.h"
#include "squirrelautobind.h"
#include "core/math/vector.h"
+#include "plugins/plugin_abi.h"
#include "mods/modmanager.h"
// stolen from ttf2sdk: sqvm types
@@ -37,6 +38,8 @@ const char* GetContextName_Short(ScriptContext context);
eSQReturnType SQReturnTypeFromString(const char* pReturnType);
const char* SQTypeNameFromID(const int iTypeId);
+void AsyncCall_External(ScriptContext context, const char* func_name, SquirrelMessage_External_Pop function);
+
ScriptContext ScriptContextFromString(std::string string);
namespace NS::log
@@ -44,8 +47,6 @@ namespace NS::log
template <ScriptContext context> std::shared_ptr<spdlog::logger> squirrel_logger();
}; // namespace NS::log
-void schedule_call_external(ScriptContext context, const char* func_name, SquirrelMessage_External_Pop function);
-
// This base class means that only the templated functions have to be rebuilt for each template instance
// Cuts down on compile time by ~5 seconds
class SquirrelManagerBase
@@ -69,6 +70,7 @@ class SquirrelManagerBase
sq_compilebufferType __sq_compilebuffer;
sq_callType __sq_call;
sq_raiseerrorType __sq_raiseerror;
+ sq_compilefileType __sq_compilefile;
sq_newarrayType __sq_newarray;
sq_arrayappendType __sq_arrayappend;
@@ -129,6 +131,11 @@ class SquirrelManagerBase
return __sq_raiseerror(sqvm, sError);
}
+ inline bool compilefile(CSquirrelVM* sqvm, const char* path, const char* name, int a4)
+ {
+ return __sq_compilefile(sqvm, path, name, a4);
+ }
+
inline void newarray(HSquirrelVM* sqvm, const SQInteger stackpos = 0)
{
__sq_newarray(sqvm, stackpos);
@@ -385,6 +392,7 @@ template <ScriptContext context> class SquirrelManager : public virtual Squirrel
SQRESULT setupfunc(const SQChar* funcname);
void AddFuncOverride(std::string name, SQFunction func);
void ProcessMessageBuffer();
+ void GenerateSquirrelFunctionsStruct(SquirrelFunctions* s);
};
template <ScriptContext context> SquirrelManager<context>* g_pSquirrel;