Skip to content

Commit

Permalink
1.3.0
Browse files Browse the repository at this point in the history
info
menulayer
info in configure file
  • Loading branch information
user95401 committed Dec 26, 2023
1 parent 0070b68 commit 4f10224
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 25 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
Binary file modified ONEMR_Loader.dll
Binary file not shown.
Binary file modified ONEMR_Loader_dist.zip
Binary file not shown.
53 changes: 34 additions & 19 deletions src/_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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{}",
Expand All @@ -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;
}
6 changes: 3 additions & 3 deletions src/version.rc
Original file line number Diff line number Diff line change
@@ -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
{
Expand All @@ -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"
}
}
Expand Down

0 comments on commit 4f10224

Please sign in to comment.