aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/scriptmainmenupromos.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'NorthstarDLL/scriptmainmenupromos.cpp')
-rw-r--r--NorthstarDLL/scriptmainmenupromos.cpp50
1 files changed, 25 insertions, 25 deletions
diff --git a/NorthstarDLL/scriptmainmenupromos.cpp b/NorthstarDLL/scriptmainmenupromos.cpp
index e26d1df6..a1277235 100644
--- a/NorthstarDLL/scriptmainmenupromos.cpp
+++ b/NorthstarDLL/scriptmainmenupromos.cpp
@@ -1,5 +1,4 @@
#include "pch.h"
-#include "scriptmainmenupromos.h"
#include "squirrel.h"
#include "masterserver.h"
@@ -25,102 +24,102 @@ enum eMainMenuPromoDataProperty
};
// void function NSRequestCustomMainMenuPromos()
-SQRESULT SQ_RequestCustomMainMenuPromos(void* sqvm)
+SQRESULT SQ_RequestCustomMainMenuPromos(HSquirrelVM* sqvm)
{
- g_MasterServerManager->RequestMainMenuPromos();
+ g_pMasterServerManager->RequestMainMenuPromos();
return SQRESULT_NULL;
}
// bool function NSHasCustomMainMenuPromoData()
-SQRESULT SQ_HasCustomMainMenuPromoData(void* sqvm)
+SQRESULT SQ_HasCustomMainMenuPromoData(HSquirrelVM* sqvm)
{
- ClientSq_pushbool(sqvm, g_MasterServerManager->m_bHasMainMenuPromoData);
+ g_pSquirrel<ScriptContext::UI>->pushbool(sqvm, g_pMasterServerManager->m_bHasMainMenuPromoData);
return SQRESULT_NOTNULL;
}
// var function NSGetCustomMainMenuPromoData( int promoDataKey )
-SQRESULT SQ_GetCustomMainMenuPromoData(void* sqvm)
+SQRESULT SQ_GetCustomMainMenuPromoData(HSquirrelVM* sqvm)
{
- if (!g_MasterServerManager->m_bHasMainMenuPromoData)
+ if (!g_pMasterServerManager->m_bHasMainMenuPromoData)
return SQRESULT_NULL;
- switch (ClientSq_getinteger(sqvm, 1))
+ switch (g_pSquirrel<ScriptContext::UI>->getinteger(sqvm, 1))
{
case eMainMenuPromoDataProperty::newInfoTitle1:
{
- ClientSq_pushstring(sqvm, g_MasterServerManager->m_sMainMenuPromoData.newInfoTitle1.c_str(), -1);
+ g_pSquirrel<ScriptContext::UI>->pushstring(sqvm, g_pMasterServerManager->m_sMainMenuPromoData.newInfoTitle1.c_str());
break;
}
case eMainMenuPromoDataProperty::newInfoTitle2:
{
- ClientSq_pushstring(sqvm, g_MasterServerManager->m_sMainMenuPromoData.newInfoTitle2.c_str(), -1);
+ g_pSquirrel<ScriptContext::UI>->pushstring(sqvm, g_pMasterServerManager->m_sMainMenuPromoData.newInfoTitle2.c_str());
break;
}
case eMainMenuPromoDataProperty::newInfoTitle3:
{
- ClientSq_pushstring(sqvm, g_MasterServerManager->m_sMainMenuPromoData.newInfoTitle3.c_str(), -1);
+ g_pSquirrel<ScriptContext::UI>->pushstring(sqvm, g_pMasterServerManager->m_sMainMenuPromoData.newInfoTitle3.c_str());
break;
}
case eMainMenuPromoDataProperty::largeButtonTitle:
{
- ClientSq_pushstring(sqvm, g_MasterServerManager->m_sMainMenuPromoData.largeButtonTitle.c_str(), -1);
+ g_pSquirrel<ScriptContext::UI>->pushstring(sqvm, g_pMasterServerManager->m_sMainMenuPromoData.largeButtonTitle.c_str());
break;
}
case eMainMenuPromoDataProperty::largeButtonText:
{
- ClientSq_pushstring(sqvm, g_MasterServerManager->m_sMainMenuPromoData.largeButtonText.c_str(), -1);
+ g_pSquirrel<ScriptContext::UI>->pushstring(sqvm, g_pMasterServerManager->m_sMainMenuPromoData.largeButtonText.c_str());
break;
}
case eMainMenuPromoDataProperty::largeButtonUrl:
{
- ClientSq_pushstring(sqvm, g_MasterServerManager->m_sMainMenuPromoData.largeButtonUrl.c_str(), -1);
+ g_pSquirrel<ScriptContext::UI>->pushstring(sqvm, g_pMasterServerManager->m_sMainMenuPromoData.largeButtonUrl.c_str());
break;
}
case eMainMenuPromoDataProperty::largeButtonImageIndex:
{
- ClientSq_pushinteger(sqvm, g_MasterServerManager->m_sMainMenuPromoData.largeButtonImageIndex);
+ g_pSquirrel<ScriptContext::UI>->pushinteger(sqvm, g_pMasterServerManager->m_sMainMenuPromoData.largeButtonImageIndex);
break;
}
case eMainMenuPromoDataProperty::smallButton1Title:
{
- ClientSq_pushstring(sqvm, g_MasterServerManager->m_sMainMenuPromoData.smallButton1Title.c_str(), -1);
+ g_pSquirrel<ScriptContext::UI>->pushstring(sqvm, g_pMasterServerManager->m_sMainMenuPromoData.smallButton1Title.c_str());
break;
}
case eMainMenuPromoDataProperty::smallButton1Url:
{
- ClientSq_pushstring(sqvm, g_MasterServerManager->m_sMainMenuPromoData.smallButton1Url.c_str(), -1);
+ g_pSquirrel<ScriptContext::UI>->pushstring(sqvm, g_pMasterServerManager->m_sMainMenuPromoData.smallButton1Url.c_str());
break;
}
case eMainMenuPromoDataProperty::smallButton1ImageIndex:
{
- ClientSq_pushinteger(sqvm, g_MasterServerManager->m_sMainMenuPromoData.smallButton1ImageIndex);
+ g_pSquirrel<ScriptContext::UI>->pushinteger(sqvm, g_pMasterServerManager->m_sMainMenuPromoData.smallButton1ImageIndex);
break;
}
case eMainMenuPromoDataProperty::smallButton2Title:
{
- ClientSq_pushstring(sqvm, g_MasterServerManager->m_sMainMenuPromoData.smallButton2Title.c_str(), -1);
+ g_pSquirrel<ScriptContext::UI>->pushstring(sqvm, g_pMasterServerManager->m_sMainMenuPromoData.smallButton2Title.c_str());
break;
}
case eMainMenuPromoDataProperty::smallButton2Url:
{
- ClientSq_pushstring(sqvm, g_MasterServerManager->m_sMainMenuPromoData.smallButton2Url.c_str(), -1);
+ g_pSquirrel<ScriptContext::UI>->pushstring(sqvm, g_pMasterServerManager->m_sMainMenuPromoData.smallButton2Url.c_str());
break;
}
case eMainMenuPromoDataProperty::smallButton2ImageIndex:
{
- ClientSq_pushinteger(sqvm, g_MasterServerManager->m_sMainMenuPromoData.smallButton2ImageIndex);
+ g_pSquirrel<ScriptContext::UI>->pushinteger(sqvm, g_pMasterServerManager->m_sMainMenuPromoData.smallButton2ImageIndex);
break;
}
}
@@ -128,9 +127,10 @@ SQRESULT SQ_GetCustomMainMenuPromoData(void* sqvm)
return SQRESULT_NOTNULL;
}
-void InitialiseScriptMainMenuPromos(HMODULE baseAddress)
+ON_DLL_LOAD_CLIENT_RELIESON("client.dll", ScriptMainMenuPromos, ClientSquirrel, (CModule module))
{
- g_UISquirrelManager->AddFuncRegistration("void", "NSRequestCustomMainMenuPromos", "", "", SQ_RequestCustomMainMenuPromos);
- g_UISquirrelManager->AddFuncRegistration("bool", "NSHasCustomMainMenuPromoData", "", "", SQ_HasCustomMainMenuPromoData);
- g_UISquirrelManager->AddFuncRegistration("var", "NSGetCustomMainMenuPromoData", "int promoDataKey", "", SQ_GetCustomMainMenuPromoData);
+ g_pSquirrel<ScriptContext::UI>->AddFuncRegistration("void", "NSRequestCustomMainMenuPromos", "", "", SQ_RequestCustomMainMenuPromos);
+ g_pSquirrel<ScriptContext::UI>->AddFuncRegistration("bool", "NSHasCustomMainMenuPromoData", "", "", SQ_HasCustomMainMenuPromoData);
+ g_pSquirrel<ScriptContext::UI>->AddFuncRegistration(
+ "var", "NSGetCustomMainMenuPromoData", "int promoDataKey", "", SQ_GetCustomMainMenuPromoData);
}