aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/scriptmainmenupromos.cpp
diff options
context:
space:
mode:
authorBobTheBob9 <for.oliver.kirkham@gmail.com>2022-07-07 21:31:41 +0100
committerBobTheBob9 <for.oliver.kirkham@gmail.com>2022-07-07 21:31:41 +0100
commit2ae34b67e36b8ba05132d481876eb4ed7a826283 (patch)
tree63f44c8e2dcdc959d7a5317a3a7b36efedbd7d38 /NorthstarDLL/scriptmainmenupromos.cpp
parent3406de7aaaf52cbef20b1549f2d7da0255d30f51 (diff)
downloadNorthstarLauncher-2ae34b67e36b8ba05132d481876eb4ed7a826283.tar.gz
NorthstarLauncher-2ae34b67e36b8ba05132d481876eb4ed7a826283.zip
almost fully replaced hooking lib
Diffstat (limited to 'NorthstarDLL/scriptmainmenupromos.cpp')
-rw-r--r--NorthstarDLL/scriptmainmenupromos.cpp268
1 files changed, 134 insertions, 134 deletions
diff --git a/NorthstarDLL/scriptmainmenupromos.cpp b/NorthstarDLL/scriptmainmenupromos.cpp
index a4f65dd8..bf1bb9ac 100644
--- a/NorthstarDLL/scriptmainmenupromos.cpp
+++ b/NorthstarDLL/scriptmainmenupromos.cpp
@@ -1,135 +1,135 @@
-#include "pch.h"
-#include "squirrel.h"
-#include "masterserver.h"
-
-// mirror this in script
-enum eMainMenuPromoDataProperty
-{
- newInfoTitle1,
- newInfoTitle2,
- newInfoTitle3,
-
- largeButtonTitle,
- largeButtonText,
- largeButtonUrl,
- largeButtonImageIndex,
-
- smallButton1Title,
- smallButton1Url,
- smallButton1ImageIndex,
-
- smallButton2Title,
- smallButton2Url,
- smallButton2ImageIndex
-};
-
-// void function NSRequestCustomMainMenuPromos()
-SQRESULT SQ_RequestCustomMainMenuPromos(void* sqvm)
-{
- g_MasterServerManager->RequestMainMenuPromos();
- return SQRESULT_NULL;
-}
-
-// bool function NSHasCustomMainMenuPromoData()
-SQRESULT SQ_HasCustomMainMenuPromoData(void* sqvm)
-{
- g_pUISquirrel->pushbool(sqvm, g_MasterServerManager->m_bHasMainMenuPromoData);
- return SQRESULT_NOTNULL;
-}
-
-// var function NSGetCustomMainMenuPromoData( int promoDataKey )
-SQRESULT SQ_GetCustomMainMenuPromoData(void* sqvm)
-{
- if (!g_MasterServerManager->m_bHasMainMenuPromoData)
- return SQRESULT_NULL;
-
- switch (g_pUISquirrel->getinteger(sqvm, 1))
- {
- case eMainMenuPromoDataProperty::newInfoTitle1:
- {
- g_pUISquirrel->pushstring(sqvm, g_MasterServerManager->m_sMainMenuPromoData.newInfoTitle1.c_str());
- break;
- }
-
- case eMainMenuPromoDataProperty::newInfoTitle2:
- {
- g_pUISquirrel->pushstring(sqvm, g_MasterServerManager->m_sMainMenuPromoData.newInfoTitle2.c_str());
- break;
- }
-
- case eMainMenuPromoDataProperty::newInfoTitle3:
- {
- g_pUISquirrel->pushstring(sqvm, g_MasterServerManager->m_sMainMenuPromoData.newInfoTitle3.c_str());
- break;
- }
-
- case eMainMenuPromoDataProperty::largeButtonTitle:
- {
- g_pUISquirrel->pushstring(sqvm, g_MasterServerManager->m_sMainMenuPromoData.largeButtonTitle.c_str());
- break;
- }
-
- case eMainMenuPromoDataProperty::largeButtonText:
- {
- g_pUISquirrel->pushstring(sqvm, g_MasterServerManager->m_sMainMenuPromoData.largeButtonText.c_str());
- break;
- }
-
- case eMainMenuPromoDataProperty::largeButtonUrl:
- {
- g_pUISquirrel->pushstring(sqvm, g_MasterServerManager->m_sMainMenuPromoData.largeButtonUrl.c_str());
- break;
- }
-
- case eMainMenuPromoDataProperty::largeButtonImageIndex:
- {
- g_pUISquirrel->pushinteger(sqvm, g_MasterServerManager->m_sMainMenuPromoData.largeButtonImageIndex);
- break;
- }
-
- case eMainMenuPromoDataProperty::smallButton1Title:
- {
- g_pUISquirrel->pushstring(sqvm, g_MasterServerManager->m_sMainMenuPromoData.smallButton1Title.c_str());
- break;
- }
-
- case eMainMenuPromoDataProperty::smallButton1Url:
- {
- g_pUISquirrel->pushstring(sqvm, g_MasterServerManager->m_sMainMenuPromoData.smallButton1Url.c_str());
- break;
- }
-
- case eMainMenuPromoDataProperty::smallButton1ImageIndex:
- {
- g_pUISquirrel->pushinteger(sqvm, g_MasterServerManager->m_sMainMenuPromoData.smallButton1ImageIndex);
- break;
- }
-
- case eMainMenuPromoDataProperty::smallButton2Title:
- {
- g_pUISquirrel->pushstring(sqvm, g_MasterServerManager->m_sMainMenuPromoData.smallButton2Title.c_str());
- break;
- }
-
- case eMainMenuPromoDataProperty::smallButton2Url:
- {
- g_pUISquirrel->pushstring(sqvm, g_MasterServerManager->m_sMainMenuPromoData.smallButton2Url.c_str());
- break;
- }
-
- case eMainMenuPromoDataProperty::smallButton2ImageIndex:
- {
- g_pUISquirrel->pushinteger(sqvm, g_MasterServerManager->m_sMainMenuPromoData.smallButton2ImageIndex);
- break;
- }
- }
-
- return SQRESULT_NOTNULL;
-}
-
-ON_DLL_LOAD_CLIENT_RELIESON("client.dll", ScriptMainMenuPrograms, ClientSquirrel, [](HMODULE baseAddress)
-{
- g_pUISquirrel->AddFuncRegistration("void", "NSRequestCustomMainMenuPromos", "", "", SQ_RequestCustomMainMenuPromos);
- g_pUISquirrel->AddFuncRegistration("bool", "NSHasCustomMainMenuPromoData", "", "", SQ_HasCustomMainMenuPromoData);
- g_pUISquirrel->AddFuncRegistration("var", "NSGetCustomMainMenuPromoData", "int promoDataKey", "", SQ_GetCustomMainMenuPromoData);
+#include "pch.h"
+#include "squirrel.h"
+#include "masterserver.h"
+
+// mirror this in script
+enum eMainMenuPromoDataProperty
+{
+ newInfoTitle1,
+ newInfoTitle2,
+ newInfoTitle3,
+
+ largeButtonTitle,
+ largeButtonText,
+ largeButtonUrl,
+ largeButtonImageIndex,
+
+ smallButton1Title,
+ smallButton1Url,
+ smallButton1ImageIndex,
+
+ smallButton2Title,
+ smallButton2Url,
+ smallButton2ImageIndex
+};
+
+// void function NSRequestCustomMainMenuPromos()
+SQRESULT SQ_RequestCustomMainMenuPromos(void* sqvm)
+{
+ g_MasterServerManager->RequestMainMenuPromos();
+ return SQRESULT_NULL;
+}
+
+// bool function NSHasCustomMainMenuPromoData()
+SQRESULT SQ_HasCustomMainMenuPromoData(void* sqvm)
+{
+ g_pUISquirrel->pushbool(sqvm, g_MasterServerManager->m_bHasMainMenuPromoData);
+ return SQRESULT_NOTNULL;
+}
+
+// var function NSGetCustomMainMenuPromoData( int promoDataKey )
+SQRESULT SQ_GetCustomMainMenuPromoData(void* sqvm)
+{
+ if (!g_MasterServerManager->m_bHasMainMenuPromoData)
+ return SQRESULT_NULL;
+
+ switch (g_pUISquirrel->getinteger(sqvm, 1))
+ {
+ case eMainMenuPromoDataProperty::newInfoTitle1:
+ {
+ g_pUISquirrel->pushstring(sqvm, g_MasterServerManager->m_sMainMenuPromoData.newInfoTitle1.c_str());
+ break;
+ }
+
+ case eMainMenuPromoDataProperty::newInfoTitle2:
+ {
+ g_pUISquirrel->pushstring(sqvm, g_MasterServerManager->m_sMainMenuPromoData.newInfoTitle2.c_str());
+ break;
+ }
+
+ case eMainMenuPromoDataProperty::newInfoTitle3:
+ {
+ g_pUISquirrel->pushstring(sqvm, g_MasterServerManager->m_sMainMenuPromoData.newInfoTitle3.c_str());
+ break;
+ }
+
+ case eMainMenuPromoDataProperty::largeButtonTitle:
+ {
+ g_pUISquirrel->pushstring(sqvm, g_MasterServerManager->m_sMainMenuPromoData.largeButtonTitle.c_str());
+ break;
+ }
+
+ case eMainMenuPromoDataProperty::largeButtonText:
+ {
+ g_pUISquirrel->pushstring(sqvm, g_MasterServerManager->m_sMainMenuPromoData.largeButtonText.c_str());
+ break;
+ }
+
+ case eMainMenuPromoDataProperty::largeButtonUrl:
+ {
+ g_pUISquirrel->pushstring(sqvm, g_MasterServerManager->m_sMainMenuPromoData.largeButtonUrl.c_str());
+ break;
+ }
+
+ case eMainMenuPromoDataProperty::largeButtonImageIndex:
+ {
+ g_pUISquirrel->pushinteger(sqvm, g_MasterServerManager->m_sMainMenuPromoData.largeButtonImageIndex);
+ break;
+ }
+
+ case eMainMenuPromoDataProperty::smallButton1Title:
+ {
+ g_pUISquirrel->pushstring(sqvm, g_MasterServerManager->m_sMainMenuPromoData.smallButton1Title.c_str());
+ break;
+ }
+
+ case eMainMenuPromoDataProperty::smallButton1Url:
+ {
+ g_pUISquirrel->pushstring(sqvm, g_MasterServerManager->m_sMainMenuPromoData.smallButton1Url.c_str());
+ break;
+ }
+
+ case eMainMenuPromoDataProperty::smallButton1ImageIndex:
+ {
+ g_pUISquirrel->pushinteger(sqvm, g_MasterServerManager->m_sMainMenuPromoData.smallButton1ImageIndex);
+ break;
+ }
+
+ case eMainMenuPromoDataProperty::smallButton2Title:
+ {
+ g_pUISquirrel->pushstring(sqvm, g_MasterServerManager->m_sMainMenuPromoData.smallButton2Title.c_str());
+ break;
+ }
+
+ case eMainMenuPromoDataProperty::smallButton2Url:
+ {
+ g_pUISquirrel->pushstring(sqvm, g_MasterServerManager->m_sMainMenuPromoData.smallButton2Url.c_str());
+ break;
+ }
+
+ case eMainMenuPromoDataProperty::smallButton2ImageIndex:
+ {
+ g_pUISquirrel->pushinteger(sqvm, g_MasterServerManager->m_sMainMenuPromoData.smallButton2ImageIndex);
+ break;
+ }
+ }
+
+ return SQRESULT_NOTNULL;
+}
+
+ON_DLL_LOAD_CLIENT_RELIESON("client.dll", ScriptMainMenuPrograms, ClientSquirrel, [](HMODULE baseAddress)
+{
+ g_pUISquirrel->AddFuncRegistration("void", "NSRequestCustomMainMenuPromos", "", "", SQ_RequestCustomMainMenuPromos);
+ g_pUISquirrel->AddFuncRegistration("bool", "NSHasCustomMainMenuPromoData", "", "", SQ_HasCustomMainMenuPromoData);
+ g_pUISquirrel->AddFuncRegistration("var", "NSGetCustomMainMenuPromoData", "int promoDataKey", "", SQ_GetCustomMainMenuPromoData);
}) \ No newline at end of file