diff --git a/CMakeLists.txt b/CMakeLists.txt index cc82bd2..86266c9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,15 +8,15 @@ cmake_policy(SET CMP0057 NEW) project ("ONEMR_Loader") set(developer "user95401") -set(description "load dlls in all ur game directory") -set(lib_output "D:/Games/user666/2.2 PC GDPS but actually that is lol/") # post build copy +set(description "gd 2.2 mod that load dlls in all ur game directory") +set(lib_output "D:\\Games\\user666\\2.2 PC GDPS but actually that is lol\\") # post build copy #curly-eureka set(GAME_VERSION "2.200") include("C:\\Users\\Lenovo\\source\\curly-eureka\\CURLY-EUREKA-INCL.cmake")# "\" must be escaped by \\ #version -set(FILEVERSION "1, 2, 2, 0") +set(FILEVERSION "1, 3, 0, 0") set(LegalCopyright "user666's original") configure_file("Version.rc" "../../../src/Version.rc") diff --git a/ONEMR_Loader.dll b/ONEMR_Loader.dll index dcdcac5..7a8ba03 100644 Binary files a/ONEMR_Loader.dll and b/ONEMR_Loader.dll differ diff --git a/ONEMR_Loader_dist.zip b/ONEMR_Loader_dist.zip index d399e56..2c4af71 100644 Binary files a/ONEMR_Loader_dist.zip and b/ONEMR_Loader_dist.zip differ diff --git a/src/_main.cpp b/src/_main.cpp index 0cfb70b..47025ca 100644 --- a/src/_main.cpp +++ b/src/_main.cpp @@ -38,19 +38,24 @@ DWORD WINAPI LoadMods(void* hModule) { //0x272390 void __fastcall LoadingLayer_loadAssets(CCLayer* self, void* edx) { + afterLoad = true; MappedHooks::getOriginal(LoadingLayer_loadAssets)(self, edx); if (!CCFileUtils::sharedFileUtils()->isFileExist("ONEMR_Loader.NoInfo") && !CCFileUtils::sharedFileUtils()->isFileExist("ONEMR_Loader.AddInfo")) { + std::string fileinfo = ( + "u can delete that file, so message box with confirm appears again" "\n" + "if exists ONEMR_Loader.NoInfo => dont show loaded mods info in corner" "\n" + "if exists ONEMR_Loader.AddInfo => dont show confirm message box" + ); if (MessageBoxExA(nullptr, "Enable showing info?", "ONEMR_Loader", MB_ICONQUESTION | MB_YESNO, LANG_ENGLISH) == IDYES) { std::remove("ONEMR_Loader.NoInfo"); - std::ofstream("ONEMR_Loader.AddInfo"); + std::ofstream("ONEMR_Loader.AddInfo") << fileinfo; } else { - std::ofstream("ONEMR_Loader.NoInfo"); + std::ofstream("ONEMR_Loader.NoInfo") << fileinfo; std::remove("ONEMR_Loader.AddInfo"); } } if (CCFileUtils::sharedFileUtils()->isFileExist("ONEMR_Loader.NoInfo")) return self->removeChildByTag(938); - afterLoad = true; self->removeChildByTag(938); CCLabelTTF* ModsCountLabel = CCLabelTTF::create(std::format( "ONEMR_Loader: {} dlls loaded{}", @@ -62,31 +67,41 @@ void __fastcall LoadingLayer_loadAssets(CCLayer* self, void* edx) { ModsCountLabel->setScale(0.4f); ModsCountLabel->setOpacity(68); ModsCountLabel->setBlendFunc({ GL_SRC_ALPHA, GL_ONE }/*that is additive blend*/); - ModsCountLabel->runAction(CCFadeTo::create(0.1f, 32));//wow gd 2.2 have do smth with opacity stuff self->addChild(ModsCountLabel, 10, 938);/**/ } -//590792 -//bool __fastcall MenuLayer_init(CCLayer* self, void* edx) { -// CCMessageBox(__FUNCTION__, __FUNCTION__); -// MappedHooks::getOriginal(MenuLayer_init)(self, edx); -// self->setRotation(12); -// twoTimesBoolCallEscapeByParrentNode(self); -// if (!afterLoad) return true; -// else afterLoad = false; -// CCLabelTTF* ModsCountLabel = CCLabelTTF::create(std::format("ONEMR_Loader: {} dlls loaded", ModsLoaded).c_str(), "Arial", 6.000f); -// ModsCountLabel->setAnchorPoint(CCPointZero); -// //ModsCountLabel->setOpacity(32); -// ModsCountLabel->runAction(CCFadeTo::create(5.0f, 0)); -// self->addChild(ModsCountLabel, 10, 938); -// return true; -//} +//0x276700 +bool __fastcall MenuLayer_init(CCLayer* self, void* edx) { + MappedHooks::getOriginal(MenuLayer_init)(self, edx); + //afterLoad + if (!afterLoad) return true; + afterLoad = false; + //ONEMR_Loader.NoInfo + if (CCFileUtils::sharedFileUtils()->isFileExist("ONEMR_Loader.NoInfo")) return true; + //geode thook origin call bug + twoTimesBoolCallEscapeByParrentNode(self); + //add label + CCLabelTTF* ModsCountLabel = CCLabelTTF::create(std::format( + "ONEMR_Loader: {} dlls loaded{}", + ModsLoaded, + ModsLoadedList == "" ? "" : ("\n" + ModsLoadedList) + ).c_str(), "Arial", 12.000f); + ModsCountLabel->setHorizontalAlignment(CCTextAlignment::kCCTextAlignmentLeft); + ModsCountLabel->setAnchorPoint({ -0.01f, -0.1f }); + ModsCountLabel->setScale(0.4f); + ModsCountLabel->setOpacity(68); + ModsCountLabel->setBlendFunc({ GL_SRC_ALPHA, GL_ONE }/*that is additive blend*/); + ModsCountLabel->runAction(CCEaseExponentialIn::create(CCFadeTo::create(3.0f, 0))); + self->addChild(ModsCountLabel, 10, 938); + return true; +} BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { if (ul_reason_for_call == DLL_PROCESS_ATTACH) { LoadMods(hModule); MH_Initialize(); MappedHooks::registerHook(base + 2565008, LoadingLayer_loadAssets); + MappedHooks::registerHook(base + 0x276700, MenuLayer_init); } return TRUE; } diff --git a/src/version.rc b/src/version.rc index e46d595..846ee4d 100644 --- a/src/version.rc +++ b/src/version.rc @@ -1,6 +1,6 @@ 1 VERSIONINFO -FILEVERSION 1, 2, 2, 0 -PRODUCTVERSION 1, 2, 2, 0 +FILEVERSION 1, 3, 0, 0 +PRODUCTVERSION 1, 3, 0, 0 FILEOS 0x40004 FILETYPE 0x2 { @@ -11,7 +11,7 @@ FILETYPE 0x2 VALUE "ProductName", "ONEMR_Loader" VALUE "CompanyName", "user95401" VALUE "LegalCopyright", "user666's original" - VALUE "FileDescription", "load dlls in all ur game directory" + VALUE "FileDescription", "gd 2.2 mod that load dlls in all ur game directory" VALUE "OriginalFilename", "ONEMR_Loader.dll" } }