--- Daodan/src/Daodan.c 2013/03/07 17:26:13 692 +++ Daodan/src/Daodan.c 2013/03/08 00:31:30 694 @@ -39,6 +39,7 @@ bool patch_argb8888 = true; bool patch_killvtune = true; bool patch_getcmdline = true; bool patch_disablecmdline = true; +bool patch_optionsvisible = true; bool patch_safeprintf = true; bool patch_daodandisplayenum = true; @@ -56,6 +57,25 @@ bool opt_topmost = false; typedef int (__cdecl *CHINESEPROC)(DWORD WINAPI); bool patch_chinese = false; + + + +void ONICALL DDrShowResumeButton(int window, int visibility) +{ + if (visibility) + WMrWindow_SetLocation(window, 150, 350); + WMrWindow_SetVisible(window, visibility); +} + + +/* Options always visible patch */ +void ONICALL DDrShowOptionsButton(int window, int visibility) +{ + WMrWindow_SetVisible(window, 1); +} + + + bool DDrPatch_Init() { DDrStartupMessage("patching engine"); @@ -234,7 +254,10 @@ bool DDrPatch_Init() if(patch_chinese) { + DDrStartupMessage("Loading chinese DLL"); HMODULE dll = LoadLibrary("xfhsm_oni.dll"); + DWORD err = GetLastError(); + DDrStartupMessage(" - Module loading returned error %i", err); if( dll ) { void* proc = GetProcAddress( dll, "InstallHook" ); @@ -279,9 +302,19 @@ bool DDrPatch_Init() //FLATLINE? DDrPatch_MakeCall((void*)(OniExe + 0x000C26CB), FLrHook_DoorOpen); //FLATLINE? DDrPatch_MakeCall((void*)(OniExe + 0x000EE3CF), FLrHook_ConsoleActivate); + + + // Fix options not visible in main menu when a game was started + if(patch_optionsvisible) + { + DDrPatch_MakeCall((void*)(OniExe + 0x000d2d2d), DDrShowOptionsButton); + DDrPatch_MakeCall((void*)(OniExe + 0x000d2d43), DDrShowResumeButton); + } + return true; } + enum {s_unknown, s_options, s_patch, s_bsl, s_language} ini_section; bool DDrIniCallback(char* section, bool newsection, char* name, char* value) @@ -386,6 +419,8 @@ bool DDrIniCallback(char* section, bool patch_cheater = !_stricmp(inifile_cleanstr(value), "true"); else if (!_stricmp(name, "newweap")) patch_newweapon = !_stricmp(inifile_cleanstr(value), "true"); + else if (!_stricmp(name, "optionsvisible")) + patch_optionsvisible = !_stricmp(inifile_cleanstr(value), "true"); else DDrStartupMessage("unrecognised patch \"%s\"", name); break;