aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/scriptmodmenu.cpp
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-11-05 22:43:56 +0000
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-11-05 22:43:56 +0000
commitcfeeaf9561a294f359cc180b86f2644e3828d819 (patch)
tree4e2adfc4332f09b0ffd6b001c8e86313d5d47c46 /NorthstarDedicatedTest/scriptmodmenu.cpp
parent3d4eb42b4aaf89a4f5f3e74cb50f1fa557b272ee (diff)
downloadNorthstarLauncher-cfeeaf9561a294f359cc180b86f2644e3828d819.tar.gz
NorthstarLauncher-cfeeaf9561a294f359cc180b86f2644e3828d819.zip
reworking modloading code
Diffstat (limited to 'NorthstarDedicatedTest/scriptmodmenu.cpp')
-rw-r--r--NorthstarDedicatedTest/scriptmodmenu.cpp52
1 files changed, 26 insertions, 26 deletions
diff --git a/NorthstarDedicatedTest/scriptmodmenu.cpp b/NorthstarDedicatedTest/scriptmodmenu.cpp
index 88a5c773..54e7d0e1 100644
--- a/NorthstarDedicatedTest/scriptmodmenu.cpp
+++ b/NorthstarDedicatedTest/scriptmodmenu.cpp
@@ -9,9 +9,9 @@ SQInteger SQ_GetModNames(void* sqvm)
{
ClientSq_newarray(sqvm, 0);
- for (Mod* mod : g_ModManager->m_loadedMods)
+ for (Mod mod : g_ModManager->m_loadedMods)
{
- ClientSq_pushstring(sqvm, mod->Name.c_str(), -1);
+ ClientSq_pushstring(sqvm, mod.Name.c_str(), -1);
ClientSq_arrayappend(sqvm, -2);
}
@@ -24,11 +24,11 @@ SQInteger SQ_IsModEnabled(void* sqvm)
const SQChar* modName = ClientSq_getstring(sqvm, 1);
// manual lookup, not super performant but eh not a big deal
- for (Mod* mod : g_ModManager->m_loadedMods)
+ for (Mod mod : g_ModManager->m_loadedMods)
{
- if (!mod->Name.compare(modName))
+ if (!mod.Name.compare(modName))
{
- ClientSq_pushbool(sqvm, mod->Enabled);
+ ClientSq_pushbool(sqvm, mod.Enabled);
return SQRESULT_NOTNULL;
}
}
@@ -43,11 +43,11 @@ SQInteger SQ_SetModEnabled(void* sqvm)
const SQBool enabled = ClientSq_getbool(sqvm, 2);
// manual lookup, not super performant but eh not a big deal
- for (Mod* mod : g_ModManager->m_loadedMods)
+ for (Mod mod : g_ModManager->m_loadedMods)
{
- if (!mod->Name.compare(modName))
+ if (!mod.Name.compare(modName))
{
- mod->Enabled = enabled;
+ mod.Enabled = enabled;
return SQRESULT_NULL;
}
}
@@ -61,11 +61,11 @@ SQInteger SQ_GetModDescription(void* sqvm)
const SQChar* modName = ClientSq_getstring(sqvm, 1);
// manual lookup, not super performant but eh not a big deal
- for (Mod* mod : g_ModManager->m_loadedMods)
+ for (Mod mod : g_ModManager->m_loadedMods)
{
- if (!mod->Name.compare(modName))
+ if (!mod.Name.compare(modName))
{
- ClientSq_pushstring(sqvm, mod->Description.c_str(), -1);
+ ClientSq_pushstring(sqvm, mod.Description.c_str(), -1);
return SQRESULT_NOTNULL;
}
}
@@ -79,11 +79,11 @@ SQInteger SQ_GetModVersion(void* sqvm)
const SQChar* modName = ClientSq_getstring(sqvm, 1);
// manual lookup, not super performant but eh not a big deal
- for (Mod* mod : g_ModManager->m_loadedMods)
+ for (Mod mod : g_ModManager->m_loadedMods)
{
- if (!mod->Name.compare(modName))
+ if (!mod.Name.compare(modName))
{
- ClientSq_pushstring(sqvm, mod->Version.c_str(), -1);
+ ClientSq_pushstring(sqvm, mod.Version.c_str(), -1);
return SQRESULT_NOTNULL;
}
}
@@ -97,11 +97,11 @@ SQInteger SQ_GetModDownloadLink(void* sqvm)
const SQChar* modName = ClientSq_getstring(sqvm, 1);
// manual lookup, not super performant but eh not a big deal
- for (Mod* mod : g_ModManager->m_loadedMods)
+ for (Mod mod : g_ModManager->m_loadedMods)
{
- if (!mod->Name.compare(modName))
+ if (!mod.Name.compare(modName))
{
- ClientSq_pushstring(sqvm, mod->DownloadLink.c_str(), -1);
+ ClientSq_pushstring(sqvm, mod.DownloadLink.c_str(), -1);
return SQRESULT_NOTNULL;
}
}
@@ -115,11 +115,11 @@ SQInteger SQ_GetModLoadPriority(void* sqvm)
const SQChar* modName = ClientSq_getstring(sqvm, 1);
// manual lookup, not super performant but eh not a big deal
- for (Mod* mod : g_ModManager->m_loadedMods)
+ for (Mod mod : g_ModManager->m_loadedMods)
{
- if (!mod->Name.compare(modName))
+ if (!mod.Name.compare(modName))
{
- ClientSq_pushinteger(sqvm, mod->LoadPriority);
+ ClientSq_pushinteger(sqvm, mod.LoadPriority);
return SQRESULT_NOTNULL;
}
}
@@ -133,11 +133,11 @@ SQInteger SQ_IsModRequiredOnClient(void* sqvm)
const SQChar* modName = ClientSq_getstring(sqvm, 1);
// manual lookup, not super performant but eh not a big deal
- for (Mod* mod : g_ModManager->m_loadedMods)
+ for (Mod mod : g_ModManager->m_loadedMods)
{
- if (!mod->Name.compare(modName))
+ if (!mod.Name.compare(modName))
{
- ClientSq_pushbool(sqvm, mod->RequiredOnClient);
+ ClientSq_pushbool(sqvm, mod.RequiredOnClient);
return SQRESULT_NOTNULL;
}
}
@@ -152,11 +152,11 @@ SQInteger SQ_GetModConvars(void* sqvm)
ClientSq_newarray(sqvm, 0);
// manual lookup, not super performant but eh not a big deal
- for (Mod* mod : g_ModManager->m_loadedMods)
+ for (Mod mod : g_ModManager->m_loadedMods)
{
- if (!mod->Name.compare(modName))
+ if (!mod.Name.compare(modName))
{
- for (ModConVar* cvar : mod->ConVars)
+ for (ModConVar* cvar : mod.ConVars)
{
ClientSq_pushstring(sqvm, cvar->Name.c_str(), -1);
ClientSq_arrayappend(sqvm, -2);