aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/scriptmodmenu.cpp
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-05-09 03:48:14 +0100
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-05-09 03:48:14 +0100
commit037113d4b8032cd3715d879c2f4b08f66fa2be43 (patch)
treecf294f53b28ebb207e497877c8ee3fce39dd5e10 /NorthstarDedicatedTest/scriptmodmenu.cpp
parent9ab7c43c34183915273cc8b5ccedd72568249b27 (diff)
downloadNorthstarLauncher-037113d4b8032cd3715d879c2f4b08f66fa2be43.tar.gz
NorthstarLauncher-037113d4b8032cd3715d879c2f4b08f66fa2be43.zip
move sqvm funcs to sq managers
Diffstat (limited to 'NorthstarDedicatedTest/scriptmodmenu.cpp')
-rw-r--r--NorthstarDedicatedTest/scriptmodmenu.cpp42
1 files changed, 21 insertions, 21 deletions
diff --git a/NorthstarDedicatedTest/scriptmodmenu.cpp b/NorthstarDedicatedTest/scriptmodmenu.cpp
index 5332449e..c31f24cf 100644
--- a/NorthstarDedicatedTest/scriptmodmenu.cpp
+++ b/NorthstarDedicatedTest/scriptmodmenu.cpp
@@ -7,12 +7,12 @@
// array<string> function NSGetModNames()
SQRESULT SQ_GetModNames(void* sqvm)
{
- ClientSq_newarray(sqvm, 0);
+ g_ClientSquirrelManager->sq_newarray(sqvm, 0);
for (Mod& mod : g_ModManager->m_loadedMods)
{
- ClientSq_pushstring(sqvm, mod.Name.c_str(), -1);
- ClientSq_arrayappend(sqvm, -2);
+ g_ClientSquirrelManager->sq_pushstring(sqvm, mod.Name.c_str(), -1);
+ g_ClientSquirrelManager->sq_arrayappend(sqvm, -2);
}
return SQRESULT_NOTNULL;
@@ -21,14 +21,14 @@ SQRESULT SQ_GetModNames(void* sqvm)
// bool function NSIsModEnabled(string modName)
SQRESULT SQ_IsModEnabled(void* sqvm)
{
- const SQChar* modName = ClientSq_getstring(sqvm, 1);
+ const SQChar* modName = g_ClientSquirrelManager->sq_getstring(sqvm, 1);
// manual lookup, not super performant but eh not a big deal
for (Mod& mod : g_ModManager->m_loadedMods)
{
if (!mod.Name.compare(modName))
{
- ClientSq_pushbool(sqvm, mod.Enabled);
+ g_ClientSquirrelManager->sq_pushbool(sqvm, mod.Enabled);
return SQRESULT_NOTNULL;
}
}
@@ -39,8 +39,8 @@ SQRESULT SQ_IsModEnabled(void* sqvm)
// void function NSSetModEnabled(string modName, bool enabled)
SQRESULT SQ_SetModEnabled(void* sqvm)
{
- const SQChar* modName = ClientSq_getstring(sqvm, 1);
- const SQBool enabled = ClientSq_getbool(sqvm, 2);
+ const SQChar* modName = g_ClientSquirrelManager->sq_getstring(sqvm, 1);
+ const SQBool enabled = g_ClientSquirrelManager->sq_getbool(sqvm, 2);
// manual lookup, not super performant but eh not a big deal
for (Mod& mod : g_ModManager->m_loadedMods)
@@ -58,14 +58,14 @@ SQRESULT SQ_SetModEnabled(void* sqvm)
// string function NSGetModDescriptionByModName(string modName)
SQRESULT SQ_GetModDescription(void* sqvm)
{
- const SQChar* modName = ClientSq_getstring(sqvm, 1);
+ const SQChar* modName = g_ClientSquirrelManager->sq_getstring(sqvm, 1);
// manual lookup, not super performant but eh not a big deal
for (Mod& mod : g_ModManager->m_loadedMods)
{
if (!mod.Name.compare(modName))
{
- ClientSq_pushstring(sqvm, mod.Description.c_str(), -1);
+ g_ClientSquirrelManager->sq_pushstring(sqvm, mod.Description.c_str(), -1);
return SQRESULT_NOTNULL;
}
}
@@ -76,14 +76,14 @@ SQRESULT SQ_GetModDescription(void* sqvm)
// string function NSGetModVersionByModName(string modName)
SQRESULT SQ_GetModVersion(void* sqvm)
{
- const SQChar* modName = ClientSq_getstring(sqvm, 1);
+ const SQChar* modName = g_ClientSquirrelManager->sq_getstring(sqvm, 1);
// manual lookup, not super performant but eh not a big deal
for (Mod& mod : g_ModManager->m_loadedMods)
{
if (!mod.Name.compare(modName))
{
- ClientSq_pushstring(sqvm, mod.Version.c_str(), -1);
+ g_ClientSquirrelManager->sq_pushstring(sqvm, mod.Version.c_str(), -1);
return SQRESULT_NOTNULL;
}
}
@@ -94,14 +94,14 @@ SQRESULT SQ_GetModVersion(void* sqvm)
// string function NSGetModDownloadLinkByModName(string modName)
SQRESULT SQ_GetModDownloadLink(void* sqvm)
{
- const SQChar* modName = ClientSq_getstring(sqvm, 1);
+ const SQChar* modName = g_ClientSquirrelManager->sq_getstring(sqvm, 1);
// manual lookup, not super performant but eh not a big deal
for (Mod& mod : g_ModManager->m_loadedMods)
{
if (!mod.Name.compare(modName))
{
- ClientSq_pushstring(sqvm, mod.DownloadLink.c_str(), -1);
+ g_ClientSquirrelManager->sq_pushstring(sqvm, mod.DownloadLink.c_str(), -1);
return SQRESULT_NOTNULL;
}
}
@@ -112,14 +112,14 @@ SQRESULT SQ_GetModDownloadLink(void* sqvm)
// int function NSGetModLoadPriority(string modName)
SQRESULT SQ_GetModLoadPriority(void* sqvm)
{
- const SQChar* modName = ClientSq_getstring(sqvm, 1);
+ const SQChar* modName = g_ClientSquirrelManager->sq_getstring(sqvm, 1);
// manual lookup, not super performant but eh not a big deal
for (Mod& mod : g_ModManager->m_loadedMods)
{
if (!mod.Name.compare(modName))
{
- ClientSq_pushinteger(sqvm, mod.LoadPriority);
+ g_ClientSquirrelManager->sq_pushinteger(sqvm, mod.LoadPriority);
return SQRESULT_NOTNULL;
}
}
@@ -130,14 +130,14 @@ SQRESULT SQ_GetModLoadPriority(void* sqvm)
// bool function NSIsModRequiredOnClient(string modName)
SQRESULT SQ_IsModRequiredOnClient(void* sqvm)
{
- const SQChar* modName = ClientSq_getstring(sqvm, 1);
+ const SQChar* modName = g_ClientSquirrelManager->sq_getstring(sqvm, 1);
// manual lookup, not super performant but eh not a big deal
for (Mod& mod : g_ModManager->m_loadedMods)
{
if (!mod.Name.compare(modName))
{
- ClientSq_pushbool(sqvm, mod.RequiredOnClient);
+ g_ClientSquirrelManager->sq_pushbool(sqvm, mod.RequiredOnClient);
return SQRESULT_NOTNULL;
}
}
@@ -148,8 +148,8 @@ SQRESULT SQ_IsModRequiredOnClient(void* sqvm)
// array<string> function NSGetModConvarsByModName(string modName)
SQRESULT SQ_GetModConvars(void* sqvm)
{
- const SQChar* modName = ClientSq_getstring(sqvm, 1);
- ClientSq_newarray(sqvm, 0);
+ const SQChar* modName = g_ClientSquirrelManager->sq_getstring(sqvm, 1);
+ g_ClientSquirrelManager->sq_newarray(sqvm, 0);
// manual lookup, not super performant but eh not a big deal
for (Mod& mod : g_ModManager->m_loadedMods)
@@ -158,8 +158,8 @@ SQRESULT SQ_GetModConvars(void* sqvm)
{
for (ModConVar* cvar : mod.ConVars)
{
- ClientSq_pushstring(sqvm, cvar->Name.c_str(), -1);
- ClientSq_arrayappend(sqvm, -2);
+ g_ClientSquirrelManager->sq_pushstring(sqvm, cvar->Name.c_str(), -1);
+ g_ClientSquirrelManager->sq_arrayappend(sqvm, -2);
}
return SQRESULT_NOTNULL;