From 362b28da6e2f5eada7589547dfc332b8fd7d2008 Mon Sep 17 00:00:00 2001 From: nastys <@> Date: Thu, 22 Jul 2021 04:35:52 +0200 Subject: [PATCH] PDL3 part 2 --- source-code/PD-Loader.sln | 12 - .../source/PD-Loader/PD-Loader.vcxproj | 17 +- .../PD-Loader/PD-Loader.vcxproj.filters | 33 + .../PD-Loader/Patches/PatchApplier600.h | 10 +- .../PD-Loader/Patches/PatchApplier710.h | 122 +++- .../PD-Loader/Patches/patches-framework.h | 55 +- .../source/PD-Loader/Patches/patches.cpp | 79 ++- .../source/PD-Loader/Patches/patches.h | 5 + .../PD-Loader/Render/render-framework.h | 2 + .../source/PD-Loader/Render/render.cpp | 67 +- source-code/source/PD-Loader/Render/render.h | 8 + source-code/source/PD-Loader/dllmain.cpp | 93 ++- source-code/source/PD-Loader/templates.cpp | 13 + source-code/source/PD-Loader/templates.h | 539 ++++++++++++++ .../source/plugins/Launcher/ConfigOption.h | 30 +- .../source/plugins/Launcher/Launcher.vcxproj | 1 + .../source/plugins/Launcher/composition.h | 7 +- .../source/plugins/Launcher/framework.h | 49 +- .../source/plugins/Launcher/registry.h | 61 ++ source-code/source/plugins/Launcher/ui.h | 664 +++++++++++++++--- source-code/source/plugins/Launcher/ui.resx | 6 +- .../TLAC/Components/Input/InputEmulator.cpp | 4 +- 22 files changed, 1582 insertions(+), 295 deletions(-) create mode 100644 source-code/source/PD-Loader/Patches/patches.h create mode 100644 source-code/source/PD-Loader/Render/render.h create mode 100644 source-code/source/PD-Loader/templates.cpp create mode 100644 source-code/source/PD-Loader/templates.h create mode 100644 source-code/source/plugins/Launcher/registry.h diff --git a/source-code/PD-Loader.sln b/source-code/PD-Loader.sln index baa3962..43dfada 100644 --- a/source-code/PD-Loader.sln +++ b/source-code/PD-Loader.sln @@ -7,12 +7,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PD-Loader", "source\PD-Load EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TLAC", "source\plugins\TLAC\TLAC.vcxproj", "{2B5533BB-04A1-424F-9BCA-1CA963B46B7F}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Patches", "source\plugins\Patches\Patches.vcxproj", "{3FD6ACA9-E613-4FD6-BDA2-55A91C2CF65C}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Launcher", "source\plugins\Launcher\Launcher.vcxproj", "{60D5E9F4-335F-402B-9A07-D78674DFFC9B}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Render", "source\plugins\Render\Render.vcxproj", "{89F87459-768F-4638-9267-0F90CD74452D}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fakedll", "source\fakedll\fakedll.vcxproj", "{B49C6ABE-931C-4F91-9A94-21A41A305FEE}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DivaSound", "source\plugins\DivaSound\DivaSound.vcxproj", "{EE1A551A-49A0-40F2-8C2E-862D0AE55B43}" @@ -41,18 +37,10 @@ Global {2B5533BB-04A1-424F-9BCA-1CA963B46B7F}.Debug|x64.Build.0 = Debug|x64 {2B5533BB-04A1-424F-9BCA-1CA963B46B7F}.Release|x64.ActiveCfg = Release|x64 {2B5533BB-04A1-424F-9BCA-1CA963B46B7F}.Release|x64.Build.0 = Release|x64 - {3FD6ACA9-E613-4FD6-BDA2-55A91C2CF65C}.Debug|x64.ActiveCfg = Debug|x64 - {3FD6ACA9-E613-4FD6-BDA2-55A91C2CF65C}.Debug|x64.Build.0 = Debug|x64 - {3FD6ACA9-E613-4FD6-BDA2-55A91C2CF65C}.Release|x64.ActiveCfg = Release|x64 - {3FD6ACA9-E613-4FD6-BDA2-55A91C2CF65C}.Release|x64.Build.0 = Release|x64 {60D5E9F4-335F-402B-9A07-D78674DFFC9B}.Debug|x64.ActiveCfg = Debug|x64 {60D5E9F4-335F-402B-9A07-D78674DFFC9B}.Debug|x64.Build.0 = Debug|x64 {60D5E9F4-335F-402B-9A07-D78674DFFC9B}.Release|x64.ActiveCfg = Release|x64 {60D5E9F4-335F-402B-9A07-D78674DFFC9B}.Release|x64.Build.0 = Release|x64 - {89F87459-768F-4638-9267-0F90CD74452D}.Debug|x64.ActiveCfg = Debug|x64 - {89F87459-768F-4638-9267-0F90CD74452D}.Debug|x64.Build.0 = Debug|x64 - {89F87459-768F-4638-9267-0F90CD74452D}.Release|x64.ActiveCfg = Release|x64 - {89F87459-768F-4638-9267-0F90CD74452D}.Release|x64.Build.0 = Release|x64 {B49C6ABE-931C-4F91-9A94-21A41A305FEE}.Debug|x64.ActiveCfg = Debug|x64 {B49C6ABE-931C-4F91-9A94-21A41A305FEE}.Debug|x64.Build.0 = Debug|x64 {B49C6ABE-931C-4F91-9A94-21A41A305FEE}.Release|x64.ActiveCfg = Release|x64 diff --git a/source-code/source/PD-Loader/PD-Loader.vcxproj b/source-code/source/PD-Loader/PD-Loader.vcxproj index 5b4e6a3..73bce1c 100644 --- a/source-code/source/PD-Loader/PD-Loader.vcxproj +++ b/source-code/source/PD-Loader/PD-Loader.vcxproj @@ -63,7 +63,7 @@ _CRT_SECURE_NO_WARNINGS;_DEBUG;PDLOADER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true pch.h - ..\dependencies\MemoryModule;%(AdditionalIncludeDirectories) + ..\..\dependencies\freeglut\include;..\..\dependencies\PluginConfigApi;..\..\dependencies\detours\include;..\..\dependencies\MemoryModule;%(AdditionalIncludeDirectories) stdcpp17 -d2FH4- /utf-8 %(AdditionalOptions) @@ -73,6 +73,7 @@ false x64.def -d2:-FH4- %(AdditionalOptions) + ..\..\dependencies\freeglut\lib;..\..\dependencies\detours\lib @@ -86,7 +87,7 @@ _CRT_SECURE_NO_WARNINGS;NDEBUG;PDLOADER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true pch.h - ..\dependencies\MemoryModule;%(AdditionalIncludeDirectories) + ..\..\dependencies\freeglut\include;..\..\dependencies\PluginConfigApi;..\..\dependencies\detours\include;..\..\dependencies\MemoryModule;%(AdditionalIncludeDirectories) stdcpp17 MultiThreadedDLL -d2FH4- /utf-8 %(AdditionalOptions) @@ -99,6 +100,7 @@ false x64.def -d2:-FH4- %(AdditionalOptions) + ..\..\dependencies\freeglut\lib;..\..\dependencies\detours\lib @@ -109,9 +111,20 @@ + + + + + + + + + + + diff --git a/source-code/source/PD-Loader/PD-Loader.vcxproj.filters b/source-code/source/PD-Loader/PD-Loader.vcxproj.filters index 046fb1b..bbabeed 100644 --- a/source-code/source/PD-Loader/PD-Loader.vcxproj.filters +++ b/source-code/source/PD-Loader/PD-Loader.vcxproj.filters @@ -24,11 +24,44 @@ Source Files + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + Source Files + + Source Files + + + Source Files + + + Source Files + diff --git a/source-code/source/PD-Loader/Patches/PatchApplier600.h b/source-code/source/PD-Loader/Patches/PatchApplier600.h index 515d740..ebd0ac8 100644 --- a/source-code/source/PD-Loader/Patches/PatchApplier600.h +++ b/source-code/source/PD-Loader/Patches/PatchApplier600.h @@ -1,7 +1,7 @@ #pragma once #include #include "PatchApplier.h" -#include "framework.h" +#include "patches-framework.h" class PatchApplier600 : public PatchApplier { virtual void ApplyPatches() { @@ -127,14 +127,6 @@ class PatchApplier600 : public PatchApplier { printf("[Patches] MLAA disabled\n"); } - // Replace the hardcoded videos with MP4s, if they exist - if (nMP4Movies) - { - patchMovieExt("adv_cfm_cm", (void*)0x0000000140989ED5); - patchMovieExt("adv_sega_cm", (void*)0x0000000140989EF6); - patchMovieExt("diva_adv02", (void*)0x00000001409C537D); - patchMovieExt("diva_adv", (void*)0x00000001409C53AB); - } // Hide "FREE PLAY" if (nHideFreeplay) { diff --git a/source-code/source/PD-Loader/Patches/PatchApplier710.h b/source-code/source/PD-Loader/Patches/PatchApplier710.h index ad084a5..95107db 100644 --- a/source-code/source/PD-Loader/Patches/PatchApplier710.h +++ b/source-code/source/PD-Loader/Patches/PatchApplier710.h @@ -3,7 +3,7 @@ #pragma once #include #include "PatchApplier.h" -#include "framework.h" +#include "patches-framework.h" class PatchApplier710 : public PatchApplier { virtual void ApplyPatches() { @@ -129,17 +129,6 @@ class PatchApplier710 : public PatchApplier { printf("[Patches] MLAA disabled\n"); } - // Replace the hardcoded videos with MP4s, if they exist - if (nMP4Movies) - { - patchMovieExt("adv_cm_01", (void*)0x00000001409A53CC); - patchMovieExt("adv_cm_02", (void*)0x00000001409A53E4); - patchMovieExt("adv_cm_03", (void*)0x00000001409A53FC); - patchMovieExt("adv_cfm_cm", (void*)0x00000001409C22CD); - patchMovieExt("adv_sega_cm", (void*)0x00000001409C22EE); - patchMovieExt("diva_adv02", (void*)0x00000001409FF455); - patchMovieExt("diva_adv", (void*)0x00000001409FF483); - } // Hide "FREE PLAY" if (nHideFreeplay) { @@ -157,7 +146,10 @@ class PatchApplier710 : public PatchApplier { if (nPDLoaderText && !nHideFreeplay) { - InjectCode((void*)0x00000001409F61F0, { 0x50, 0x44, 0x20, 0x4C, 0x6F, 0x61, 0x64, 0x65, 0x72, 0x20, 0x00 }); + InjectCode((void*)0x00000001409F61F0, { 0x50, 0x44, 0x20 }); + InjectCode((void*)0x00000001409F61F3, { 0x4C, 0x6F, 0x61 }); + InjectCode((void*)0x00000001409F61F6, { 0x64, 0x65, 0x72 }); + InjectCode((void*)0x00000001409F61F9, { 0x20, 0x00 }); printf("[Patches] Show PD Loader text\n"); } } @@ -689,5 +681,109 @@ class PatchApplier710 : public PatchApplier { printf("[Patches] Lag Compensation: %f\n", startPos); } + + // no message bar + if (nNoMessageBar) + { + InjectCode((void*)(0x1409F6470), { 0x00 }); + + // no scrolling message by snakemi + InjectCode((void*)(0x1403B98FD), { 0x00, 0x00, 0x00, 0x00 }); + InjectCode((void*)(0x1403B9904), { 0x00, 0x00, 0x00, 0x00 }); + InjectCode((void*)(0x1403B990B), { 0x00, 0x00, 0x00, 0x00 }); + } + + // no stage text + if (nNoStageText) + { + InjectCode((void*)(0x140A3D4C8), { 0x00 }); + InjectCode((void*)(0x140A3D4D8), { 0x00 }); + InjectCode((void*)(0x140A3D4E8), { 0x00 }); + InjectCode((void*)(0x140A3D4F8), { 0x00 }); + InjectCode((void*)(0x140A3D508), { 0x00 }); + InjectCode((void*)(0x140A3D518), { 0x00 }); + InjectCode((void*)(0x140A3D530), { 0x00 }); + InjectCode((void*)(0x140A3D540), { 0x00 }); + InjectCode((void*)(0x140A3D550), { 0x00 }); + } + + // no osage play data by Skyth + if (nNoOpd) + { + InjectCode((void*)(0x1404728C0), { 0xC3 }); + InjectCode((void*)(0x1404789C3), { 0x0D }); + } + + // debug scaling by somewhatlurker + if (nDwguiScaling) + { + InjectCode((void*)(0x1402ffccf), { 0x0d, 0x00, 0x00, 0x00 }); // 720p res index + + InjectCode((void*)(0x1403025f2), { 0x48, 0x8d, 0x05, 0x17, 0x65, 0x6b, 0x00 }); // LEA RAX, [0x1409b8b10] (720p res info at +0xc, +-x10) + InjectCode((void*)(0x1403025f9), { 0xeb, 0xb3 }); // JMP 0x1403025ae + InjectCode((void*)(0x1403025a9), { 0xeb, 0x47 }); // JMP 0x1403025f2 + + + // hacky fix for mouse input scaling + // someone please fix this properly if possible + + // directly load mouse coordinates to xmm0 to save code space + InjectCode((void*)(0x140300a62), { 0x0f, 0x2a, 0x86, 0xa0, 0x00, 0x00, 0x00 }); // CVTPI2PS XMM0, qword ptr[RSI + 0xa0] + // load 720p + InjectCode((void*)(0x140300a69), { 0x0f, 0x2a, 0x0d, 0xac, 0x80, 0x6b, 0x00 }); // CVTPI2PS XMM1, qword ptr [0x1409b8b1c] + // load native res (140eda8b0 is the native res version of the above 720p res info) + InjectCode((void*)(0x140300a70), { 0x0f, 0x2a, 0x15, 0x45, 0x9e, 0xbd, 0x00 }); // CVTPI2PS XMM2, qword ptr [0x140eda8bc] + // math + InjectCode((void*)(0x140300a77), { 0x0f, 0x59, 0xc1 }); // MULPS XMM0, XMM1 + InjectCode((void*)(0x140300a7a), { 0x0f, 0x5e, 0xc2 }); // DIVPS XMM0, XMM2 + // used this space, go elsewhere + InjectCode((void*)(0x140300a7d), { 0xe9, 0x83, 0x06, 0x00, 0x00 }); // JMP 0x140301105 + + // need to restore this instruction + InjectCode((void*)(0x140301105), { 0x0f, 0x57, 0xe4 }); // XORPS XMM4, XMM4 + // need to unpack XMM0 into XMM1 and XMM0 + InjectCode((void*)(0x140301108), { 0xf3, 0x0f, 0x10, 0xc8 }); // MOVSS XMM1, XMM0 + // move to new space + InjectCode((void*)(0x14030110c), { 0xeb, 0x07 }); // JMP 0x140301115 + // copy high float of xmm0 to low float of xmm0 + InjectCode((void*)(0x140301115), { 0x0f, 0xc6, 0xc0, 0x55 }); // SHUFPS XMM0, XMM0, 0x55 + // finally back to original code + InjectCode((void*)(0x140301119), { 0xe9, 0x64, 0xf9, 0xff, 0xff }); // JMP 0x140300a82 + + // don't need these anymore + InjectCode((void*)(0x140300a82), { 0x90, 0x90, 0x90 }); // NOPs + InjectCode((void*)(0x140300a88), { 0x90, 0x90, 0x90 }); // NOPs + } + + // modpack redirection + /*{ + wchar_t* mpstr = NULL; + mpstr = (wchar_t*)malloc(256); + memset(mpstr, 0, 256); + GetPrivateProfileStringW(L"Mods", L"Modpack", L"", mpstr, 256, CONFIG_FILE_NAME); + std::string modpack_name(std::filesystem::path(mpstr).string()); + free(mpstr); + std::cout << "[Patches] Modpack name: " << modpack_name << std::endl; + + if (modpack_name != "") + { + // ram + std::string modpack_path = "modpacks\\" + modpack_name; + std::cout << "[Patches] New ram path: " << modpack_path << std::endl; + char* mpstr_path = (char*)malloc(modpack_path.size()); + memcpy(mpstr_path, modpack_path.c_str(), modpack_path.size()); + InjectLong((void*)0x0000000014096C120, (long)mpstr_path); + + // mdata + std::string modpack_mdata = "modpacks\\" + modpack_name + "\\mdata"; + std::cout << "[Patches] New mdata path: " << modpack_mdata << std::endl; + char* mpstr_mdata = (char*)malloc(modpack_mdata.size()); + memcpy(mpstr_mdata, modpack_mdata.c_str(), modpack_mdata.size()); + InjectCode((void*)0x000000014066CEA0, { 0x48, 0xC7, 0xC2 }); + InjectInt((void*)0x000000014066CEA3, (int)mpstr_mdata); + InjectCode((void*)0x000000014066CE9C, { (unsigned char)modpack_mdata.size() }); + InjectCode((void*)0x000000014066CEAE, { (unsigned char)modpack_mdata.size() }); + } + }*/ } }; \ No newline at end of file diff --git a/source-code/source/PD-Loader/Patches/patches-framework.h b/source-code/source/PD-Loader/Patches/patches-framework.h index 74cc19a..a86c987 100644 --- a/source-code/source/PD-Loader/Patches/patches-framework.h +++ b/source-code/source/PD-Loader/Patches/patches-framework.h @@ -47,37 +47,28 @@ void InjectCode(void* address, const std::vector data) VirtualProtect(address, byteCount, oldProtect, nullptr); } -// patchMovieExt will modify an extension to mp4 only if the file exists on disk as an mp4 -void patchMovieExt(std::string moviefile, void* address) +void InjectInt(void* address, const int data) { - bool isinmdata = 0; - try { - for (std::filesystem::path p : std::filesystem::directory_iterator("../mdata")) - { - if (std::filesystem::path(p).filename().string().at(0) != 'M' || std::filesystem::path(p).filename().string().length() > 4) continue; - if (std::filesystem::exists(p.string() + "/rom/movie/" + moviefile + ".mp4")) - { - isinmdata = 1; - //std::cout << "[Patches] Movie " << moviefile << ".mp4 found in M" << ss.str() << std::endl; - break; - } - } - } - catch (const std::filesystem::filesystem_error& e) { - std::cout << "[Patches] File system error " << e.what() << " " << e.path1() << " " << e.path2() << " " << e.code() << std::endl; - } + const size_t byteCount = sizeof(int); - if (isinmdata || std::filesystem::exists("../rom/movie/" + moviefile + ".mp4")) - { - InjectCode(address, { 0x6D, 0x70, 0x34 }); - std::cout << "[Patches] Movie " << moviefile << " patched to mp4\n"; - return; - } - //std::cout << "[Patches] Movie " << moviefile << " NOT patched to mp4\n"; - return; + DWORD oldProtect; + VirtualProtect(address, byteCount, PAGE_EXECUTE_READWRITE, &oldProtect); + *(int*)address = data; + VirtualProtect(address, byteCount, oldProtect, nullptr); } -const LPCWSTR CONFIG_FILE = L".\\config.ini"; +void InjectLong(void* address, const long data) +{ + const size_t byteCount = sizeof(long); + + DWORD oldProtect; + VirtualProtect(address, byteCount, PAGE_EXECUTE_READWRITE, &oldProtect); + *(long*)address = data; + VirtualProtect(address, byteCount, oldProtect, nullptr); +} + +const LPCWSTR CONFIG_FILE = L"plugins\\config.ini"; +const LPCWSTR CONFIG_FILE_NAME = L".\\config.ini"; auto nCursor = GetPrivateProfileIntW(L"patches", L"cursor", TRUE, CONFIG_FILE); auto nHideFreeplay = GetPrivateProfileIntW(L"patches", L"hide_freeplay", FALSE, CONFIG_FILE); @@ -89,7 +80,6 @@ auto nNoPVUi = GetPrivateProfileIntW(L"patches", L"no_pv_ui", FALSE, CONFIG_FILE auto nHideVolCtrl = GetPrivateProfileIntW(L"patches", L"hide_volume", FALSE, CONFIG_FILE); auto nNoLyrics = GetPrivateProfileIntW(L"patches", L"no_lyrics", FALSE, CONFIG_FILE); auto nNoMovies = GetPrivateProfileIntW(L"patches", L"no_movies", FALSE, CONFIG_FILE); -auto nMP4Movies = GetPrivateProfileIntW(L"patches", L"mp4_movies", FALSE, CONFIG_FILE); auto nNoError = GetPrivateProfileIntW(L"patches", L"no_error", FALSE, CONFIG_FILE); auto nNoTimer = GetPrivateProfileIntW(L"patches", L"no_timer", TRUE, CONFIG_FILE); auto nNoTimerSprite = GetPrivateProfileIntW(L"patches", L"no_timer_sprite", TRUE, CONFIG_FILE); @@ -105,7 +95,8 @@ auto nMLAA = GetPrivateProfileIntW(L"graphics", L"mlaa", TRUE, CONFIG_FILE); auto nDoF = GetPrivateProfileIntW(L"graphics", L"dof", TRUE, CONFIG_FILE); auto nMAG = GetPrivateProfileIntW(L"graphics", L"mag", 0, CONFIG_FILE); auto nStereo = GetPrivateProfileIntW(L"patches", L"stereo", TRUE, CONFIG_FILE); -auto nCustomPatches = GetPrivateProfileIntW(L"patches", L"custom_patches", TRUE, CONFIG_FILE); +auto nBuiltinPatches = GetPrivateProfileIntW(L"global", L"builtin_patches", TRUE, CONFIG_FILE); +auto nCustomPatches = GetPrivateProfileIntW(L"global", L"custom_patches", TRUE, CONFIG_FILE); auto nQuickStart = GetPrivateProfileIntW(L"patches", L"quick_start", 1, CONFIG_FILE); auto nNoScrollingSfx = GetPrivateProfileIntW(L"patches", L"no_scrolling_sfx", FALSE, CONFIG_FILE); auto nNoHandScaling = GetPrivateProfileIntW(L"patches", L"no_hand_scaling", FALSE, CONFIG_FILE); @@ -126,4 +117,8 @@ auto nReflectResWidth = GetPrivateProfileIntW(L"graphics", L"reflect_res_width", auto nReflectResHeight = GetPrivateProfileIntW(L"graphics", L"reflect_res_height", 256, CONFIG_FILE); auto nRefractResWidth = GetPrivateProfileIntW(L"graphics", L"refract_res_width", 512, CONFIG_FILE); auto nRefractResHeight = GetPrivateProfileIntW(L"graphics", L"refract_res_height", 256, CONFIG_FILE); -auto nLagCompensation = GetPrivateProfileIntW(L"graphics", L"lag_compensation", 0, CONFIG_FILE); \ No newline at end of file +auto nLagCompensation = GetPrivateProfileIntW(L"graphics", L"lag_compensation", 0, CONFIG_FILE); +auto nNoMessageBar = GetPrivateProfileIntW(L"patches", L"no_message_bar", FALSE, CONFIG_FILE); +auto nNoStageText = GetPrivateProfileIntW(L"patches", L"no_stage_text", FALSE, CONFIG_FILE); +auto nNoOpd = GetPrivateProfileIntW(L"patches", L"no_opd", FALSE, CONFIG_FILE); +auto nDwguiScaling = GetPrivateProfileIntW(L"patches", L"dwgui_scaling", FALSE, CONFIG_FILE); diff --git a/source-code/source/PD-Loader/Patches/patches.cpp b/source-code/source/PD-Loader/Patches/patches.cpp index 1096aef..dade6de 100644 --- a/source-code/source/PD-Loader/Patches/patches.cpp +++ b/source-code/source/PD-Loader/Patches/patches.cpp @@ -7,24 +7,19 @@ #include #include #include -#include "PluginConfigApi.h" +#include "patches.h" +//#include "PluginConfigApi.h" #include "PatchApplier.h" #include "PatchApplier600.h" #include "PatchApplier710.h" #include -#include "framework.h" +#include "patches-framework.h" #pragma comment(lib, "detours.lib") -unsigned short game_version = 710; +extern unsigned short game_version; -void InjectCode(void* address, const std::vector data); -void ApplyPatches(); -void ApplyCustomPatches(std::wstring CPATCH_FILE_STRING); - - - -HMODULE *hModulePtr; +/*HMODULE* hModulePtr; BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, @@ -35,7 +30,6 @@ BOOL APIENTRY DllMain(HMODULE hModule, { case DLL_PROCESS_ATTACH: hModulePtr = &hModule; - if (*(char*)0x140A570F0 == '6') game_version = 600; ApplyPatches(); case DLL_THREAD_ATTACH: case DLL_THREAD_DETACH: @@ -43,43 +37,54 @@ BOOL APIENTRY DllMain(HMODULE hModule, break; } return TRUE; -} +}*/ void ApplyPatches() { - std::string version_string = std::to_string(game_version); - version_string.insert(version_string.begin()+1, '.'); - std::cout << "[Patches] Game version " + version_string << std::endl; - - PatchApplier* pa; - - switch (game_version) + if (nBuiltinPatches) { - case 600: - pa = new PatchApplier600; - break; - default: - pa = new PatchApplier710; + if (*(char*)0x140A570F0 == '6') game_version = 600; + + std::string version_string = std::to_string(game_version); + version_string.insert(version_string.begin()+1, '.'); + std::cout << "[Patches] Game version " + version_string << std::endl; + + PatchApplier* pa; + + switch (game_version) + { + case 600: + pa = new PatchApplier600; + break; + default: + pa = new PatchApplier710; + } + + pa->ApplyPatches(); + printf("[Patches] Patches applied\n"); } +} - pa->ApplyPatches(); - printf("[Patches] Patches applied\n"); - +void ApplyAllCustomPatches() +{ if (nCustomPatches) { - std::cout << "[Patches] Reading custom patches...\n"; + std::cout << "[Patches] Reading custom patches in " << std::filesystem::current_path().string() << "\\patches" << std::endl; try { - for (std::filesystem::path p : std::filesystem::directory_iterator("../patches")) + for (std::filesystem::path p : std::filesystem::directory_iterator("patches")) { std::string extension = std::filesystem::path(p).extension().string(); - if ((extension == ".p" || extension == ".P" || extension == ".p2" || extension == ".P2") && - GetPrivateProfileIntW(L"plugins", std::filesystem::path(p).filename().c_str(), TRUE, CONFIG_FILE)) + if ((extension == ".p" || extension == ".P" || extension == ".p2" || extension == ".P2")) { - std::cout << "[Patches] Reading custom patch file: " << std::filesystem::path(p).filename().string() << std::endl; - ApplyCustomPatches(std::filesystem::path(p).wstring()); + if (GetPrivateProfileIntW(L"plugins", std::filesystem::path(p).filename().c_str(), FALSE, CONFIG_FILE)) + { + std::cout << "[Patches] Reading custom patch file: " << std::filesystem::path(p).filename().string() << std::endl; + ApplyCustomPatches(std::filesystem::path(p).wstring()); + } + else std::cout << "[Patches] Skipping disabled patch file: " << std::filesystem::path(p).filename().string() << std::endl; } } } - catch (const std::filesystem::filesystem_error &e) { + catch (const std::filesystem::filesystem_error& e) { std::cout << "[Patches] File system error " << e.what() << " " << e.path1() << " " << e.path2() << " " << e.code() << std::endl; } @@ -87,8 +92,6 @@ void ApplyPatches() { } } - - void ApplyCustomPatches(std::wstring CPATCH_FILE_STRING) { LPCWSTR CPATCH_FILE = CPATCH_FILE_STRING.c_str(); @@ -242,7 +245,7 @@ void ApplyCustomPatches(std::wstring CPATCH_FILE_STRING) } -using namespace PluginConfig; +/*using namespace PluginConfig; extern "C" __declspec(dllexport) LPCWSTR GetPluginName(void) { @@ -252,4 +255,4 @@ extern "C" __declspec(dllexport) LPCWSTR GetPluginName(void) extern "C" __declspec(dllexport) LPCWSTR GetPluginDescription(void) { return L"Applies patches/tweaks to the game before it starts.\nThis plugin is required."; -} \ No newline at end of file +}*/ \ No newline at end of file diff --git a/source-code/source/PD-Loader/Patches/patches.h b/source-code/source/PD-Loader/Patches/patches.h new file mode 100644 index 0000000..e394dfa --- /dev/null +++ b/source-code/source/PD-Loader/Patches/patches.h @@ -0,0 +1,5 @@ +#pragma once +void InjectCode(void* address, const std::vector data); +void ApplyPatches(); +void ApplyAllCustomPatches(); +void ApplyCustomPatches(std::wstring CPATCH_FILE_STRING); diff --git a/source-code/source/PD-Loader/Render/render-framework.h b/source-code/source/PD-Loader/Render/render-framework.h index 219cfb5..a40137c 100644 --- a/source-code/source/PD-Loader/Render/render-framework.h +++ b/source-code/source/PD-Loader/Render/render-framework.h @@ -47,6 +47,8 @@ int nFpsLimit = GetPrivateProfileIntW(L"graphics", L"fps.limit", 60, CONFIG_FILE int nUseLightLimiter = GetPrivateProfileIntW(L"graphics", L"fps.limit.lightmode", TRUE, CONFIG_FILE); int nVerboseLimiter = GetPrivateProfileIntW(L"graphics", L"fps.limit.verbose", FALSE, CONFIG_FILE); +int nBuiltinRender = GetPrivateProfileIntW(L"global", L"builtin_render", TRUE, CONFIG_FILE); + // used to trick Optimus into switching to the NVIDIA GPU HMODULE nvcudaModule = LoadLibraryW(L"nvcuda.dll"); // cuInit actually returns a CUresult, but we don't really care about it diff --git a/source-code/source/PD-Loader/Render/render.cpp b/source-code/source/PD-Loader/Render/render.cpp index 4510bb0..e1325c3 100644 --- a/source-code/source/PD-Loader/Render/render.cpp +++ b/source-code/source/PD-Loader/Render/render.cpp @@ -1,4 +1,5 @@ -#include "framework.h" +#include "render-framework.h" +#include "render.h" #include #pragma comment(lib, "detours.lib") #include @@ -11,11 +12,11 @@ #include -#include "PluginConfigApi.h" +//#include "PluginConfigApi.h" using namespace std::chrono; -unsigned short game_version = 710; +extern unsigned short game_version; void exitGameClean(int) { @@ -262,12 +263,9 @@ extern "C" __declspec(dllexport) void setFramerateLimit(int framerate) return; } -BOOL APIENTRY DllMain(HMODULE hModule, - DWORD ul_reason_for_call, - LPVOID lpReserved -) +void ApplyRender(HMODULE hModule) { - if (ul_reason_for_call == DLL_PROCESS_ATTACH) + if (nBuiltinRender) { if (*(char*)0x140A570F0 == '6') game_version = 600; @@ -342,7 +340,7 @@ BOOL APIENTRY DllMain(HMODULE hModule, case 600: { DWORD oldProtect, bck; - VirtualProtect((BYTE*)0x0000000140980954, 4, PAGE_EXECUTE_READWRITE, &oldProtect); + VirtualProtect((BYTE*)0x0000000140980954, 4, PAGE_EXECUTE_READWRITE, &oldProtect); *((int*)0x0000000140980954) = nIntResWidth; VirtualProtect((BYTE*)0x0000000140980954, 6, oldProtect, &bck); } @@ -354,33 +352,44 @@ BOOL APIENTRY DllMain(HMODULE hModule, } break; default: - { - DWORD oldProtect, bck; - VirtualProtect((BYTE*)0x00000001409B8B68, 4, PAGE_EXECUTE_READWRITE, &oldProtect); - *((int*)0x00000001409B8B68) = nIntResWidth; - VirtualProtect((BYTE*)0x00000001409B8B68, 6, oldProtect, &bck); - } - { - DWORD oldProtect, bck; - VirtualProtect((BYTE*)0x00000001409B8B6C, 4, PAGE_EXECUTE_READWRITE, &oldProtect); - *((int*)0x00000001409B8B6C) = nIntResHeight; - VirtualProtect((BYTE*)0x00000001409B8B6C, 6, oldProtect, &bck); - } + { + DWORD oldProtect, bck; + VirtualProtect((BYTE*)0x00000001409B8B68, 4, PAGE_EXECUTE_READWRITE, &oldProtect); + *((int*)0x00000001409B8B68) = nIntResWidth; + VirtualProtect((BYTE*)0x00000001409B8B68, 6, oldProtect, &bck); + } + { + DWORD oldProtect, bck; + VirtualProtect((BYTE*)0x00000001409B8B6C, 4, PAGE_EXECUTE_READWRITE, &oldProtect); + *((int*)0x00000001409B8B6C) = nIntResHeight; + VirtualProtect((BYTE*)0x00000001409B8B6C, 6, oldProtect, &bck); + } - //*((int*)0x00000001409B8B6C) = maxHeight; - //*((int*)0x00000001409B8B14) = maxWidth; - //*((int*)0x00000001409B8B18) = maxHeight; + //*((int*)0x00000001409B8B6C) = maxHeight; + //*((int*)0x00000001409B8B14) = maxWidth; + //*((int*)0x00000001409B8B18) = maxHeight; - //*((int*)0x00000001409B8B1C) = maxWidth; // No parameters width? - //*((int*)0x00000001409B8B20) = maxHeight; // No parameters height? + //*((int*)0x00000001409B8B1C) = maxWidth; // No parameters width? + //*((int*)0x00000001409B8B20) = maxHeight; // No parameters height? } } } - return TRUE; } +/*BOOL APIENTRY DllMain(HMODULE hModule, + DWORD ul_reason_for_call, + LPVOID lpReserved +) +{ + if (ul_reason_for_call == DLL_PROCESS_ATTACH) + { + ApplyRender(hModule); + } + return TRUE; +}*/ -using namespace PluginConfig; + +/*using namespace PluginConfig; extern "C" __declspec(dllexport) LPCWSTR GetPluginName(void) { @@ -390,4 +399,4 @@ extern "C" __declspec(dllexport) LPCWSTR GetPluginName(void) extern "C" __declspec(dllexport) LPCWSTR GetPluginDescription(void) { return L"Applies window mode/size and FPS limiting."; -} \ No newline at end of file +}*/ \ No newline at end of file diff --git a/source-code/source/PD-Loader/Render/render.h b/source-code/source/PD-Loader/Render/render.h new file mode 100644 index 0000000..3a7b3a4 --- /dev/null +++ b/source-code/source/PD-Loader/Render/render.h @@ -0,0 +1,8 @@ +#pragma once +void exitGameClean(int); +int hookedCreateWindow(const char* title, void(__cdecl* exit_function)(int)); +__int64 hookedParseParameters(int a1, __int64* a2); +__int64 __fastcall limiterFuncNormal(__int64 a1); +__int64 __fastcall limiterFuncLight(__int64 a1); +__int64 __fastcall hookedEngineUpdate(__int64 a1); +void ApplyRender(HMODULE hModule); diff --git a/source-code/source/PD-Loader/dllmain.cpp b/source-code/source/PD-Loader/dllmain.cpp index 8a94733..09980dc 100644 --- a/source-code/source/PD-Loader/dllmain.cpp +++ b/source-code/source/PD-Loader/dllmain.cpp @@ -1,5 +1,8 @@ #include "framework.h" #include "exception.hpp" +#include "Patches\patches.h" +#include "Render\render.h" +#include "templates.h" #include #include #pragma comment(lib, "Shlwapi.lib") @@ -13,6 +16,8 @@ processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") HMODULE hm; std::vector iniPaths; +unsigned short game_version = 710; + bool iequals(std::wstring_view s1, std::wstring_view s2) { std::wstring str1(std::move(s1)); @@ -215,13 +220,19 @@ void FindFiles(WIN32_FIND_DATAW* fd) do { if (!(fd->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { + if (!_wcsicmp(fd->cFileName, L"Patches.dva") || !_wcsicmp(fd->cFileName, L"Render.dva")) + { + DeleteFileW(fd->cFileName); + continue; + } + auto pos = wcslen(fd->cFileName); if (fd->cFileName[pos - 4] == '.' && (fd->cFileName[pos - 3] == 'd' || fd->cFileName[pos - 3] == 'D') && (fd->cFileName[pos - 2] == 'v' || fd->cFileName[pos - 2] == 'V') && (fd->cFileName[pos - 1] == 'a' || fd->cFileName[pos - 1] == 'A') && - GetPrivateProfileIntW(L"plugins", fd->cFileName, TRUE, iniPaths)) + GetPrivateProfileIntW(L"plugins", fd->cFileName, FALSE, iniPaths)) { auto path = dir + L'\\' + fd->cFileName; @@ -246,20 +257,23 @@ void LoadPlugins() { if (SetCurrentDirectoryW(szSelfPath.c_str())) { - WIN32_FIND_DATAW dh; + /*WIN32_FIND_DATAW dh; HANDLE divaHook = FindFirstFileW(L"divahook.dll", &dh); if (divaHook != INVALID_HANDLE_VALUE && !(dh.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { printf("[PD Loader] Loading divahook.dll\n"); auto path = szSelfPath + L'\\' + dh.cFileName; LoadDVA(path, szSelfPath.c_str(), dh.cFileName); - } + }*/ if (SetCurrentDirectoryW(L"plugins\\")) { WIN32_FIND_DATAW fd; FindFiles(&fd); } } + ApplyPatches(); + if (SetCurrentDirectoryW(szSelfPath.c_str())) ApplyAllCustomPatches(); + ApplyRender(hm); } SetCurrentDirectoryW(oldDir.c_str()); // Reset the current directory @@ -737,40 +751,55 @@ void Init() moduleName.resize(moduleName.find_last_of(L'.')); modulePath.resize(modulePath.find_last_of(L"/\\") + 1); iniPaths.emplace_back(modulePath + moduleName + L".ini"); + const auto CONFIG_FILE = L"plugins\\config.ini"; - const auto CONFIG_FILE_TEMPLATE = L"plugins\\config_template.bin"; iniPaths.emplace_back(modulePath + CONFIG_FILE); // initialize configuration files. - CopyFileW(CONFIG_FILE_TEMPLATE, CONFIG_FILE, true); - const auto COMPONENTS_TEMPLATE = L"plugins\\components_template.bin"; - const auto COMPONENTS = L"plugins\\components.ini"; - CopyFileW(COMPONENTS_TEMPLATE, COMPONENTS, true); - const auto KEYCONFIG_TEMPLATE = L"plugins\\keyconfig_template.bin"; - const auto KEYCONFIG = L"plugins\\keyconfig.ini"; - CopyFileW(KEYCONFIG_TEMPLATE, KEYCONFIG, true); - const auto PLAYERDATA_TEMPLATE = L"plugins\\playerdata_template.bin"; - const auto PLAYERDATA = L"plugins\\playerdata.ini"; - CopyFileW(PLAYERDATA_TEMPLATE, PLAYERDATA, true); - const auto DIVASOUND_TEMPLATE = L"plugins\\DivaSound_template.bin"; - const auto DIVASOUND = L"plugins\\DivaSound.ini"; - CopyFileW(DIVASOUND_TEMPLATE, DIVASOUND, true); - const auto SHADERPATCH_TEMPLATE = L"plugins\\ShaderPatch_template.bin"; - const auto SHADERPATCH = L"plugins\\ShaderPatch.ini"; - CopyFileW(SHADERPATCH_TEMPLATE, SHADERPATCH, true); - const auto SHADERPATCHCONFIG_TEMPLATE = L"plugins\\ShaderPatchConfig_template.bin"; - const auto SHADERPATCHCONFIG = L"plugins\\ShaderPatchConfig.ini"; - CopyFileW(SHADERPATCHCONFIG_TEMPLATE, SHADERPATCHCONFIG, true); + WCHAR config_pcname[MAX_COMPUTERNAME_LENGTH + 1]; + GetPrivateProfileStringW(L"global", L"pc", L"", config_pcname, MAX_COMPUTERNAME_LENGTH + 1, CONFIG_FILE); + WCHAR this_pcname[MAX_COMPUTERNAME_LENGTH + 1]; + DWORD count = MAX_COMPUTERNAME_LENGTH + 1; + if(GetComputerNameW(this_pcname, &count) && PathFileExistsW(CONFIG_FILE) && wcscmp(config_pcname, this_pcname)!=0) + { + auto cfgsel = MessageBoxW(nullptr, L"Incompatible configuration found. This can happen if you are upgrading.\n\nIf you are not upgrading, then this version of PD Loader was likely hacked or used on another computer.\nIt is recommended to download the latest version from the official repository and do a clean installation (delete plugins/, patches/, dnsapi.dll and/or dinput8.dll, and restore glut32.dll).\n\nRestore the default settings?", L"PD Loader", MB_YESNOCANCEL | MB_ICONWARNING); + if (cfgsel == IDYES) if(!DeleteFileW(CONFIG_FILE)) + { + MessageBoxW(nullptr, L"Cannot delete config.ini.\n\nThe file might be read-only or in use (is the game still running?).", L"PD Loader", MB_OK | MB_ICONERROR); + exit(1); + } + else if(cfgsel != IDNO) exit(1); + } - if ((PathFileExistsW(CONFIG_FILE_TEMPLATE) && !PathFileExistsW(CONFIG_FILE)) || - (PathFileExistsW(COMPONENTS_TEMPLATE) && !PathFileExistsW(COMPONENTS)) || - (PathFileExistsW(KEYCONFIG_TEMPLATE) && !PathFileExistsW(KEYCONFIG)) || - (PathFileExistsW(PLAYERDATA_TEMPLATE) && !PathFileExistsW(PLAYERDATA)) || - (PathFileExistsW(DIVASOUND_TEMPLATE) && !PathFileExistsW(DIVASOUND)) || - (PathFileExistsW(SHADERPATCH_TEMPLATE) && !PathFileExistsW(SHADERPATCH)) || - (PathFileExistsW(SHADERPATCHCONFIG_TEMPLATE) && !PathFileExistsW(SHADERPATCHCONFIG)) - ) + + if (!PathFileExistsW(CONFIG_FILE)) + { + writeTemplate(config_template, CONFIG_FILE); + WritePrivateProfileStringW(L"global", L"pc", this_pcname, CONFIG_FILE); + WritePrivateProfileStringW(L"plugins", L"Launcher.dva", L"1", CONFIG_FILE); + WritePrivateProfileStringW(L"plugins", L"DivaSound.dva", L"1", CONFIG_FILE); + WritePrivateProfileStringW(L"plugins", L"TLAC.dva", L"1", CONFIG_FILE); + WritePrivateProfileStringW(L"plugins", L"Novidia.dva", L"1", CONFIG_FILE); + WritePrivateProfileStringW(L"plugins", L"ShaderPatch.dva", L"1", CONFIG_FILE); + } + const auto COMPONENTS = L"plugins\\components.ini"; + if (!PathFileExistsW(COMPONENTS)) writeTemplate(components_template, COMPONENTS); + const auto KEYCONFIG = L"plugins\\keyconfig.ini"; + if (!PathFileExistsW(KEYCONFIG)) writeTemplate(keyconfig_template, KEYCONFIG); + const auto PLAYERDATA = L"plugins\\playerdata.ini"; + if (!PathFileExistsW(PLAYERDATA)) writeTemplate(playerdata_template, PLAYERDATA); + const auto DIVASOUND = L"plugins\\DivaSound.ini"; + if (!PathFileExistsW(DIVASOUND)) writeTemplate(divasound_template, DIVASOUND); + const auto SHADERPATCHCONFIG = L"plugins\\ShaderPatchConfig.ini"; + if (!PathFileExistsW(SHADERPATCHCONFIG)) writeTemplate(shaderpatchconfig_template, SHADERPATCHCONFIG); + + if (!PathFileExistsW(CONFIG_FILE) || + !PathFileExistsW(COMPONENTS) || + !PathFileExistsW(KEYCONFIG) || + !PathFileExistsW(PLAYERDATA) || + !PathFileExistsW(DIVASOUND) || + !PathFileExistsW(SHADERPATCHCONFIG)) MessageBoxW(0, L"Could not install configuration files. Is the game in a read-only folder?", L"PD Loader", MB_ICONWARNING); CreateDirectoryW(L"plugins\\pv_equip", NULL); @@ -858,7 +887,7 @@ void Init() } else if (!MoveFileExW(L"dinput8.dll", L"~dinput8.dll", MOVEFILE_REPLACE_EXISTING | MOVEFILE_WRITE_THROUGH)) { - MessageBoxW(0, L"PD Loader was loaded from \"dnsapi.dll\", but \"dinput8.dll\" was found and PD Loader could not delete it automatically\nIs it read-only?", L"PD Loader", MB_ICONERROR); + MessageBoxW(0, L"PD Loader was loaded from \"dnsapi.dll\", but \"dinput8.dll\" was found and PD Loader could not delete it automatically\nIs the file read-only? Or is the game still running?", L"PD Loader", MB_ICONERROR); exit(1); } } diff --git a/source-code/source/PD-Loader/templates.cpp b/source-code/source/PD-Loader/templates.cpp new file mode 100644 index 0000000..d4a122e --- /dev/null +++ b/source-code/source/PD-Loader/templates.cpp @@ -0,0 +1,13 @@ +#include + +using namespace std; + +void writeTemplate(char* cfgtemplate, const wchar_t* filename) +{ + ofstream out; + out.open(filename); + out << cfgtemplate; + out.close(); + + return; +} diff --git a/source-code/source/PD-Loader/templates.h b/source-code/source/PD-Loader/templates.h new file mode 100644 index 0000000..1733410 --- /dev/null +++ b/source-code/source/PD-Loader/templates.h @@ -0,0 +1,539 @@ +#pragma once + +void writeTemplate(char* cfgtemplate, const wchar_t* filename); + +char config_template[] = +{"#########################################\n" +"# /!\ WARNING: DO NOT EDIT WITH NOTEPAD!#\n" +"#########################################\n" +"\n" +"[Global]\n" +"# Load plugins including below options\n" +"Enable=1\n" +"# Enable built-in patches\n" +"Builtin_Patches=1\n" +"# Enable custom patches\n" +"Custom_Patches=1\n" +"# Enable built-in render\n" +"Builtin_Render=1\n" +"# PC\n" +"pc=\n" +"\n" +"[GPU]\n" +"# Force GPU model -- -1=auto, 0=Kepler, 1=Maxwell, 2=Turing, 3=Ampere\n" +"Model=-1\n" +"\n" +"[Launcher]\n" +"# Forces the launcher to be skipped, you can use the --launch parameter instead of this.\n" +"Skip=0\n" +"# Disables unsupported GPU warning dialogs.\n" +"No_GPU_Dialog=0\n" +"# Sets the dark colour scheme in the launcher.\n" +"Dark_Launcher=0\n" +"# Ignores some OpenGL-related errors. Don't use both patches at the same time unless you're know what you're doing\n" +"OpenGL_Patch_A=0\n" +"# Ignores some OpenGL-related errors. Don't use both patches at the same time unless you're know what you're doing\n" +"OpenGL_Patch_B=0\n" +"# Command line arguments\n" +"Command_Line=\n" +"# Launches divahook.bat intead of diva.exe.\n" +"Use_divahook_bat=0\n" +"\n" +"[Patches]\n" +"# Disable movies (enable this if the game hangs when loading certain PVs)\n" +"No_Movies=0\n" +"# Enable or disable mouse cursor\n" +"Cursor=1\n" +"# Use 2 channels instead of 4 (when not using DivaSound)\n" +"Stereo=1\n" +"# Skip one or more menus -- 0=disabled, 1=guest, 2=guest+normal\n" +"Quick_Start=1\n" +"# Disable the scrolling sound effect\n" +"No_Scrolling_SFX=0\n" +"# Enhanced Stage Manager (sets a custom number of stages; \"stage_manager\" should be disabled in \"components.ini\")\n" +"# Number of stages (0 = disabled)\n" +"Enhanced_Stage_Manager=0\n" +"# Use encore stages or not\n" +"Enhanced_Stage_Manager_Encore=1\n" +"# Change the mouth animations -- 0=default, 1=force PDA, 2=force FT\n" +"Force_Mouth=0\n" +"# Change the expressions -- 0=default, 1=force PDA, 2=force FT\n" +"Force_Expressions=0\n" +"# Change the look animations -- 0=default, 1=force PDA, 2=force FT\n" +"Force_Look=0\n" +"# Disable hand scaling\n" +"No_Hand_Scaling=0\n" +"# Default hand size -- -1=default, 12200=PDA\n" +"Default_Hand_Size=-1\n" +"# Show \"FREE PLAY\" instead of \"CREDIT(S)\" and don't require credits\n" +"Freeplay=1\n" +"# Sing missed notes\n" +"Sing_Missed=0\n" +"# Hide the volume and SE control buttons\n" +"Hide_Volume=0\n" +"# Remove the photo controls during PV playback\n" +"No_PV_UI=0\n" +"# Hide the watermark that's usually shown in PV viewing mode\n" +"Hide_PV_Watermark=0\n" +"# Set the card reader and network status icons -- 0=default, 1=hidden, 2=error, 3=OK, 4=partial OK\n" +"Status_Icons=0\n" +"# Disable showing lyrics\n" +"No_Lyrics=0\n" +"# Disable the error banner\n" +"No_Error=1\n" +"# Hide \"CREDIT(S)\"/\"FREE PLAY\"\n" +"Hide_Freeplay=0\n" +"# Show \"PD Loader\" instead of \"FREE PLAY\"\n" +"PDLoaderText=1\n" +"# Freeze the timer\n" +"No_Timer=1\n" +"# Disable the timer sprite\n" +"No_Timer_Sprite=1\n" +"# Disable Message Bar\n" +"No_Message_Bar=0\n" +"# Disable Stage Text\n" +"No_Stage_Text=0\n" +"# Unlock PSEUDO modules (incomplete, will default to Miku)\n" +"Unlock_Pseudo=0\n" +"# Enable the card menu (incomplete, it doesn't bypass the card prompt)\n" +"Card=0\n" +"# Disable Extended Data (may break physics in some edits) AKA Skyth's no-opd patch\n" +"No_Opd=0\n" +"# Scale Debug Windows above HD internal resolution AKA somewhatlurker's dwgui patch\n" +"Dwgui_Scaling=0\n" +"# Allow using a real arcade slider attached to COM11 (or PS4 official FT controller)\n" +"Hardware_Slider=0\n" +"# Prevent data deletion\n" +"Prevent_Data_Deletion=0\n" +"\n" +"[Graphics]\n" +"# Lag Compensation\n" +"Lag_Compensation = 0\n" +"# Set to -1 to unlock the frame rate.\n" +"FPS.Limit=60\n" +"# Reduces FPS Limiter CPU usage\n" +"# (may have less consistent performance)\n" +"FPS.Limit.LightMode=1\n" +"# Enable debug warnings for lightweight limiter\n" +"FPS.Limit.Verbose=0\n" +"# Temporal Anti-Aliasing\n" +"TAA=1\n" +"# Morphological Anti-Aliasing\n" +"MLAA=1\n" +"# MAG Filter -- 0=default (bilinear), 1=nearest-neighbour, 2=sharpen, 3=cone (smooth)\n" +"MAG=0\n" +"# Depth of Field\n" +"DOF=1\n" +"# Reflections\n" +"Reflections=1\n" +"# Shadows\n" +"Shadows=1\n" +"# Transparent Meshes\n" +"Punchthrough=1\n" +"# Glare\n" +"Glare=1\n" +"# Shader\n" +"Shader=1\n" +"# Toon shader (press F9 to toggle) -- 0=default, 1=force on, 2=force off\n" +"NPR1=0\n" +"# Disable all 3D passes. WARNING: The extended data will be deleted unless Prevent Data Deletion is enabled. Don't enable on Intel GPUs, enable no_opd instead.\n" +"2D=0\n" +"# FrameRateManager motion rate (fps)\n" +"FRM.Motion.Rate=400\n" +"\n" +"[Resolution]\n" +"# 0 = Windowed, 1 = Fast, 2 = Exclusive, 3 = Safe\n" +"# For same as screen res: -1x-1\n" +"Display=1\n" +"Width=-1\n" +"Height=-1\n" +"# Fullscreen only options\n" +"BitDepth=32\n" +"RefreshRate=60\n" +"\n" +"# Set a custom internal render resolution\n" +"# Same as window: -1x-1\n" +"# HD : 1280x720\n" +"# FHD : 1920x1080\n" +"# WQHD : 2560x1440\n" +"# 4K UHD: 3840x2160\n" +"# 5K UHD: 5120x2880\n" +"# 8K UHD: 7680x4320\n" +"r.Enable=0\n" +"r.Width=-1\n" +"r.Height=-1\n" +"\n" +}; + +char components_template[] = +{ +"#########################################\n" +"# /!\ WARNING: DO NOT EDIT WITH NOTEPAD!#\n" +"#########################################\n" +"\n" +"# components.ini\n" +"# defines which components will be enabled\n" +"[components]\n" +"\n" +"# emulates game input through mouse and keyboard.\n" +"# controls can be set inside the keyconfig.ini file.\n" +"input_emulator = true\n" +"touch_slider_emulator = true\n" +"touch_panel_emulator = true\n" +"\n" +"# freezes the PV select timer at 39 seconds.\n" +"sys_timer = true\n" +"\n" +"# loads user defined const values from the playerdata.ini config\n" +"# and writes them to the game's PlayerData struct.\n" +"# required for modules selection\n" +"player_data_manager = true\n" +"\n" +"# adjusts 2D and 3D animations to retain their original speed at different frame rates.\n" +"frame_rate_manager = false\n" +"\n" +"# skip unnecessary DATA_INITIALIZE loading time, speed up SYSTEM_STARTUP and skip the startup WARNING message.\n" +"# further improvements can be achieved by shortening the duration of the pv_999 script file as it's test loaded during the SYSTEM_STARTUP.\n" +"fast_loader = true\n" +"\n" +"# allows for a user controllable camera which can be toggled using F3,\n" +"# can be controlled using W/A/S/D to move, SPACE/CTRL to ascend/descend, Q/E to rotate, R/F to zoom in/out\n" +"# and holding SHIFT/ALT to speed up or slow down these controls.\n" +"camera_controller = false\n" +"\n" +"# scales the framebuffer so that it will fit the current screen or window\n" +"# required to set resolutions in config.ini\n" +"scale_component = true\n" +"\n" +"# lets the user change the current game state using the F4 - F8 keys, enable the dw_gui / DATA_TESTs\n" +"# and speed up 2D animations / menu navigation by holding SHIFT + TAB.\n" +"# enabling this component is not recommended for most users.\n" +"debug_component = false\n" +"\n" +"# allows the usage of hold transfer\n" +"target_inspector = true\n" +"\n" +"# saves high scores to plugins/scores.ini\n" +"score_saver = true\n" +"\n" +"# adds a pause menu\n" +"pause = true\n" +}; + +char playerdata_template[] = +{ +"[playerdata]\n" +"#########################################\n" +"# /!\ WARNING: DO NOT EDIT WITH NOTEPAD!#\n" +"#########################################\n" +"\n" +"# playerdata.ini\n" +"# defines constant values to be loaded into the PlayerData struct\n" +"# this file has to be encoded using utf-8\n" +"player_name =NO-NAME\n" +"level_name =忘れないでね私の声を\n" +"level =1\n" +"vocaloid_point=0\n" +"\n" +"# IDs defined in rom/gm_plate_tbl.farc/gm_plate_id.bin\n" +"level_plate_id =0\n" +"level_plate_effect=1\n" +"# IDs same as gam_skin%3d\n" +"skin_equip =0\n" +"# Allows for song specific skin settings which can be set in the file skins.ini\n" +"use_pv_skin_equip =true\n" +"# IDs defined in rom/gm_btn_se_tbl.farc/gm_btn_se_id.bin\n" +"btn_se_equip =-1\n" +"# Allows for song specific sound effect settings which can be set in the file sfx.ini\n" +"use_pv_sfx_equip =true\n" +"# IDs defined in rom/gm_slide_se_tbl.farc/gm_slide_se_id.bin\n" +"slide_se_equip =-1\n" +"# IDs defined in rom/gm_chainslide_se_tbl.farc/gm_chainslide_se_id.bin\n" +"chainslide_se_equip =-1\n" +"slidertouch_se_equip=-1\n" +"# \"Shared Set\" or \"Original\" setting, works similarly to PSP series module selection (Updates when changed in-game)\n" +"module_equip_cmn0=0\n" +"module_equip_cmn1=0\n" +"module_equip_cmn2=0\n" +"module_equip_cmn3=0\n" +"module_equip_cmn4=0\n" +"module_equip_cmn5=0\n" +"# Allows Song Specific module selections (values update when changed in-game in the file modules.ini) (May lag on song select and menu)\n" +"use_pv_module_equip=true\n" +"# Enable button/slider sounds & volume settings\n" +"act_toggle =true\n" +"act_vol =100\n" +"act_slide_vol=100\n" +"# Show clear borders on Progress Bar for:\n" +"# Great\n" +"border_great =true\n" +"# Excellent\n" +"border_excellent =true\n" +"# Rival\n" +"border_rival=true\n" +"\n" +"# Allows module selection (WARNING: It may cause lag in the main menu and other places) (May be necessary for use_pv_equip settings!)\n" +"use_card =true\n" +"\n" +"# Allows module selection without card and attempts to disable module refresh when sliding in PV select to reduce CPU and IO load.\n" +"module_card_workaround =false\n" +"\n" +"# Allows use of game mode modifiers (hi-speed, hidden, and sudden)\n" +"gamemode_options =true\n" +"\n" +"\n" +"\n" +"mylist_A=\n" +"mylist_B=\n" +"mylist_C=\n" +}; + +char keyconfig_template[] = +{ +"#########################################\n" +"# /!\ WARNING: DO NOT EDIT WITH NOTEPAD!#\n" +"#########################################\n" +"[keyconfig]\n" +"# keyconfig.ini\n" +"# defines the input_emulator key bindings\n" +"# multiple keys are to be specified comma separated\n" +"\n" +"# Options:\n" +"\n" +"# Allow the user to mouse wheel scroll through the PV selection list\n" +"mouse_scroll_pv_selection = true\n" +"# The interval it takes for the emulated slider touch points to move from one contact point to another.\n" +"# In most cases, this does not need editing.\n" +"touch_slider_emulation_speed = 750.0\n" +"\n" +"# Preferred Xinput controller (0-3)\n" +"xinput_preferred =0\n" +"\n" +"# DirectInput Vendor ID and Product ID\n" +"# Check them in Device Manager or dxdiag.exe\n" +"VID = 046D\n" +"PID = C216\n" +"\n" +"# Rumble (Xinput)\n" +"rumble =true\n" +"\n" +"# Pause when focus is lost\n" +"autopause =true\n" +"\n" +"# Allow using slider in menus\n" +"# Recommended to enable this and remove MENU_L/R bindings if you have a real slider.\n" +"# Also needed to see slider in input test\n" +"slider_in_menus =false\n" +"\n" +"# Use the hardware slider from HORI FT official controller (PS4 version)\n" +"# Requires enabling hardware slider support.\n" +"# Warning: alpha feature, may not work properly\n" +"# Recommended to remove Ds4_L_Stick_* and Ds4_R_Stick_* from button bindings (JVS_LEFT, JVS_RIGHT, MENU_L, MENU_R).\n" +"ps4_official_slider =false\n" +"\n" +"# JVS Buttons:\n" +"JVS_TEST = F1\n" +"JVS_SERVICE = F2\n" +"JVS_SW1 = F11\n" +"JVS_SW2 = F12\n" +"\n" +"JVS_START = Enter, Ds4_Options, XINPUT_START, MouseMiddle\n" +"JVS_TRIANGLE = W, I, Ds4_Triangle, Ds4_DPad_Up, Ds4_L_Trigger, Ds4_R_Trigger, XINPUT_Y, XINPUT_UP, XINPUT_LT, XINPUT_RT\n" +"JVS_SQUARE = A, J, Ds4_Square, Ds4_DPad_Left, Ds4_L_Trigger, Ds4_R_Trigger, XINPUT_X, XINPUT_LEFT, XINPUT_LT, XINPUT_RT, MouseX2\n" +"JVS_CROSS = S, K, Ds4_Cross, Ds4_DPad_Down, Ds4_L_Trigger, Ds4_R_Trigger, XINPUT_A, XINPUT_DOWN, XINPUT_LT, XINPUT_RT, MouseX1\n" +"JVS_CIRCLE = D, L, Ds4_Circle, Ds4_DPad_Right, Ds4_L_Trigger, Ds4_R_Trigger, XINPUT_B, XINPUT_RIGHT, XINPUT_LT, XINPUT_RT\n" +"\n" +"JVS_LEFT = Left, Up, Ds4_L1, Ds4_L_Stick_Up, Ds4_R_Stick_Up, XINPUT_LS\n" +"JVS_RIGHT = Right, Down, Ds4_R1, Ds4_L_Stick_Down, Ds4_R_Stick_Down, XINPUT_RS\n" +"\n" +"MENU_L = Left, Up, Ds4_L1, XINPUT_LS, Ds4_DPad_Left, Ds4_DPad_Up, XINPUT_LEFT, XINPUT_UP, Q, U, Ds4_L_Stick_Left, XINPUT_LLEFT, Ds4_L_Stick_Up, XINPUT_LUP, Ds4_R_Stick_Left, XINPUT_RLEFT, Ds4_R_Stick_Up, XINPUT_RUP\n" +"MENU_R = Right, Down, Ds4_R1, XINPUT_RS, Ds4_DPad_Right, Ds4_DPad_Down, XINPUT_RIGHT, XINPUT_DOWN, E, O, Ds4_L_Stick_Right, XINPUT_LRIGHT, Ds4_L_Stick_Down, XINPUT_LDOWN, Ds4_R_Stick_Right, XINPUT_RRIGHT, Ds4_R_Stick_Down, XINPUT_RDOWN\n" +"MENU_CIRCLE = Spacebar\n" +"\n" +"COIN = F10\n" +"\n" +"WIREFRAME = F12\n" +"\n" +"# Touch Slider:\n" +"LEFT_SIDE_SLIDE_LEFT = Q, Ds4_L_Stick_Left, XINPUT_LLEFT\n" +"LEFT_SIDE_SLIDE_RIGHT = E, Ds4_L_Stick_Right, XINPUT_LRIGHT\n" +"\n" +"RIGHT_SIDE_SLIDE_LEFT = U, Ds4_R_Stick_Left, XINPUT_RLEFT\n" +"RIGHT_SIDE_SLIDE_RIGHT = O, Ds4_R_Stick_Right, XINPUT_RRIGHT\n" +"\n" +"# --- KEYBOARD KEY NAMES: ---\n" +"\n" +"# - Standard Keys\n" +"# uppercase \"A\" to \"Z\", \"0\" to \"9\"\n" +"\n" +"# - NumPad Keys\n" +"# \"NumPad0\" to \"NumPad9\"\n" +"# \"Plus\", \"Minus\", \"Divide\", \"Multiply\"\n" +"\n" +"# - Function Keys\n" +"# \"F1\" to \"F24\"\n" +"\n" +"# - Shift Keys\n" +"# \"LeftShift\", \"RightShift\"\n" +"\n" +"# - Control Keys\n" +"# \"LeftControl\", \"RightControl\"\n" +"\n" +"# - Arrow Keys\n" +"# \"Up\", \"Down\", \"Left\", \"Right\"\n" +"\n" +"# - Special Keys (may vary depending on the layout)\n" +"# \"Enter\", \"Tab\", \"Backspace\", \"Spacebar\", \"Insert\", \"Delete\", \"Home\", \"End\", \"PageUp\", \"PageDown\", \"Escape\"\n" +"# \"Comma\", \"Period\", \"Colon\", \"Slash\", \"Tilde\", \"LeftBracket\", \"Backslash\", \"RightBracket\", \"SingleDoubleQuote\", \"OEM_8\"\n" +"\n" +"# --- MOUSE BUTTON NAMES: ---\n" +"# \"MouseLeft\", \"MouseMiddle\", \"MouseRight\", \"MouseX1\", \"MouseX2\"\n" +"\n" +"# --- DUALSHOCK 4 BUTTON NAMES: ---\n" +"\n" +"# - Face Buttons\n" +"# \"Ds4_Square\", \"Ds4_Cross\", \"Ds4_Circle\", \"Ds4_Triangle\"\n" +"\n" +"# - Standard Buttons\n" +"# \"Ds4_Share\", \"Ds4_Options\", \"Ds4_PS\", \"Ds4_Touch\", \"Ds4_L1\", \"Ds4_R1\"\n" +"\n" +"# - D-Pad Directions\n" +"# \"Ds4_DPad_Up\", \"Ds4_DPad_Right\", \"Ds4_DPad_Down\", \"Ds4_DPad_Left\"\n" +"\n" +"# - Trigger Buttons\n" +"# \"Ds4_L_Trigger\", \"Ds4_R_Trigger\"\n" +"\n" +"# - Left Joystick\n" +"# \"Ds4_L_Stick_Up\", \"Ds4_L_Stick_Right\", \"Ds4_L_Stick_Down\", \"Ds4_L_Stick_Left\", \"Ds4_L3\"\n" +"\n" +"# - Right Joystick\n" +"# \"Ds4_R_Stick_Up\", \"Ds4_R_Stick_Right\", \"Ds4_R_Stick_Down\", \"Ds4_R_Stick_Left\", \"Ds4_R3\"\n" +"\n" +"# --- XINPUT BUTTON NAMES: ---\n" +"\n" +"# - Face Buttons\n" +"# \"XINPUT_A\", \"XINPUT_B\", \"XINPUT_X\", \"XINPUT_Y\"\n" +"\n" +"# - Standard Buttons\n" +"# \"XINPUT_START\", \"XINPUT_BACK\", \"XINPUT_LS\"/\"XINPUT_LB\", \"XINPUT_RS\"/\"XINPUT_RB\"\n" +"\n" +"# - D-Pad Directions\n" +"# \"XINPUT_UP\", \"XINPUT_DOWN\", \"XINPUT_LEFT\", \"XINPUT_RIGHT\"\n" +"\n" +"# - Trigger Buttons\n" +"# \"XINPUT_LT\", \"XINPUT_RT\"\n" +"\n" +"# - Left Joystick\n" +"# \"XINPUT_LLEFT\", \"XINPUT_LRIGHT\", \"XINPUT_LUP\", \"XINPUT_LDOWN\", \"XINPUT_LSB\"\n" +"\n" +"# - Right Joystick\n" +"# \"XINPUT_RLEFT\", \"XINPUT_RRIGHT\", \"XINPUT_RUP\", \"XINPUT_RDOWN\", \"XINPUT_RSB\"\n" +"\n" +"# --- Generic USB BUTTON NAMES: ---\n" +"\n" +"# - Standard Buttons (Button number in \"Game controller settings\", max allowed 13 buttons at the moment)\n" +"# \"GU_BUTTON1\", \"GU_BUTTON2\", \"GU_BUTTON3\", \"GU_BUTTON4\", \"GU_BUTTON5\", \"GU_BUTTON6\", \"GU_BUTTON7\", \"GU_BUTTON8\", \"GU_BUTTON9\", \"GU_BUTTON10\", \"GU_BUTTON11\", \"GU_BUTTON12\", \"GU_BUTTON13\"\n" +"\n" +"# - D-Pad Directions\n" +"# \"GU_DPAD_UP\", \"GU_DPAD_RIGHT\", \"GU_DPAD_DOWN\", \"GU_DPAD_LEFT\"\n" +"\n" +"# - Left Joystick\n" +"# \"GU_L_STICK_UP\", \"GU_L_STICK_RIGHT\", \"GU_L_STICK_DOWN\", \"GU_L_STICK_LEFT\"\n" +"\n" +"# - Right Joystick\n" +"# \"GU_R_STICK_UP\", \"GU_R_STICK_RIGHT\", \"GU_R_STICK_DOWN\", \"GU_R_STICK_LEFT\"\n" +}; + +char divasound_template[] = +{ +"#########################################\n" +"# /!\ WARNING: DO NOT EDIT WITH NOTEPAD!#\n" +"#########################################\n" +"\n" +"[General]\n" +"# You can choose 2 channel or 4 channel mode.\n" +"# 4 channels uses front channels for speakers and rear channels as headphones.\n" +"# 2 channels only has headphones output (with in-game volume bypassed).\n" +"Channels=2\n" +"\n" +"# 16 or 24 bit integer and 32 bit float output are supported.\n" +"# If you don't know what this means, you should leave it at 16.\n" +"# On some versions of Windows floating point samples may increase latency.\n" +"Bit_Depth=16\n" +"\n" +"# This can be WASAPI, DirectSound, WASAPI_Exclusive, or ASIO.\n" +"# Only use DirectSound if WASAPI doesn't work for some reason.\n" +"# WASAPI_Exclusive may not work with some hardware, but can have lower latency.\n" +"# ASIO requires special driver support.\n" +"# ASIO doesn't use the buffer settings. Use ASIO config instead.\n" +"# For full descriptions of the backends see https://github.com/somewhatlurker/DivaSound/wiki/Backends.\n" +"Backend=WASAPI\n" +"\n" +"# If the game crashes when loading, try setting this to 0.\n" +"Alternate_Init=1\n" +"\n" +"[Buffer]\n" +"# Sets the requested buffer size in milliseconds.\n" +"# Try increasing this if audio stutters or desyncs.\n" +"# WASAPI will usually provide a larger buffer than specified.\n" +"# You can check the actual buffer size by enabling debug_component.\n" +"Buffer_Size=10\n" +"\n" +"# Sets how many periods to use.\n" +"# Fewer periods = lower latency, but it may cause issues.\n" +"# You probably shouldn't set this below 2, and increasing it probably isn't necessary.\n" +"Periods=2\n" +"\n" +"[ASIO]\n" +"# Sets the device ID.\n" +"# 0=first device(...), -1=first available device\n" +"Device=-1\n" +"\n" +"# When set to 1 the ASIO driver config will open alongside the game.\n" +"# Use this to adjust output settings, then disable it.\n" +"Show_Config=0\n" +}; + +char shaderpatchconfig_template[] = +{ +"[Config]\n" +"# Patches to remove glitching with modern GPUs.\n" +"# Appropriate patches will automatically be selected based on your GPU.\n" +"Compat=1\n" +"\n" +"# Lyb's toon shader improvements (24 sept 2019)\n" +"# Toon_Improve: Adjusts toon shader lighting\n" +"Toon_Improve=0\n" +"# Specular Multiplier\n" +"Toon_Improve_Val1=0.9\n" +"# Specular Offset\n" +"Toon_Improve_Val2=-0.5\n" +"\n" +"# Lyb's toon shader improvements (24 sept 2019)\n" +"# Toon_Eyes_Improve: Adjusts toon shader eyes\n" +"Toon_Eyes_Improve=0\n" +"\n" +"# Lyb's toon shader improvements (24 sept 2019)\n" +"# Toon_Hair_Improve: Adjusts toon shader hair\n" +"Toon_Hair_Improve=0\n" +"# Diffuse Brightness\n" +"Toon_Hair_Improve_Val1=1.25\n" +"\n" +"# Lyb's toon shader improvements (24 sept 2019)\n" +"# Toon_Lines_Improve: Adjusts toon shader outlines\n" +"Toon_Lines_Improve=0\n" +"# ???\n" +"Toon_Lines_Improve_Val1=0.75\n" +"# Thickness Multiplier(?)\n" +"Toon_Lines_Improve_Val2=0.75\n" +"# Thickness Offset(?)\n" +"Toon_Lines_Improve_Val3=0.75\n" +"\n" +"# Debug patches:\n" +"# Nametags\n" +"# Adds comments with the shader file name to the shader text. Useful for debugging issues.\n" +"# You only need to enable one of these.\n" +"# `nametags2` is a bit faster, but the tags are placed at the end of the file and you may not like that.\n" +"Nametags1=0\n" +"Nametags2=0\n" +}; diff --git a/source-code/source/plugins/Launcher/ConfigOption.h b/source-code/source/plugins/Launcher/ConfigOption.h index 4abe2cd..0518631 100644 --- a/source-code/source/plugins/Launcher/ConfigOption.h +++ b/source-code/source/plugins/Launcher/ConfigOption.h @@ -167,7 +167,7 @@ public: OkBtn->Left = 4; OkBtn->Top = optspanel->Bottom + 4; OkBtn->AutoSize = true; - OkBtn->FlatStyle = System::Windows::Forms::FlatStyle::Flat; + //OkBtn->FlatStyle = System::Windows::Forms::FlatStyle::Flat; form->ClientSize = Drawing::Size(optspanel->Width, OkBtn->Bottom + 4); @@ -363,7 +363,7 @@ public: cb->Left = left + 2; cb->Top = top; cb->AutoSize = true; - cb->FlatStyle = System::Windows::Forms::FlatStyle::Flat; + //cb->FlatStyle = System::Windows::Forms::FlatStyle::Flat; // hack to ensure high contrast cb->BackColor = System::Drawing::Color::FromArgb(0, 127, 127, 127); @@ -429,7 +429,7 @@ public: label->Top = top + 3; label->Width = Col1Width; label->AutoSize = true; - label->FlatStyle = System::Windows::Forms::FlatStyle::Flat; + //label->FlatStyle = System::Windows::Forms::FlatStyle::Flat; numberbox->Minimum = _minVal; numberbox->Maximum = _maxVal; @@ -505,7 +505,7 @@ public: label->Top = top + 3; label->Width = Col1Width; label->AutoSize = true; - label->FlatStyle = System::Windows::Forms::FlatStyle::Flat; + //label->FlatStyle = System::Windows::Forms::FlatStyle::Flat; stringBuf = GetIniString(_iniSectionName, _iniVarName, _defaultVal, _iniFilePath, _useUtf8); @@ -594,7 +594,7 @@ public: label->Top = top + 3; label->Width = Col1Width; label->AutoSize = true; - label->FlatStyle = System::Windows::Forms::FlatStyle::Flat; + //label->FlatStyle = System::Windows::Forms::FlatStyle::Flat; for (LPCWSTR& choice : _valueStrings) { combobox->Items->Add(msclr::interop::marshal_as(choice)); @@ -604,7 +604,7 @@ public: combobox->Top = top; combobox->Width = Col2Width; combobox->AutoSize = true; - combobox->FlatStyle = System::Windows::Forms::FlatStyle::System; + //combobox->FlatStyle = System::Windows::Forms::FlatStyle::System; combobox->DropDownStyle = ComboBoxStyle::DropDownList; Form^ RootForm = panel->FindForm(); @@ -675,7 +675,7 @@ public: label->Top = top + 3; label->Width = Col1Width; label->AutoSize = true; - label->FlatStyle = System::Windows::Forms::FlatStyle::Flat; + //label->FlatStyle = System::Windows::Forms::FlatStyle::Flat; for (LPCWSTR& choice : _valueStrings) { combobox->Items->Add(msclr::interop::marshal_as(choice)); @@ -688,7 +688,7 @@ public: combobox->Top = top; combobox->Width = Col2Width; combobox->AutoSize = true; - combobox->FlatStyle = System::Windows::Forms::FlatStyle::System; + //combobox->FlatStyle = System::Windows::Forms::FlatStyle::System; if (_editable) combobox->DropDownStyle = ComboBoxStyle::DropDown; @@ -780,7 +780,7 @@ public: label->Top = top + 3; label->Width = Col1Width; label->AutoSize = true; - label->FlatStyle = System::Windows::Forms::FlatStyle::Flat; + //label->FlatStyle = System::Windows::Forms::FlatStyle::Flat; for (int& choice : _valueInts) { combobox->Items->Add(Convert::ToInt32(choice).ToString()); @@ -793,7 +793,7 @@ public: combobox->Top = top; combobox->Width = Col2Width; combobox->AutoSize = true; - combobox->FlatStyle = System::Windows::Forms::FlatStyle::System; + //combobox->FlatStyle = System::Windows::Forms::FlatStyle::System; if (_editable) combobox->DropDownStyle = ComboBoxStyle::DropDown; @@ -888,7 +888,7 @@ public: label->Top = top + 3; label->Width = Col1Width; label->AutoSize = true; - label->FlatStyle = System::Windows::Forms::FlatStyle::Flat; + //label->FlatStyle = System::Windows::Forms::FlatStyle::Flat; if (_opts & RESOPT_INCLUDE_MATCH_WINDOW) combobox->Items->Add(RESOPT_MATCH_WINDOW_TEXT); @@ -926,7 +926,7 @@ public: combobox->Top = top; combobox->Width = Col2Width; combobox->AutoSize = true; - combobox->FlatStyle = System::Windows::Forms::FlatStyle::System; + //combobox->FlatStyle = System::Windows::Forms::FlatStyle::System; if (_editable) combobox->DropDownStyle = ComboBoxStyle::DropDown; @@ -1013,7 +1013,7 @@ public: button->Left = left; button->Top = top; button->AutoSize = true; - button->FlatStyle = System::Windows::Forms::FlatStyle::Flat; + //button->FlatStyle = System::Windows::Forms::FlatStyle::Flat; Form^ RootForm = panel->FindForm(); float ScaleWidth = 1.0f; @@ -1066,7 +1066,7 @@ public: cb->Left = left + 2; cb->Top = top + 3; cb->AutoSize = true; - cb->FlatStyle = System::Windows::Forms::FlatStyle::Flat; + //cb->FlatStyle = System::Windows::Forms::FlatStyle::Flat; // hack to ensure high contrast cb->BackColor = System::Drawing::Color::FromArgb(0, 127, 127, 127); @@ -1075,7 +1075,7 @@ public: button->Left = left + ConfigBtnLeft; button->Top = top; button->AutoSize = true; - button->FlatStyle = System::Windows::Forms::FlatStyle::Flat; + //button->FlatStyle = System::Windows::Forms::FlatStyle::Flat; Form^ RootForm = panel->FindForm(); float ScaleWidth = 1.0f; diff --git a/source-code/source/plugins/Launcher/Launcher.vcxproj b/source-code/source/plugins/Launcher/Launcher.vcxproj index 52d3239..b38168f 100644 --- a/source-code/source/plugins/Launcher/Launcher.vcxproj +++ b/source-code/source/plugins/Launcher/Launcher.vcxproj @@ -114,6 +114,7 @@ + diff --git a/source-code/source/plugins/Launcher/composition.h b/source-code/source/plugins/Launcher/composition.h index 525d6e6..5172933 100644 --- a/source-code/source/plugins/Launcher/composition.h +++ b/source-code/source/plugins/Launcher/composition.h @@ -43,10 +43,15 @@ bool setBlur(HWND hWnd, AccentState accentState) if (queryBuild) { int BuildNum = _wtoi(DataPtr); + free(DataPtr); //MessageBox::Show(BuildNum.ToString()); if (BuildNum < 19042) return 0; } - else return 0; + else + { + free(DataPtr); + return 0; + } } else return 0; diff --git a/source-code/source/plugins/Launcher/framework.h b/source-code/source/plugins/Launcher/framework.h index 5f1ca80..683b1bc 100644 --- a/source-code/source/plugins/Launcher/framework.h +++ b/source-code/source/plugins/Launcher/framework.h @@ -54,6 +54,7 @@ LPCWSTR PLAYERDATA_FILE = PLAYERDATA_FILE_STRING.c_str(); wstring KEYCONFIG_FILE_STRING = PLUGINS_DIR + L"\\keyconfig.ini"; LPCWSTR KEYCONFIG_FILE = KEYCONFIG_FILE_STRING.c_str(); +LPCWSTR GLOBAL_SECTION = L"global"; LPCWSTR PATCHES_SECTION = L"patches"; LPCWSTR GRAPHICS_SECTION = L"graphics"; LPCWSTR RESOLUTION_SECTION = L"resolution"; @@ -65,6 +66,24 @@ LPCWSTR KEYCONFIG_SECTION = L"keyconfig"; int nSkipLauncher = GetPrivateProfileIntW(LAUNCHER_SECTION, L"skip", FALSE, CONFIG_FILE); int nNoGPUDialog = GetPrivateProfileIntW(LAUNCHER_SECTION, L"no_gpu_dialog", FALSE, CONFIG_FILE); +void SetBackCol(Control^ elem, System::Drawing::Color color, System::Windows::Forms::FlatStyle cbxStyle) +{ + Type^ elemType = elem->GetType(); + + if (elem->HasChildren) + { + for (int i = 0; i < elem->Controls->Count; i++) + { + SetBackCol(elem->Controls[i], color, cbxStyle); + } + } + else if (elemType == ComboBox::typeid) + { + ((ComboBox^)elem)->FlatStyle = cbxStyle; + elem->BackColor = System::Drawing::Color::White; + } + else if (elemType == CheckBox::typeid || elemType == Button::typeid) elem->BackColor = color; +} resolution getCurrentScreenResolution() { return resolution(GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN)); @@ -140,7 +159,7 @@ static std::vector getScreenRatesVec(std::vector &screenModes) { std::vector screenModes = getScreenModes(); -DropdownOption* DisplayModeDropdown = new DropdownOption(L"display", RESOLUTION_SECTION, CONFIG_FILE, L"Display:", L"Sets the window/screen mode.", 1, std::vector({ L"Windowed", L"Fast", L"Exclusive", L"Safe" })); +DropdownOption* DisplayModeDropdown = new DropdownOption(L"display", RESOLUTION_SECTION, CONFIG_FILE, L"Display:", L"Sets the window/screen mode.\n\n\nFast: Popup borderless window (can cause issues with screenshots if Windows 10/11 fullscreen optimizations are enabled).\n\nExclusive: Takes control of the screen and allows you to change the resolution and refresh rate. Makes switching between applications harder.\n\nSafe: Simple borderless window. A little bit laggier than Fast, but with less issues.", 1, std::vector({ L"Windowed", L"Fast", L"Exclusive", L"Safe" })); ResolutionOption* DisplayResolutionOption = new ResolutionOption(L"width", L"height", RESOLUTION_SECTION, CONFIG_FILE, L"Resolution:", L"Sets the display resolution.", resolution(-1, -1), getScreenResolutionsVec(screenModes), true, RESOPT_INCLUDE_MATCH_SCREEN); ConfigOptionBase* screenResolutionArray[] = { @@ -172,13 +191,17 @@ ConfigOptionBase* graphicsArray[] = { new BooleanOption(L"glare", GRAPHICS_SECTION, CONFIG_FILE, L"Glare", L"Enable or disable glare.", true, false), new BooleanOption(L"shader", GRAPHICS_SECTION, CONFIG_FILE, L"Shader", L"Enable or disable high-quality shaders.", true, false), new DropdownOption(L"NPR1", GRAPHICS_SECTION, CONFIG_FILE, L"Toon (F9):", L"NPR1 shader\n\nPress F9 to toggle.", 0, std::vector({ L"Default", L"Force on", L"Force off" })), - new BooleanOption(L"2D", GRAPHICS_SECTION, CONFIG_FILE, L"Disable 3D rendering", L"Disable all 3D passes.\n\nWARNING: The extended data will be deleted unless Prevent Data Deletion is enabled.", false, false), - + new BooleanOption(L"2D", GRAPHICS_SECTION, CONFIG_FILE, L"Disable 3D rendering", L"Disable all 3D passes.\n\nWARNING: The extended data will be deleted unless Prevent Data Deletion is enabled. Don't enable on Intel GPUs, enable \"Disable Extended Data\" instead.", false, false), }; ConfigOptionBase* optionsArray[] = { + new BooleanOption(L"builtin_patches", GLOBAL_SECTION, CONFIG_FILE, L"Enable Built-In Patches", L"Enables the built-in patches, including the options below.", true, false), + new BooleanOption(L"custom_patches", GLOBAL_SECTION, CONFIG_FILE, L"Enable Custom Patches", L"Enables all custom patches.", true, false), + new BooleanOption(L"builtin_render", GLOBAL_SECTION, CONFIG_FILE, L"Enable Built-In Render", L"Enables the built-in render patches.", true, false), + new OptionMetaSeparator(), + new OptionMetaSpacer(8), + new BooleanOption(L"no_movies", PATCHES_SECTION, CONFIG_FILE, L"Disable Movies", L"Disable movies (enable this if the game hangs when loading certain PVs).", false, false), - new BooleanOption(L"mp4_movies", PATCHES_SECTION, CONFIG_FILE, L"Custom MP4 Adv Movies", L"Enable MP4 (instead of WMV) advertise/attract movies.", false, false), new BooleanOption(L"cursor", PATCHES_SECTION, CONFIG_FILE, L"Cursor", L"Enable or disable the mouse cursor.", true, false), new BooleanOption(L"stereo", PATCHES_SECTION, CONFIG_FILE, L"Stereo", L"Use 2 channels instead of 4 (when not using DivaSound).", true, false), new OptionMetaSeparator(), @@ -210,15 +233,19 @@ ConfigOptionBase* optionsArray[] = { new BooleanOption(L"no_lyrics", PATCHES_SECTION, CONFIG_FILE, L"Disable Lyrics", L"Disable showing lyrics.", false, false), new BooleanOption(L"no_error", PATCHES_SECTION, CONFIG_FILE, L"Disable Error Banner", L"Disable the error banner on the attract screen.", true, false), new BooleanOption(L"hide_freeplay", PATCHES_SECTION, CONFIG_FILE, L"Hide \"FREE PLAY\"/\"CREDIT(S)\"", L"Hide the \"FREE PLAY\"/\"CREDIT(S)\" text.", false, false), - new BooleanOption(L"freeplay", PATCHES_SECTION, CONFIG_FILE, L"FREE PLAY", L"Show \"FREE PLAY\" instead of \"CREDIT(S)\" and don't require credits.", true, false), new BooleanOption(L"pdloadertext", PATCHES_SECTION, CONFIG_FILE, L"PD Loader FREE PLAY", L"Show \"PD Loader\" instead of \"FREE PLAY\".", true, false), new BooleanOption(L"no_timer", PATCHES_SECTION, CONFIG_FILE, L"Freeze Timer", L"Disable the timer.", true, false), new BooleanOption(L"no_timer_sprite", PATCHES_SECTION, CONFIG_FILE, L"Disable Timer Sprite", L"Disable the timer sprite.", true, false), + new BooleanOption(L"no_message_bar", PATCHES_SECTION, CONFIG_FILE, L"Hide Message Bar", L"Hide the top message bar.", false, false), + new BooleanOption(L"no_stage_text", PATCHES_SECTION, CONFIG_FILE, L"Disable Stage Text", L"Disable Stage 1/2/Final.", false, false), new OptionMetaSeparator(), new OptionMetaSpacer(8), - new BooleanOption(L"unlock_pseudo", PATCHES_SECTION, CONFIG_FILE, L"Unlock PSEUDO modules (incomplete)", L"Lets you play any PV with any performer.\n(incomplete, recommended modules will default to Miku)", false, false), - new BooleanOption(L"card", PATCHES_SECTION, CONFIG_FILE, L"Unlock card menu (incomplete)", L"Enables the card menu.\n(incomplete, it doesn't bypass the card prompt)", false, false), + new BooleanOption(L"unlock_pseudo", PATCHES_SECTION, CONFIG_FILE, L"Unlock \"PSEUDO\" Modules (incomplete)", L"Lets you play any PV with any performer.\n(incomplete, recommended modules will default to Miku)", false, false), + new BooleanOption(L"card", PATCHES_SECTION, CONFIG_FILE, L"Unlock Card Menu (incomplete)", L"Enables the card menu.\n(incomplete, it doesn't bypass the card prompt)", false, false), + new BooleanOption(L"no_opd", PATCHES_SECTION, CONFIG_FILE, L"Disable Extended Data", L"AKA Skyth's \"No Osage Play Data\" patch.\n\nDisables baked physics in edits to save space.\nMay break physics in some edits.", false, false), + new BooleanOption(L"dwgui_scaling", PATCHES_SECTION, CONFIG_FILE, L"Scale Debug Windows", L"AKA somewhatlurker's dwgui patch.\n\nMakes debug windows bigger above HD internal resolution.", false, false), + new BooleanOption(L"freeplay", PATCHES_SECTION, CONFIG_FILE, L"FREE PLAY", L"Show \"FREE PLAY\" instead of \"CREDIT(S)\" and don't require credits.", true, false), new OptionMetaSeparator(), new OptionMetaSpacer(8), @@ -246,7 +273,6 @@ ConfigOptionBase* optionsArray[] = { new OptionMetaSeparator(), new OptionMetaSpacer(8), - new BooleanOption(L"custom_patches", PATCHES_SECTION, CONFIG_FILE, L"Enable Custom Patches", L"Enables all custom patches.", true, false), //new BooleanOption(L"ignore_exe_checksum", PATCHES_SECTION, CONFIG_FILE, L"Ignore exe checksum", L"Use at your own risk.", false, false), new BooleanOption(L"prevent_data_deletion", PATCHES_SECTION, CONFIG_FILE, L"Prevent Data Deletion", L"Prevents the game from deleting files.", false, false), new StringOption(L"command_line", LAUNCHER_SECTION, CONFIG_FILE, L"Command Line:", L"Allows setting command line parameters for the game when using the launcher.\nDisabling the launcher will bypass this.", L"", false), @@ -255,7 +281,7 @@ ConfigOptionBase* optionsArray[] = { new OptionMetaSpacer(8), new BooleanOption(L"dark_launcher", LAUNCHER_SECTION, CONFIG_FILE, L"Dark Launcher", L"Sets the dark colour scheme in the launcher.", false, false), - new BooleanOption(L"acrylic_blur", LAUNCHER_SECTION, CONFIG_FILE, L"Acrylic Blur", L"Enables acrylic blur in the launcher on Windows 10 20H2 or later.", false, false), + //new BooleanOption(L"acrylic_blur", LAUNCHER_SECTION, CONFIG_FILE, L"Acrylic Blur", L"Enables acrylic blur in the launcher on Windows 10 20H2 or later.", false, false), new BooleanOption(L"no_gpu_dialog", LAUNCHER_SECTION, CONFIG_FILE, L"Disable GPU Warning", L"Disables the warning dialog for unsupported GPUs.", false, false), }; @@ -378,7 +404,6 @@ void PrependFile(LPCSTR newStr, LPCWSTR fileName) fileStream.close(); } - struct PluginInfo { HMODULE handle; std::wstring filename; @@ -459,7 +484,7 @@ std::vector GetPluginOptions(std::vector* plugins) for (PluginInfo &pi : *plugins) { - PluginOption* opt = new PluginOption(pi.filename.c_str(), L"plugins", CONFIG_FILE, pi.name.c_str(), pi.description.c_str(), true, pi.configopts); + PluginOption* opt = new PluginOption(pi.filename.c_str(), L"plugins", CONFIG_FILE, pi.name.c_str(), pi.description.c_str(), false, pi.configopts); outvec.push_back(opt); } @@ -513,7 +538,7 @@ std::vector GetCustomOptions(std::vector* patches) for (PluginInfo& pi : *patches) { - PluginOption* opt = new PluginOption(pi.filename.c_str(), L"plugins", CONFIG_FILE, pi.name.c_str(), pi.description.c_str(), true, pi.configopts); + PluginOption* opt = new PluginOption(pi.filename.c_str(), L"plugins", CONFIG_FILE, pi.name.c_str(), pi.description.c_str(), false, pi.configopts); outvec.push_back(opt); } diff --git a/source-code/source/plugins/Launcher/registry.h b/source-code/source/plugins/Launcher/registry.h new file mode 100644 index 0000000..346073e --- /dev/null +++ b/source-code/source/plugins/Launcher/registry.h @@ -0,0 +1,61 @@ +#pragma once +#include +#include + +void setFullscreenOptimizations(bool enable) +{ + HKEY Layers; + + LONG result = RegOpenKeyExW(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\Layers", 0, KEY_ALL_ACCESS, &Layers); + + if (!result == ERROR_SUCCESS) return; + + WCHAR value[MAX_PATH]; + GetModuleFileNameW(NULL, value, MAX_PATH); + + if (!enable) + { + const LPCTSTR data = L"~ DISABLEDXMAXIMIZEDWINDOWEDMODE\0\0"; + result = RegSetValueExW(Layers, value, 0, REG_SZ, (LPBYTE)data, 2*(wcslen(data) + 1)); + } + else result = RegDeleteValueW(Layers, value); + + if (!result == ERROR_SUCCESS) return; + + result = RegCloseKey(Layers); + + if (!result == ERROR_SUCCESS) return; +} + +bool getFullscreenOptimizations() +{ + HKEY Layers; + + LONG result = RegOpenKeyExW(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\Layers", 0, KEY_ALL_ACCESS, &Layers); + + if (!result == ERROR_SUCCESS) return 0; + + WCHAR value[MAX_PATH]; + GetModuleFileNameW(NULL, value, MAX_PATH); + + //const LPCTSTR data = L"~ DISABLEDXMAXIMIZEDWINDOWEDMODE"; + DWORD DataSize = 2048; + WCHAR* DataPtr = (WCHAR*)malloc(DataSize); + memset(DataPtr, 0, DataSize); + result = RegQueryValueExW(Layers, value, NULL, NULL, (LPBYTE)DataPtr, &DataSize); + + if (!result == ERROR_SUCCESS) return 1; + + result = RegCloseKey(Layers); + + if (!result == ERROR_SUCCESS) return 1; + + std::wstring regstr(DataPtr); + bool val = regstr.find(L"DISABLEDXMAXIMIZEDWINDOWEDMODE") == -1; + + + //bool val = wcscmp(data, DataPtr); + + free(DataPtr); + return val; +} diff --git a/source-code/source/plugins/Launcher/ui.h b/source-code/source/plugins/Launcher/ui.h index eef6567..7298250 100644 --- a/source-code/source/plugins/Launcher/ui.h +++ b/source-code/source/plugins/Launcher/ui.h @@ -10,6 +10,8 @@ #include "GPUModel.h" #include "WineVer.h" #include "composition.h" +#include "registry.h" +#include namespace Launcher { @@ -26,6 +28,7 @@ namespace Launcher { /// /// Summary for ui /// + public ref class ui : public System::Windows::Forms::Form { public: @@ -71,6 +74,8 @@ namespace Launcher { DisplayTypeChangedHandler(this, gcnew EventArgs); // run handler now this->panel_ScreenRes->ResumeLayout(false); this->panel_ScreenRes->PerformLayout(); + this->checkBox_nofsopt->Checked = !getFullscreenOptimizations(); + this->checkBox_nofsopt->CheckedChanged += gcnew System::EventHandler(this, &ui::checkBox_nofsopt_CheckedChanged); this->panel_IntRes->SuspendLayout(); @@ -108,12 +113,31 @@ namespace Launcher { // populate options (patches) from array in framework // (easier than manually setting everything up) - int optionsY = 3; + int optionsY = 33; for (ConfigOptionBase* option : optionsArray) { option->hasChanged = OptionsConfigChanged; optionsY += option->AddToPanel(panel_Patches, 12, optionsY, toolTip1); } + + Button^ keycfg_button = gcnew Button(); + keycfg_button->Left = 12; + keycfg_button->Top = 3; + keycfg_button->Width = 200; + Form^ RootForm = panel_Patches->FindForm(); + float ScaleWidth = 1.0f; + float ScaleHeight = 1.0f; + if (RootForm) + { + Drawing::SizeF CurrentScaleSize = RootForm->CurrentAutoScaleDimensions; + ScaleWidth = CurrentScaleSize.Width / BaseScaleSize; + ScaleHeight = CurrentScaleSize.Height / BaseScaleSize; + } + keycfg_button->Scale(ScaleWidth, ScaleHeight); + keycfg_button->Text = gcnew String("Keyboard/Controller Configuration"); + keycfg_button->Click += gcnew EventHandler(this, &ui::keycfg_button_Click); + panel_Patches->Controls->Add(keycfg_button); + this->panel_Patches->ResumeLayout(false); this->panel_Patches->PerformLayout(); @@ -189,6 +213,8 @@ namespace Launcher { updateStyle(); + scanModpacks(); + glutInit(&argc, argv); int window = glutCreateWindow("glut"); // a context must be created to use glGetString @@ -208,7 +234,7 @@ namespace Launcher { if (wineVersion != "") { - this->labelGPU->Text = "Wine " + wineVersion + " (at least 4.12.1 is required)\n"; + this->labelGPU->Text = "Wine " + wineVersion + " (remember to disable movies!)\n"; } else this->labelGPU->Text = "GPU Info:\n"; this->labelGPU->Text += vendor + " " + renderer + "\n"; @@ -352,26 +378,29 @@ namespace Launcher { int nDarkLauncher = GetPrivateProfileIntW(LAUNCHER_SECTION, L"dark_launcher", FALSE, CONFIG_FILE); int nAcrylicLauncher = GetPrivateProfileIntW(LAUNCHER_SECTION, L"acrylic_blur", FALSE, CONFIG_FILE); - bool useAcrylic = nAcrylicLauncher && setBlur(hWnd, AccentState::ACCENT_ENABLE_ACRYLICBLURBEHIND); + //bool useAcrylic = nAcrylicLauncher && setBlur(hWnd, AccentState::ACCENT_ENABLE_ACRYLICBLURBEHIND); Color colourBg, colourBg2, colourFg; + System::Windows::Forms::FlatStyle cbxStyle; if (nDarkLauncher) { setDarkTheme(hWnd); colourFg = Color::White; - colourBg = Color::FromArgb(32, 32, 32); // tabControl - colourBg2 = Color::FromArgb(25, 25, 25); + colourBg = Color::FromArgb(255, 32, 32, 32); // tabControl + colourBg2 = Color::FromArgb(255, 25, 25, 25); + cbxStyle = System::Windows::Forms::FlatStyle::Flat; } else { setDarkTheme(hWnd, false); - colourFg = Color::FromArgb(64, 64, 64); + colourFg = Color::FromArgb(255, 64, 64, 64); colourBg = Color::White; // tabControl - colourBg2 = Color::FromArgb(242, 242, 242); + colourBg2 = Color::FromArgb(255, 242, 242, 242); + cbxStyle = System::Windows::Forms::FlatStyle::System; } - if (useAcrylic) + /*if (useAcrylic) { this->button_Discord->BackColor = colourBg2; this->button_github->BackColor = colourBg2; @@ -381,12 +410,12 @@ namespace Launcher { } else { - setBlur(hWnd, AccentState::ACCENT_DISABLED); + setBlur(hWnd, AccentState::ACCENT_DISABLED);*/ this->button_Discord->BackColor = Color::Transparent; this->button_github->BackColor = Color::Transparent; this->button_Wiki->BackColor = Color::Transparent; - } + //} this->tabPage_Resolution->BackColor = colourBg; this->tabPage_Resolution->ForeColor = colourFg; @@ -417,6 +446,26 @@ namespace Launcher { this->groupBox_InternalRes->ForeColor = colourFg; this->groupBox_Lag->ForeColor = colourFg; this->groupBox_ScreenRes->ForeColor = colourFg; + + /*for (int i = 0; i < this->panel_ScreenRes->Controls->Count; i++) this->panel_ScreenRes->Controls[i]->BackColor = colourBg; + for (int i = 0; i < this->panel_IntRes->Controls->Count; i++) this->panel_IntRes->Controls[i]->BackColor = colourBg; + for (int i = 0; i < this->panel_Details->Controls->Count; i++) this->panel_Details->Controls[i]->BackColor = colourBg; + for (int i = 0; i < this->panel_Patches->Controls->Count; i++) this->panel_Patches->Controls[i]->BackColor = colourBg; + for (int i = 0; i < this->panel_Custom->Controls->Count; i++) this->panel_Custom->Controls[i]->BackColor = colourBg; + for (int i = 0; i < this->panel_Playerdata->Controls->Count; i++) this->panel_Playerdata->Controls[i]->BackColor = colourBg; + for (int i = 0; i < this->panel_Components->Controls->Count; i++) this->panel_Components->Controls[i]->BackColor = colourBg; + for (int i = 0; i < this->panel_Plugins->Controls->Count; i++) this->panel_Plugins->Controls[i]->BackColor = colourBg;*/ + + SetBackCol(this->panel_ScreenRes, colourBg, cbxStyle); + SetBackCol(this->panel_IntRes, colourBg, cbxStyle); + SetBackCol(this->panel_Details, colourBg, cbxStyle); + SetBackCol(this->panel_Patches, colourBg, cbxStyle); + SetBackCol(this->panel_Custom, colourBg, cbxStyle); + SetBackCol(this->panel_Playerdata, colourBg, cbxStyle); + SetBackCol(this->panel_Components, colourBg, cbxStyle); + SetBackCol(this->panel_Plugins, colourBg, cbxStyle); + + tabPage_Modpacks->Enabled = false; } private: @@ -454,6 +503,36 @@ private: System::Windows::Forms::Button^ button_Apply; private: System::Windows::Forms::GroupBox^ groupBox_Lag; private: System::Windows::Forms::TrackBar^ trackBar_LagCompensation; private: System::Windows::Forms::Button^ button_Wiki; +private: System::Windows::Forms::TabPage^ tabPage_Update; +private: System::Windows::Forms::Label^ label_Update_2; + +private: System::Windows::Forms::Label^ label_Update_1; +private: System::Windows::Forms::Button^ button_Clean_installation; + +private: System::Windows::Forms::Button^ button_Instructions; + +private: System::Windows::Forms::Button^ button_Unstable_builds; + +private: System::Windows::Forms::Button^ button_Releases_page; +private: System::Windows::Forms::LinkLabel^ linkLabel_Changelog; +private: System::Windows::Forms::LinkLabel^ linkLabel_Official_Discord; +private: System::Windows::Forms::LinkLabel^ linkLabel_Help; +private: System::Windows::Forms::LinkLabel^ linkLabel_Repo; +private: System::Windows::Forms::CheckBox^ checkBox_nofsopt; +private: System::Windows::Forms::TabPage^ tabPage_Modpacks; +private: System::Windows::Forms::CheckBox^ checkBox_ModPatches; +private: System::Windows::Forms::Button^ button_ModDelete; + +private: System::Windows::Forms::Button^ button_ModClone; + +private: System::Windows::Forms::Button^ button_ModSetActive; +private: System::Windows::Forms::ListBox^ listBox_Mods; + +private: System::Windows::Forms::Button^ button_ModFiles; +private: System::Windows::Forms::Button^ button_ModRescan; +private: System::Windows::Forms::Button^ button_ModRename; +private: System::Windows::Forms::LinkLabel^ linkLabel_Console; + @@ -494,6 +573,7 @@ private: System::Windows::Forms::Button^ button_Wiki; this->button_Launch = (gcnew System::Windows::Forms::Button()); this->groupBox_ScreenRes = (gcnew System::Windows::Forms::GroupBox()); this->panel_ScreenRes = (gcnew System::Windows::Forms::Panel()); + this->checkBox_nofsopt = (gcnew System::Windows::Forms::CheckBox()); this->tabControl = (gcnew System::Windows::Forms::TabControl()); this->tabPage_Resolution = (gcnew System::Windows::Forms::TabPage()); this->groupBox_Lag = (gcnew System::Windows::Forms::GroupBox()); @@ -508,18 +588,40 @@ private: System::Windows::Forms::Button^ button_Wiki; this->tabPage_Playerdata = (gcnew System::Windows::Forms::TabPage()); this->panel_Playerdata = (gcnew System::Windows::Forms::Panel()); this->tabPage_Components = (gcnew System::Windows::Forms::TabPage()); + this->linkLabel_Console = (gcnew System::Windows::Forms::LinkLabel()); this->panel_Components = (gcnew System::Windows::Forms::Panel()); this->tabPage_Plugins = (gcnew System::Windows::Forms::TabPage()); this->panel_Custom = (gcnew System::Windows::Forms::Panel()); this->panel_Plugins = (gcnew System::Windows::Forms::Panel()); + this->tabPage_Modpacks = (gcnew System::Windows::Forms::TabPage()); + this->button_ModRename = (gcnew System::Windows::Forms::Button()); + this->button_ModRescan = (gcnew System::Windows::Forms::Button()); + this->button_ModFiles = (gcnew System::Windows::Forms::Button()); + this->checkBox_ModPatches = (gcnew System::Windows::Forms::CheckBox()); + this->button_ModDelete = (gcnew System::Windows::Forms::Button()); + this->button_ModClone = (gcnew System::Windows::Forms::Button()); + this->button_ModSetActive = (gcnew System::Windows::Forms::Button()); + this->listBox_Mods = (gcnew System::Windows::Forms::ListBox()); this->tabPage_Credits = (gcnew System::Windows::Forms::TabPage()); this->creditsTextBox = (gcnew System::Windows::Forms::TextBox()); + this->tabPage_Update = (gcnew System::Windows::Forms::TabPage()); + this->linkLabel_Repo = (gcnew System::Windows::Forms::LinkLabel()); + this->linkLabel_Help = (gcnew System::Windows::Forms::LinkLabel()); + this->linkLabel_Official_Discord = (gcnew System::Windows::Forms::LinkLabel()); + this->linkLabel_Changelog = (gcnew System::Windows::Forms::LinkLabel()); + this->button_Clean_installation = (gcnew System::Windows::Forms::Button()); + this->button_Instructions = (gcnew System::Windows::Forms::Button()); + this->button_Unstable_builds = (gcnew System::Windows::Forms::Button()); + this->button_Releases_page = (gcnew System::Windows::Forms::Button()); + this->label_Update_2 = (gcnew System::Windows::Forms::Label()); + this->label_Update_1 = (gcnew System::Windows::Forms::Label()); this->button_Discord = (gcnew System::Windows::Forms::Button()); this->button_github = (gcnew System::Windows::Forms::Button()); this->toolTip1 = (gcnew System::Windows::Forms::ToolTip(this->components)); this->button_Apply = (gcnew System::Windows::Forms::Button()); this->button_Wiki = (gcnew System::Windows::Forms::Button()); this->groupBox_ScreenRes->SuspendLayout(); + this->panel_ScreenRes->SuspendLayout(); this->tabControl->SuspendLayout(); this->tabPage_Resolution->SuspendLayout(); this->groupBox_Lag->SuspendLayout(); @@ -530,7 +632,9 @@ private: System::Windows::Forms::Button^ button_Wiki; this->tabPage_Playerdata->SuspendLayout(); this->tabPage_Components->SuspendLayout(); this->tabPage_Plugins->SuspendLayout(); + this->tabPage_Modpacks->SuspendLayout(); this->tabPage_Credits->SuspendLayout(); + this->tabPage_Update->SuspendLayout(); this->SuspendLayout(); // // button_Launch @@ -538,10 +642,9 @@ private: System::Windows::Forms::Button^ button_Wiki; this->button_Launch->BackColor = System::Drawing::Color::White; this->button_Launch->FlatAppearance->BorderColor = System::Drawing::SystemColors::Control; this->button_Launch->FlatStyle = System::Windows::Forms::FlatStyle::Flat; - this->button_Launch->Location = System::Drawing::Point(258, 584); - this->button_Launch->Margin = System::Windows::Forms::Padding(4, 4, 4, 4); + this->button_Launch->Location = System::Drawing::Point(172, 409); this->button_Launch->Name = L"button_Launch"; - this->button_Launch->Size = System::Drawing::Size(326, 34); + this->button_Launch->Size = System::Drawing::Size(217, 23); this->button_Launch->TabIndex = 20; this->button_Launch->Text = L"Launch"; this->button_Launch->UseVisualStyleBackColor = false; @@ -551,11 +654,9 @@ private: System::Windows::Forms::Button^ button_Wiki; // this->groupBox_ScreenRes->Controls->Add(this->panel_ScreenRes); this->groupBox_ScreenRes->FlatStyle = System::Windows::Forms::FlatStyle::Flat; - this->groupBox_ScreenRes->Location = System::Drawing::Point(8, 9); - this->groupBox_ScreenRes->Margin = System::Windows::Forms::Padding(4, 4, 4, 4); + this->groupBox_ScreenRes->Location = System::Drawing::Point(5, 6); this->groupBox_ScreenRes->Name = L"groupBox_ScreenRes"; - this->groupBox_ScreenRes->Padding = System::Windows::Forms::Padding(4, 4, 4, 4); - this->groupBox_ScreenRes->Size = System::Drawing::Size(394, 170); + this->groupBox_ScreenRes->Size = System::Drawing::Size(263, 120); this->groupBox_ScreenRes->TabIndex = 10; this->groupBox_ScreenRes->TabStop = false; this->groupBox_ScreenRes->Text = L"Screen Resolution"; @@ -563,12 +664,25 @@ private: System::Windows::Forms::Button^ button_Wiki; // panel_ScreenRes // this->panel_ScreenRes->AutoScroll = true; - this->panel_ScreenRes->Location = System::Drawing::Point(8, 28); - this->panel_ScreenRes->Margin = System::Windows::Forms::Padding(4, 4, 4, 4); + this->panel_ScreenRes->Controls->Add(this->checkBox_nofsopt); + this->panel_ScreenRes->Location = System::Drawing::Point(5, 19); this->panel_ScreenRes->Name = L"panel_ScreenRes"; - this->panel_ScreenRes->Size = System::Drawing::Size(380, 134); + this->panel_ScreenRes->Size = System::Drawing::Size(253, 99); this->panel_ScreenRes->TabIndex = 0; // + // checkBox_nofsopt + // + this->checkBox_nofsopt->AutoSize = true; + this->checkBox_nofsopt->Location = System::Drawing::Point(14, 77); + this->checkBox_nofsopt->Margin = System::Windows::Forms::Padding(2); + this->checkBox_nofsopt->Name = L"checkBox_nofsopt"; + this->checkBox_nofsopt->Size = System::Drawing::Size(177, 17); + this->checkBox_nofsopt->TabIndex = 0; + this->checkBox_nofsopt->Text = L"Disable Fullscreen Optimizations"; + this->toolTip1->SetToolTip(this->checkBox_nofsopt, L"Disables Windows 10/11 fullscreen optimizations, which can cause issues with scre" + L"enshots and/or framerate."); + this->checkBox_nofsopt->UseVisualStyleBackColor = true; + // // tabControl // this->tabControl->Controls->Add(this->tabPage_Resolution); @@ -576,12 +690,13 @@ private: System::Windows::Forms::Button^ button_Wiki; this->tabControl->Controls->Add(this->tabPage_Playerdata); this->tabControl->Controls->Add(this->tabPage_Components); this->tabControl->Controls->Add(this->tabPage_Plugins); + this->tabControl->Controls->Add(this->tabPage_Modpacks); this->tabControl->Controls->Add(this->tabPage_Credits); + this->tabControl->Controls->Add(this->tabPage_Update); this->tabControl->Location = System::Drawing::Point(0, 0); - this->tabControl->Margin = System::Windows::Forms::Padding(4, 4, 4, 4); this->tabControl->Name = L"tabControl"; this->tabControl->SelectedIndex = 0; - this->tabControl->Size = System::Drawing::Size(840, 576); + this->tabControl->Size = System::Drawing::Size(560, 404); this->tabControl->TabIndex = 10; // // tabPage_Resolution @@ -595,11 +710,10 @@ private: System::Windows::Forms::Button^ button_Wiki; this->tabPage_Resolution->Controls->Add(this->groupBox_ScreenRes); this->tabPage_Resolution->ForeColor = System::Drawing::Color::FromArgb(static_cast(static_cast(64)), static_cast(static_cast(64)), static_cast(static_cast(64))); - this->tabPage_Resolution->Location = System::Drawing::Point(4, 29); - this->tabPage_Resolution->Margin = System::Windows::Forms::Padding(4, 4, 4, 4); + this->tabPage_Resolution->Location = System::Drawing::Point(4, 22); this->tabPage_Resolution->Name = L"tabPage_Resolution"; - this->tabPage_Resolution->Padding = System::Windows::Forms::Padding(4, 4, 4, 4); - this->tabPage_Resolution->Size = System::Drawing::Size(832, 543); + this->tabPage_Resolution->Padding = System::Windows::Forms::Padding(3); + this->tabPage_Resolution->Size = System::Drawing::Size(552, 378); this->tabPage_Resolution->TabIndex = 0; this->tabPage_Resolution->Text = L"Graphics"; // @@ -607,11 +721,9 @@ private: System::Windows::Forms::Button^ button_Wiki; // this->groupBox_Lag->Controls->Add(this->trackBar_LagCompensation); this->groupBox_Lag->FlatStyle = System::Windows::Forms::FlatStyle::Flat; - this->groupBox_Lag->Location = System::Drawing::Point(8, 449); - this->groupBox_Lag->Margin = System::Windows::Forms::Padding(4, 4, 4, 4); + this->groupBox_Lag->Location = System::Drawing::Point(5, 303); this->groupBox_Lag->Name = L"groupBox_Lag"; - this->groupBox_Lag->Padding = System::Windows::Forms::Padding(4, 4, 4, 4); - this->groupBox_Lag->Size = System::Drawing::Size(394, 79); + this->groupBox_Lag->Size = System::Drawing::Size(263, 69); this->groupBox_Lag->TabIndex = 21; this->groupBox_Lag->TabStop = false; this->groupBox_Lag->Text = L"Lag Compensation"; @@ -619,11 +731,10 @@ private: System::Windows::Forms::Button^ button_Wiki; // trackBar_LagCompensation // this->trackBar_LagCompensation->LargeChange = 1; - this->trackBar_LagCompensation->Location = System::Drawing::Point(10, 30); - this->trackBar_LagCompensation->Margin = System::Windows::Forms::Padding(4, 4, 4, 4); + this->trackBar_LagCompensation->Location = System::Drawing::Point(7, 20); this->trackBar_LagCompensation->Maximum = 500; this->trackBar_LagCompensation->Name = L"trackBar_LagCompensation"; - this->trackBar_LagCompensation->Size = System::Drawing::Size(375, 69); + this->trackBar_LagCompensation->Size = System::Drawing::Size(250, 45); this->trackBar_LagCompensation->TabIndex = 0; this->trackBar_LagCompensation->TickStyle = System::Windows::Forms::TickStyle::None; this->trackBar_LagCompensation->ValueChanged += gcnew System::EventHandler(this, &ui::trackBar_LagCompensation_ValueChanged); @@ -632,11 +743,9 @@ private: System::Windows::Forms::Button^ button_Wiki; // this->groupBox_Details->Controls->Add(this->panel_Details); this->groupBox_Details->FlatStyle = System::Windows::Forms::FlatStyle::Flat; - this->groupBox_Details->Location = System::Drawing::Point(411, 9); - this->groupBox_Details->Margin = System::Windows::Forms::Padding(4, 4, 4, 4); + this->groupBox_Details->Location = System::Drawing::Point(274, 6); this->groupBox_Details->Name = L"groupBox_Details"; - this->groupBox_Details->Padding = System::Windows::Forms::Padding(4, 4, 4, 4); - this->groupBox_Details->Size = System::Drawing::Size(408, 519); + this->groupBox_Details->Size = System::Drawing::Size(272, 366); this->groupBox_Details->TabIndex = 11; this->groupBox_Details->TabStop = false; this->groupBox_Details->Text = L"Details"; @@ -644,10 +753,9 @@ private: System::Windows::Forms::Button^ button_Wiki; // panel_Details // this->panel_Details->AutoScroll = true; - this->panel_Details->Location = System::Drawing::Point(8, 28); - this->panel_Details->Margin = System::Windows::Forms::Padding(4, 4, 4, 4); + this->panel_Details->Location = System::Drawing::Point(5, 19); this->panel_Details->Name = L"panel_Details"; - this->panel_Details->Size = System::Drawing::Size(392, 482); + this->panel_Details->Size = System::Drawing::Size(261, 341); this->panel_Details->TabIndex = 0; // // labelGPU @@ -655,10 +763,11 @@ private: System::Windows::Forms::Button^ button_Wiki; this->labelGPU->AutoSize = true; this->labelGPU->BackColor = System::Drawing::Color::Transparent; this->labelGPU->ForeColor = System::Drawing::Color::Black; - this->labelGPU->Location = System::Drawing::Point(8, 314); - this->labelGPU->MinimumSize = System::Drawing::Size(394, 20); + this->labelGPU->Location = System::Drawing::Point(5, 213); + this->labelGPU->Margin = System::Windows::Forms::Padding(2, 0, 2, 0); + this->labelGPU->MinimumSize = System::Drawing::Size(263, 13); this->labelGPU->Name = L"labelGPU"; - this->labelGPU->Size = System::Drawing::Size(394, 20); + this->labelGPU->Size = System::Drawing::Size(263, 13); this->labelGPU->TabIndex = 21; this->labelGPU->TextAlign = System::Drawing::ContentAlignment::MiddleLeft; // @@ -666,11 +775,9 @@ private: System::Windows::Forms::Button^ button_Wiki; // this->groupBox_InternalRes->Controls->Add(this->panel_IntRes); this->groupBox_InternalRes->FlatStyle = System::Windows::Forms::FlatStyle::Flat; - this->groupBox_InternalRes->Location = System::Drawing::Point(8, 186); - this->groupBox_InternalRes->Margin = System::Windows::Forms::Padding(4, 4, 4, 4); + this->groupBox_InternalRes->Location = System::Drawing::Point(5, 127); this->groupBox_InternalRes->Name = L"groupBox_InternalRes"; - this->groupBox_InternalRes->Padding = System::Windows::Forms::Padding(4, 4, 4, 4); - this->groupBox_InternalRes->Size = System::Drawing::Size(394, 124); + this->groupBox_InternalRes->Size = System::Drawing::Size(263, 83); this->groupBox_InternalRes->TabIndex = 20; this->groupBox_InternalRes->TabStop = false; this->groupBox_InternalRes->Text = L"Internal Resolution (Quality)"; @@ -678,10 +785,9 @@ private: System::Windows::Forms::Button^ button_Wiki; // panel_IntRes // this->panel_IntRes->AutoScroll = true; - this->panel_IntRes->Location = System::Drawing::Point(8, 28); - this->panel_IntRes->Margin = System::Windows::Forms::Padding(4, 4, 4, 4); + this->panel_IntRes->Location = System::Drawing::Point(5, 19); this->panel_IntRes->Name = L"panel_IntRes"; - this->panel_IntRes->Size = System::Drawing::Size(380, 88); + this->panel_IntRes->Size = System::Drawing::Size(253, 59); this->panel_IntRes->TabIndex = 1; // // tabPage_Patches @@ -690,10 +796,9 @@ private: System::Windows::Forms::Button^ button_Wiki; this->tabPage_Patches->Controls->Add(this->panel_Patches); this->tabPage_Patches->ForeColor = System::Drawing::Color::FromArgb(static_cast(static_cast(64)), static_cast(static_cast(64)), static_cast(static_cast(64))); - this->tabPage_Patches->Location = System::Drawing::Point(4, 29); - this->tabPage_Patches->Margin = System::Windows::Forms::Padding(4, 4, 4, 4); + this->tabPage_Patches->Location = System::Drawing::Point(4, 22); this->tabPage_Patches->Name = L"tabPage_Patches"; - this->tabPage_Patches->Size = System::Drawing::Size(832, 543); + this->tabPage_Patches->Size = System::Drawing::Size(552, 378); this->tabPage_Patches->TabIndex = 1; this->tabPage_Patches->Text = L"Options"; // @@ -701,9 +806,8 @@ private: System::Windows::Forms::Button^ button_Wiki; // this->panel_Patches->AutoScroll = true; this->panel_Patches->Location = System::Drawing::Point(0, 0); - this->panel_Patches->Margin = System::Windows::Forms::Padding(4, 4, 4, 4); this->panel_Patches->Name = L"panel_Patches"; - this->panel_Patches->Size = System::Drawing::Size(828, 537); + this->panel_Patches->Size = System::Drawing::Size(552, 378); this->panel_Patches->TabIndex = 9; // // tabPage_Playerdata @@ -712,10 +816,9 @@ private: System::Windows::Forms::Button^ button_Wiki; this->tabPage_Playerdata->Controls->Add(this->panel_Playerdata); this->tabPage_Playerdata->ForeColor = System::Drawing::Color::FromArgb(static_cast(static_cast(64)), static_cast(static_cast(64)), static_cast(static_cast(64))); - this->tabPage_Playerdata->Location = System::Drawing::Point(4, 29); - this->tabPage_Playerdata->Margin = System::Windows::Forms::Padding(4, 4, 4, 4); + this->tabPage_Playerdata->Location = System::Drawing::Point(4, 22); this->tabPage_Playerdata->Name = L"tabPage_Playerdata"; - this->tabPage_Playerdata->Size = System::Drawing::Size(832, 543); + this->tabPage_Playerdata->Size = System::Drawing::Size(552, 378); this->tabPage_Playerdata->TabIndex = 3; this->tabPage_Playerdata->Text = L"Player"; // @@ -723,32 +826,42 @@ private: System::Windows::Forms::Button^ button_Wiki; // this->panel_Playerdata->AutoScroll = true; this->panel_Playerdata->Location = System::Drawing::Point(0, 0); - this->panel_Playerdata->Margin = System::Windows::Forms::Padding(4, 4, 4, 4); this->panel_Playerdata->Name = L"panel_Playerdata"; - this->panel_Playerdata->Size = System::Drawing::Size(828, 537); + this->panel_Playerdata->Size = System::Drawing::Size(552, 378); this->panel_Playerdata->TabIndex = 1; // // tabPage_Components // this->tabPage_Components->BackColor = System::Drawing::Color::White; + this->tabPage_Components->Controls->Add(this->linkLabel_Console); this->tabPage_Components->Controls->Add(this->panel_Components); this->tabPage_Components->ForeColor = System::Drawing::Color::FromArgb(static_cast(static_cast(64)), static_cast(static_cast(64)), static_cast(static_cast(64))); - this->tabPage_Components->Location = System::Drawing::Point(4, 29); - this->tabPage_Components->Margin = System::Windows::Forms::Padding(4, 4, 4, 4); + this->tabPage_Components->Location = System::Drawing::Point(4, 22); this->tabPage_Components->Name = L"tabPage_Components"; - this->tabPage_Components->Padding = System::Windows::Forms::Padding(4, 4, 4, 4); - this->tabPage_Components->Size = System::Drawing::Size(832, 543); + this->tabPage_Components->Padding = System::Windows::Forms::Padding(3); + this->tabPage_Components->Size = System::Drawing::Size(552, 378); this->tabPage_Components->TabIndex = 2; this->tabPage_Components->Text = L"Components"; // + // linkLabel_Console + // + this->linkLabel_Console->AutoSize = true; + this->linkLabel_Console->Location = System::Drawing::Point(504, 362); + this->linkLabel_Console->Name = L"linkLabel_Console"; + this->linkLabel_Console->Size = System::Drawing::Size(45, 13); + this->linkLabel_Console->TabIndex = 1; + this->linkLabel_Console->TabStop = true; + this->linkLabel_Console->Text = L"Console"; + this->linkLabel_Console->TextAlign = System::Drawing::ContentAlignment::BottomRight; + this->linkLabel_Console->LinkClicked += gcnew System::Windows::Forms::LinkLabelLinkClickedEventHandler(this, &ui::linkLabel_Console_LinkClicked); + // // panel_Components // this->panel_Components->AutoScroll = true; this->panel_Components->Location = System::Drawing::Point(0, 0); - this->panel_Components->Margin = System::Windows::Forms::Padding(4, 4, 4, 4); this->panel_Components->Name = L"panel_Components"; - this->panel_Components->Size = System::Drawing::Size(828, 537); + this->panel_Components->Size = System::Drawing::Size(276, 378); this->panel_Components->TabIndex = 0; // // tabPage_Plugins @@ -758,39 +871,152 @@ private: System::Windows::Forms::Button^ button_Wiki; this->tabPage_Plugins->Controls->Add(this->panel_Plugins); this->tabPage_Plugins->ForeColor = System::Drawing::Color::FromArgb(static_cast(static_cast(64)), static_cast(static_cast(64)), static_cast(static_cast(64))); - this->tabPage_Plugins->Location = System::Drawing::Point(4, 29); - this->tabPage_Plugins->Margin = System::Windows::Forms::Padding(4, 4, 4, 4); + this->tabPage_Plugins->Location = System::Drawing::Point(4, 22); this->tabPage_Plugins->Name = L"tabPage_Plugins"; - this->tabPage_Plugins->Padding = System::Windows::Forms::Padding(4, 4, 4, 4); - this->tabPage_Plugins->Size = System::Drawing::Size(832, 543); + this->tabPage_Plugins->Padding = System::Windows::Forms::Padding(3); + this->tabPage_Plugins->Size = System::Drawing::Size(552, 378); this->tabPage_Plugins->TabIndex = 3; this->tabPage_Plugins->Text = L"Plugins and Patches"; // // panel_Custom // this->panel_Custom->AutoScroll = true; - this->panel_Custom->Location = System::Drawing::Point(414, 0); - this->panel_Custom->Margin = System::Windows::Forms::Padding(4, 4, 4, 4); + this->panel_Custom->Location = System::Drawing::Point(276, 0); this->panel_Custom->Name = L"panel_Custom"; - this->panel_Custom->Size = System::Drawing::Size(414, 537); + this->panel_Custom->Size = System::Drawing::Size(276, 378); this->panel_Custom->TabIndex = 3; // // panel_Plugins // this->panel_Plugins->AutoScroll = true; this->panel_Plugins->Location = System::Drawing::Point(0, 0); - this->panel_Plugins->Margin = System::Windows::Forms::Padding(4, 4, 4, 4); this->panel_Plugins->Name = L"panel_Plugins"; - this->panel_Plugins->Size = System::Drawing::Size(414, 537); + this->panel_Plugins->Size = System::Drawing::Size(276, 378); this->panel_Plugins->TabIndex = 0; // + // tabPage_Modpacks + // + this->tabPage_Modpacks->Controls->Add(this->button_ModRename); + this->tabPage_Modpacks->Controls->Add(this->button_ModRescan); + this->tabPage_Modpacks->Controls->Add(this->button_ModFiles); + this->tabPage_Modpacks->Controls->Add(this->checkBox_ModPatches); + this->tabPage_Modpacks->Controls->Add(this->button_ModDelete); + this->tabPage_Modpacks->Controls->Add(this->button_ModClone); + this->tabPage_Modpacks->Controls->Add(this->button_ModSetActive); + this->tabPage_Modpacks->Controls->Add(this->listBox_Mods); + this->tabPage_Modpacks->Location = System::Drawing::Point(4, 22); + this->tabPage_Modpacks->Margin = System::Windows::Forms::Padding(2); + this->tabPage_Modpacks->Name = L"tabPage_Modpacks"; + this->tabPage_Modpacks->Padding = System::Windows::Forms::Padding(2); + this->tabPage_Modpacks->Size = System::Drawing::Size(552, 378); + this->tabPage_Modpacks->TabIndex = 7; + this->tabPage_Modpacks->Text = L"Modpacks"; + this->tabPage_Modpacks->UseVisualStyleBackColor = true; + this->tabPage_Modpacks->Enter += gcnew System::EventHandler(this, &ui::tabPage_Modpacks_Enter); + // + // button_ModRename + // + this->button_ModRename->Enabled = false; + this->button_ModRename->Location = System::Drawing::Point(279, 357); + this->button_ModRename->Margin = System::Windows::Forms::Padding(2); + this->button_ModRename->Name = L"button_ModRename"; + this->button_ModRename->Size = System::Drawing::Size(65, 21); + this->button_ModRename->TabIndex = 8; + this->button_ModRename->Text = L"Rename"; + this->button_ModRename->UseVisualStyleBackColor = true; + this->button_ModRename->Click += gcnew System::EventHandler(this, &ui::button_ModRename_Click); + // + // button_ModRescan + // + this->button_ModRescan->Location = System::Drawing::Point(348, 357); + this->button_ModRescan->Margin = System::Windows::Forms::Padding(2); + this->button_ModRescan->Name = L"button_ModRescan"; + this->button_ModRescan->Size = System::Drawing::Size(65, 21); + this->button_ModRescan->TabIndex = 7; + this->button_ModRescan->Text = L"Rescan"; + this->button_ModRescan->UseVisualStyleBackColor = true; + this->button_ModRescan->Click += gcnew System::EventHandler(this, &ui::button_ModRescan_Click); + // + // button_ModFiles + // + this->button_ModFiles->Enabled = false; + this->button_ModFiles->Location = System::Drawing::Point(73, 357); + this->button_ModFiles->Margin = System::Windows::Forms::Padding(2); + this->button_ModFiles->Name = L"button_ModFiles"; + this->button_ModFiles->Size = System::Drawing::Size(65, 21); + this->button_ModFiles->TabIndex = 6; + this->button_ModFiles->Text = L"Files..."; + this->button_ModFiles->UseVisualStyleBackColor = true; + this->button_ModFiles->Click += gcnew System::EventHandler(this, &ui::button_ModFiles_Click); + // + // checkBox_ModPatches + // + this->checkBox_ModPatches->AutoSize = true; + this->checkBox_ModPatches->Checked = true; + this->checkBox_ModPatches->CheckState = System::Windows::Forms::CheckState::Checked; + this->checkBox_ModPatches->Enabled = false; + this->checkBox_ModPatches->Location = System::Drawing::Point(430, 358); + this->checkBox_ModPatches->Margin = System::Windows::Forms::Padding(2); + this->checkBox_ModPatches->Name = L"checkBox_ModPatches"; + this->checkBox_ModPatches->Size = System::Drawing::Size(123, 17); + this->checkBox_ModPatches->TabIndex = 5; + this->checkBox_ModPatches->Text = L"Plugins and Patches"; + this->checkBox_ModPatches->UseVisualStyleBackColor = true; + // + // button_ModDelete + // + this->button_ModDelete->Enabled = false; + this->button_ModDelete->Location = System::Drawing::Point(211, 357); + this->button_ModDelete->Margin = System::Windows::Forms::Padding(2); + this->button_ModDelete->Name = L"button_ModDelete"; + this->button_ModDelete->Size = System::Drawing::Size(65, 21); + this->button_ModDelete->TabIndex = 4; + this->button_ModDelete->Text = L"Delete"; + this->button_ModDelete->UseVisualStyleBackColor = true; + this->button_ModDelete->Click += gcnew System::EventHandler(this, &ui::button_ModDelete_Click); + // + // button_ModClone + // + this->button_ModClone->Enabled = false; + this->button_ModClone->Location = System::Drawing::Point(142, 357); + this->button_ModClone->Margin = System::Windows::Forms::Padding(2); + this->button_ModClone->Name = L"button_ModClone"; + this->button_ModClone->Size = System::Drawing::Size(65, 21); + this->button_ModClone->TabIndex = 3; + this->button_ModClone->Text = L"New/Clone"; + this->button_ModClone->UseVisualStyleBackColor = true; + this->button_ModClone->Click += gcnew System::EventHandler(this, &ui::button_ModClone_Click); + // + // button_ModSetActive + // + this->button_ModSetActive->Enabled = false; + this->button_ModSetActive->Location = System::Drawing::Point(5, 357); + this->button_ModSetActive->Margin = System::Windows::Forms::Padding(2); + this->button_ModSetActive->Name = L"button_ModSetActive"; + this->button_ModSetActive->Size = System::Drawing::Size(65, 21); + this->button_ModSetActive->TabIndex = 2; + this->button_ModSetActive->Text = L"Set Active"; + this->button_ModSetActive->UseVisualStyleBackColor = true; + this->button_ModSetActive->Click += gcnew System::EventHandler(this, &ui::button_ModSetActive_Click); + // + // listBox_Mods + // + this->listBox_Mods->FormattingEnabled = true; + this->listBox_Mods->Location = System::Drawing::Point(5, 5); + this->listBox_Mods->Margin = System::Windows::Forms::Padding(2); + this->listBox_Mods->Name = L"listBox_Mods"; + this->listBox_Mods->Size = System::Drawing::Size(546, 342); + this->listBox_Mods->TabIndex = 0; + this->listBox_Mods->SelectedValueChanged += gcnew System::EventHandler(this, &ui::listBox_Mods_SelectedValueChanged); + // // tabPage_Credits // this->tabPage_Credits->Controls->Add(this->creditsTextBox); - this->tabPage_Credits->Location = System::Drawing::Point(4, 29); + this->tabPage_Credits->Location = System::Drawing::Point(4, 22); + this->tabPage_Credits->Margin = System::Windows::Forms::Padding(2); this->tabPage_Credits->Name = L"tabPage_Credits"; - this->tabPage_Credits->Padding = System::Windows::Forms::Padding(3, 3, 3, 3); - this->tabPage_Credits->Size = System::Drawing::Size(832, 543); + this->tabPage_Credits->Padding = System::Windows::Forms::Padding(2); + this->tabPage_Credits->Size = System::Drawing::Size(552, 378); this->tabPage_Credits->TabIndex = 5; this->tabPage_Credits->Text = L"Credits"; this->tabPage_Credits->UseVisualStyleBackColor = true; @@ -801,14 +1027,154 @@ private: System::Windows::Forms::Button^ button_Wiki; this->creditsTextBox->ForeColor = System::Drawing::Color::FromArgb(static_cast(static_cast(64)), static_cast(static_cast(64)), static_cast(static_cast(64))); this->creditsTextBox->Location = System::Drawing::Point(0, 0); + this->creditsTextBox->Margin = System::Windows::Forms::Padding(2); this->creditsTextBox->Multiline = true; this->creditsTextBox->Name = L"creditsTextBox"; this->creditsTextBox->ReadOnly = true; this->creditsTextBox->ScrollBars = System::Windows::Forms::ScrollBars::Both; - this->creditsTextBox->Size = System::Drawing::Size(826, 535); + this->creditsTextBox->Size = System::Drawing::Size(552, 378); this->creditsTextBox->TabIndex = 0; this->creditsTextBox->Text = resources->GetString(L"creditsTextBox.Text"); // + // tabPage_Update + // + this->tabPage_Update->Controls->Add(this->linkLabel_Repo); + this->tabPage_Update->Controls->Add(this->linkLabel_Help); + this->tabPage_Update->Controls->Add(this->linkLabel_Official_Discord); + this->tabPage_Update->Controls->Add(this->linkLabel_Changelog); + this->tabPage_Update->Controls->Add(this->button_Clean_installation); + this->tabPage_Update->Controls->Add(this->button_Instructions); + this->tabPage_Update->Controls->Add(this->button_Unstable_builds); + this->tabPage_Update->Controls->Add(this->button_Releases_page); + this->tabPage_Update->Controls->Add(this->label_Update_2); + this->tabPage_Update->Controls->Add(this->label_Update_1); + this->tabPage_Update->Location = System::Drawing::Point(4, 22); + this->tabPage_Update->Margin = System::Windows::Forms::Padding(2); + this->tabPage_Update->Name = L"tabPage_Update"; + this->tabPage_Update->Padding = System::Windows::Forms::Padding(2); + this->tabPage_Update->Size = System::Drawing::Size(552, 378); + this->tabPage_Update->TabIndex = 6; + this->tabPage_Update->Text = L"UPDATE"; + this->tabPage_Update->UseVisualStyleBackColor = true; + // + // linkLabel_Repo + // + this->linkLabel_Repo->AutoSize = true; + this->linkLabel_Repo->Location = System::Drawing::Point(169, 297); + this->linkLabel_Repo->Margin = System::Windows::Forms::Padding(2, 0, 2, 0); + this->linkLabel_Repo->Name = L"linkLabel_Repo"; + this->linkLabel_Repo->Size = System::Drawing::Size(87, 13); + this->linkLabel_Repo->TabIndex = 9; + this->linkLabel_Repo->TabStop = true; + this->linkLabel_Repo->Text = L"Official repository"; + this->linkLabel_Repo->LinkClicked += gcnew System::Windows::Forms::LinkLabelLinkClickedEventHandler(this, &ui::linkLabel_Repo_LinkClicked); + // + // linkLabel_Help + // + this->linkLabel_Help->AutoSize = true; + this->linkLabel_Help->Location = System::Drawing::Point(169, 257); + this->linkLabel_Help->Margin = System::Windows::Forms::Padding(2, 0, 2, 0); + this->linkLabel_Help->Name = L"linkLabel_Help"; + this->linkLabel_Help->Size = System::Drawing::Size(29, 13); + this->linkLabel_Help->TabIndex = 8; + this->linkLabel_Help->TabStop = true; + this->linkLabel_Help->Text = L"Help"; + this->linkLabel_Help->LinkClicked += gcnew System::Windows::Forms::LinkLabelLinkClickedEventHandler(this, &ui::linkLabel_Help_LinkClicked); + // + // linkLabel_Official_Discord + // + this->linkLabel_Official_Discord->AutoSize = true; + this->linkLabel_Official_Discord->Location = System::Drawing::Point(169, 277); + this->linkLabel_Official_Discord->Margin = System::Windows::Forms::Padding(2, 0, 2, 0); + this->linkLabel_Official_Discord->Name = L"linkLabel_Official_Discord"; + this->linkLabel_Official_Discord->Size = System::Drawing::Size(78, 13); + this->linkLabel_Official_Discord->TabIndex = 7; + this->linkLabel_Official_Discord->TabStop = true; + this->linkLabel_Official_Discord->Text = L"Official Discord"; + this->linkLabel_Official_Discord->LinkClicked += gcnew System::Windows::Forms::LinkLabelLinkClickedEventHandler(this, &ui::linkLabel_Official_Discord_LinkClicked); + // + // linkLabel_Changelog + // + this->linkLabel_Changelog->AutoSize = true; + this->linkLabel_Changelog->Location = System::Drawing::Point(169, 238); + this->linkLabel_Changelog->Margin = System::Windows::Forms::Padding(2, 0, 2, 0); + this->linkLabel_Changelog->Name = L"linkLabel_Changelog"; + this->linkLabel_Changelog->Size = System::Drawing::Size(58, 13); + this->linkLabel_Changelog->TabIndex = 6; + this->linkLabel_Changelog->TabStop = true; + this->linkLabel_Changelog->Text = L"Changelog"; + this->linkLabel_Changelog->LinkClicked += gcnew System::Windows::Forms::LinkLabelLinkClickedEventHandler(this, &ui::linkLabel_Changelog_LinkClicked); + // + // button_Clean_installation + // + this->button_Clean_installation->Location = System::Drawing::Point(295, 207); + this->button_Clean_installation->Margin = System::Windows::Forms::Padding(2); + this->button_Clean_installation->Name = L"button_Clean_installation"; + this->button_Clean_installation->Size = System::Drawing::Size(92, 26); + this->button_Clean_installation->TabIndex = 5; + this->button_Clean_installation->Text = L"Clean installation"; + this->button_Clean_installation->UseVisualStyleBackColor = true; + this->button_Clean_installation->Click += gcnew System::EventHandler(this, &ui::button_Clean_installation_Click); + // + // button_Instructions + // + this->button_Instructions->Location = System::Drawing::Point(295, 177); + this->button_Instructions->Margin = System::Windows::Forms::Padding(2); + this->button_Instructions->Name = L"button_Instructions"; + this->button_Instructions->Size = System::Drawing::Size(92, 26); + this->button_Instructions->TabIndex = 4; + this->button_Instructions->Text = L"Instructions"; + this->button_Instructions->UseVisualStyleBackColor = true; + this->button_Instructions->Click += gcnew System::EventHandler(this, &ui::button_Instructions_Click); + // + // button_Unstable_builds + // + this->button_Unstable_builds->Location = System::Drawing::Point(169, 207); + this->button_Unstable_builds->Margin = System::Windows::Forms::Padding(2); + this->button_Unstable_builds->Name = L"button_Unstable_builds"; + this->button_Unstable_builds->Size = System::Drawing::Size(92, 26); + this->button_Unstable_builds->TabIndex = 3; + this->button_Unstable_builds->Text = L"Unstable builds"; + this->button_Unstable_builds->UseVisualStyleBackColor = true; + this->button_Unstable_builds->Click += gcnew System::EventHandler(this, &ui::button_Unstable_builds_Click); + // + // button_Releases_page + // + this->button_Releases_page->Location = System::Drawing::Point(169, 177); + this->button_Releases_page->Margin = System::Windows::Forms::Padding(2); + this->button_Releases_page->Name = L"button_Releases_page"; + this->button_Releases_page->Size = System::Drawing::Size(92, 26); + this->button_Releases_page->TabIndex = 2; + this->button_Releases_page->Text = L"Releases page"; + this->button_Releases_page->UseVisualStyleBackColor = true; + this->button_Releases_page->Click += gcnew System::EventHandler(this, &ui::button_Releases_page_Click); + // + // label_Update_2 + // + this->label_Update_2->AutoSize = true; + this->label_Update_2->Location = System::Drawing::Point(48, 73); + this->label_Update_2->Margin = System::Windows::Forms::Padding(2, 0, 2, 0); + this->label_Update_2->Name = L"label_Update_2"; + this->label_Update_2->Size = System::Drawing::Size(467, 26); + this->label_Update_2->TabIndex = 1; + this->label_Update_2->Text = L"It is highly recommended to download updates directly from the official repositor" + L"y.\r\nIf you have downloaded PD Loader from a third-party, it is recommended to do" + L" a clean installation."; + this->label_Update_2->TextAlign = System::Drawing::ContentAlignment::MiddleCenter; + // + // label_Update_1 + // + this->label_Update_1->AutoSize = true; + this->label_Update_1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 12, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, + static_cast(0))); + this->label_Update_1->Location = System::Drawing::Point(11, 30); + this->label_Update_1->Margin = System::Windows::Forms::Padding(2, 0, 2, 0); + this->label_Update_1->Name = L"label_Update_1"; + this->label_Update_1->Size = System::Drawing::Size(555, 20); + this->label_Update_1->TabIndex = 0; + this->label_Update_1->Text = L"Update PD Loader regularly to get the latest fixes and new features!"; + this->label_Update_1->TextAlign = System::Drawing::ContentAlignment::MiddleCenter; + // // button_Discord // this->button_Discord->BackColor = System::Drawing::Color::FromArgb(static_cast(static_cast(242)), static_cast(static_cast(242)), @@ -817,10 +1183,9 @@ private: System::Windows::Forms::Button^ button_Wiki; this->button_Discord->FlatAppearance->BorderSize = 0; this->button_Discord->FlatStyle = System::Windows::Forms::FlatStyle::Flat; this->button_Discord->Image = (cli::safe_cast(resources->GetObject(L"button_Discord.Image"))); - this->button_Discord->Location = System::Drawing::Point(744, 576); - this->button_Discord->Margin = System::Windows::Forms::Padding(4, 4, 4, 4); + this->button_Discord->Location = System::Drawing::Point(496, 404); this->button_Discord->Name = L"button_Discord"; - this->button_Discord->Size = System::Drawing::Size(48, 48); + this->button_Discord->Size = System::Drawing::Size(32, 32); this->button_Discord->TabIndex = 31; this->button_Discord->UseVisualStyleBackColor = false; this->button_Discord->Click += gcnew System::EventHandler(this, &ui::button_Discord_Click); @@ -833,10 +1198,9 @@ private: System::Windows::Forms::Button^ button_Wiki; this->button_github->FlatAppearance->BorderSize = 0; this->button_github->FlatStyle = System::Windows::Forms::FlatStyle::Flat; this->button_github->Image = (cli::safe_cast(resources->GetObject(L"button_github.Image"))); - this->button_github->Location = System::Drawing::Point(792, 576); - this->button_github->Margin = System::Windows::Forms::Padding(4, 4, 4, 4); + this->button_github->Location = System::Drawing::Point(528, 404); this->button_github->Name = L"button_github"; - this->button_github->Size = System::Drawing::Size(48, 48); + this->button_github->Size = System::Drawing::Size(32, 32); this->button_github->TabIndex = 32; this->button_github->UseVisualStyleBackColor = false; this->button_github->Click += gcnew System::EventHandler(this, &ui::button_github_Click); @@ -846,10 +1210,9 @@ private: System::Windows::Forms::Button^ button_Wiki; this->button_Apply->BackColor = System::Drawing::Color::White; this->button_Apply->FlatAppearance->BorderColor = System::Drawing::SystemColors::Control; this->button_Apply->FlatStyle = System::Windows::Forms::FlatStyle::Flat; - this->button_Apply->Location = System::Drawing::Point(6, 584); - this->button_Apply->Margin = System::Windows::Forms::Padding(4, 4, 4, 4); + this->button_Apply->Location = System::Drawing::Point(4, 409); this->button_Apply->Name = L"button_Apply"; - this->button_Apply->Size = System::Drawing::Size(104, 34); + this->button_Apply->Size = System::Drawing::Size(69, 23); this->button_Apply->TabIndex = 33; this->button_Apply->Text = L"Apply"; this->button_Apply->UseVisualStyleBackColor = false; @@ -864,10 +1227,9 @@ private: System::Windows::Forms::Button^ button_Wiki; this->button_Wiki->Cursor = System::Windows::Forms::Cursors::Hand; this->button_Wiki->FlatAppearance->BorderSize = 0; this->button_Wiki->FlatStyle = System::Windows::Forms::FlatStyle::Flat; - this->button_Wiki->Location = System::Drawing::Point(696, 576); - this->button_Wiki->Margin = System::Windows::Forms::Padding(4, 4, 4, 4); + this->button_Wiki->Location = System::Drawing::Point(464, 404); this->button_Wiki->Name = L"button_Wiki"; - this->button_Wiki->Size = System::Drawing::Size(48, 48); + this->button_Wiki->Size = System::Drawing::Size(32, 32); this->button_Wiki->TabIndex = 34; this->button_Wiki->UseVisualStyleBackColor = false; this->button_Wiki->Click += gcnew System::EventHandler(this, &ui::button_Wiki_Click); @@ -875,13 +1237,13 @@ private: System::Windows::Forms::Button^ button_Wiki; // ui // this->AcceptButton = this->button_Launch; - this->AutoScaleDimensions = System::Drawing::SizeF(144, 144); + this->AutoScaleDimensions = System::Drawing::SizeF(96, 96); this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Dpi; this->AutoSize = true; this->AutoSizeMode = System::Windows::Forms::AutoSizeMode::GrowAndShrink; this->BackColor = System::Drawing::Color::Magenta; this->BackgroundImageLayout = System::Windows::Forms::ImageLayout::Stretch; - this->ClientSize = System::Drawing::Size(840, 626); + this->ClientSize = System::Drawing::Size(560, 437); this->Controls->Add(this->button_Wiki); this->Controls->Add(this->button_Apply); this->Controls->Add(this->tabControl); @@ -895,15 +1257,16 @@ private: System::Windows::Forms::Button^ button_Wiki; this->HelpButton = true; this->Icon = (cli::safe_cast(resources->GetObject(L"$this.Icon"))); this->KeyPreview = true; - this->Margin = System::Windows::Forms::Padding(4, 4, 4, 4); this->MaximizeBox = false; this->Name = L"ui"; this->StartPosition = System::Windows::Forms::FormStartPosition::CenterScreen; - this->Text = L"PD Launcher"; + this->Text = L"PD Loader 3 - Launcher"; this->TransparencyKey = System::Drawing::Color::Magenta; this->FormClosing += gcnew System::Windows::Forms::FormClosingEventHandler(this, &ui::Ui_FormClosing); this->FormClosed += gcnew System::Windows::Forms::FormClosedEventHandler(this, &ui::Ui_FormClosed); this->groupBox_ScreenRes->ResumeLayout(false); + this->panel_ScreenRes->ResumeLayout(false); + this->panel_ScreenRes->PerformLayout(); this->tabControl->ResumeLayout(false); this->tabPage_Resolution->ResumeLayout(false); this->tabPage_Resolution->PerformLayout(); @@ -915,13 +1278,40 @@ private: System::Windows::Forms::Button^ button_Wiki; this->tabPage_Patches->ResumeLayout(false); this->tabPage_Playerdata->ResumeLayout(false); this->tabPage_Components->ResumeLayout(false); + this->tabPage_Components->PerformLayout(); this->tabPage_Plugins->ResumeLayout(false); + this->tabPage_Modpacks->ResumeLayout(false); + this->tabPage_Modpacks->PerformLayout(); this->tabPage_Credits->ResumeLayout(false); this->tabPage_Credits->PerformLayout(); + this->tabPage_Update->ResumeLayout(false); + this->tabPage_Update->PerformLayout(); this->ResumeLayout(false); } #pragma endregion + private: System::Void scanModpacks() { + button_ModSetActive->Enabled = false; + button_ModClone->Enabled = false; + button_ModDelete->Enabled = false; + button_ModFiles->Enabled = false; + button_ModRename->Enabled = false; + listBox_Mods->Items->Clear(); + listBox_Mods->Items->Add("(base)"); + try { + for (std::filesystem::path p : std::filesystem::directory_iterator("./modpacks")) + { + if (std::filesystem::exists(p.string() + "/ram") && std::filesystem::exists(p.string() + "/mdata") && + std::filesystem::exists(p.string() + "/plugins") && std::filesystem::exists(p.string() + "/patches")) + { + listBox_Mods->Items->Add(gcnew String(p.filename().c_str())); + } + } + } + catch (const std::filesystem::filesystem_error& e) { + std::cout << "[Launcher] File system error " << e.what() << " " << e.path1() << " " << e.path2() << " " << e.code() << std::endl; + } + } private: System::Void SaveSettings() { if (*ResolutionConfigChanged) { @@ -935,6 +1325,9 @@ private: System::Void SaveSettings() { option->SaveOption(); } + /*if (getFullscreenOptimizations() == this->checkBox_nofsopt->Checked)*/ setFullscreenOptimizations(!this->checkBox_nofsopt->Checked); + this->checkBox_nofsopt->Checked = !getFullscreenOptimizations(); + *ResolutionConfigChanged = false; } @@ -1111,8 +1504,8 @@ private: System::Void button_github_Click(System::Object^ sender, System::EventA private: System::Void button_Apply_Click(System::Object^ sender, System::EventArgs^ e) { SaveSettings(); updateStyle(); - ShowWindow(hWnd, SW_HIDE); - ShowWindow(hWnd, SW_SHOW); + //ShowWindow(hWnd, SW_HIDE); + //ShowWindow(hWnd, SW_SHOW); } private: System::Void Ui_KeyDown(System::Object^ sender, System::Windows::Forms::KeyEventArgs^ e) { if (e->KeyCode == Keys::Escape) this->Close(); @@ -1152,5 +1545,82 @@ private: System::Void button_Wiki_Click(System::Object^ sender, System::EventArg } private: System::Void trackBar_LagCompensation_Scroll(System::Object^ sender, System::EventArgs^ e) { } +private: System::Void button_Releases_page_Click(System::Object^ sender, System::EventArgs^ e) { + System::Diagnostics::Process::Start("https://notabug.org/PDModdingCommunity/PD-Loader/releases"); +} +private: System::Void button_Instructions_Click(System::Object^ sender, System::EventArgs^ e) { + System::Diagnostics::Process::Start("https://notabug.org/PDModdingCommunity/PD-Loader/wiki/2%29+Installation"); +} +private: System::Void button_Unstable_builds_Click(System::Object^ sender, System::EventArgs^ e) { + System::Diagnostics::Process::Start("https://ci.appveyor.com/project/nastys/pd-loader/build/artifacts"); +} +private: System::Void button_Clean_installation_Click(System::Object^ sender, System::EventArgs^ e) { + SkinnedMessageBox::Show(this, "Delete:\n- dnsapi.dll or dinput8.dll\n- patches/\n- plugins/\n\nRestore:\n- glut32.dll\n\nThen install PD Loader from the official repository.", "How to do a clean installation", MessageBoxButtons::OK, MessageBoxIcon::Information); +} +private: System::Void linkLabel_Changelog_LinkClicked(System::Object^ sender, System::Windows::Forms::LinkLabelLinkClickedEventArgs^ e) { + System::Diagnostics::Process::Start("https://notabug.org/PDModdingCommunity/PD-Loader/wiki/Changelog"); +} +private: System::Void linkLabel_Official_Discord_LinkClicked(System::Object^ sender, System::Windows::Forms::LinkLabelLinkClickedEventArgs^ e) { + System::Diagnostics::Process::Start("https://discord.gg/cvBVGDZ"); +} +private: System::Void linkLabel_Help_LinkClicked(System::Object^ sender, System::Windows::Forms::LinkLabelLinkClickedEventArgs^ e) { + System::Diagnostics::Process::Start("https://notabug.org/PDModdingCommunity/PD-Loader/wiki"); +} +private: System::Void linkLabel_Repo_LinkClicked(System::Object^ sender, System::Windows::Forms::LinkLabelLinkClickedEventArgs^ e) { + System::Diagnostics::Process::Start("https://notabug.org/PDModdingCommunity/PD-Loader"); +} +private: System::Void checkBox_nofsopt_CheckedChanged(System::Object^ sender, System::EventArgs^ e) { + *ResolutionConfigChanged = true; +} +private: System::Void keycfg_button_Click(System::Object^ sender, System::EventArgs^ e) +{ + System::Diagnostics::Process::Start("\"" + System::Environment::GetEnvironmentVariable("WINDIR") + "\\write.exe\"", "plugins\\keyconfig.ini"); +} +private: System::Void linkLabel_Console_LinkClicked(System::Object^ sender, System::Windows::Forms::LinkLabelLinkClickedEventArgs^ e) { + HWND consoleHandle = GetConsoleWindow(); + ShowWindow(consoleHandle, SW_SHOW); + linkLabel_Console->Visible = false; +} +private: System::Void listBox_Mods_SelectedValueChanged(System::Object^ sender, System::EventArgs^ e) { + button_ModSetActive->Enabled = true; + button_ModClone->Enabled = true; + button_ModDelete->Enabled = true; + button_ModFiles->Enabled = true; + button_ModRename->Enabled = true; +} +private: System::Void button_ModRescan_Click(System::Object^ sender, System::EventArgs^ e) { + scanModpacks(); +} +private: System::Void button_ModSetActive_Click(System::Object^ sender, System::EventArgs^ e) { + LPCWSTR mpname; + if (listBox_Mods->SelectedIndex == 0) mpname = L""; + else + { + auto str = listBox_Mods->GetItemText(listBox_Mods->SelectedItem); + IntPtr strptr = System::Runtime::InteropServices::Marshal::StringToHGlobalUni(str); + mpname = (LPCWSTR)strptr.ToPointer(); + } + WritePrivateProfileStringW(L"Mods", L"Modpack", mpname, CONFIG_FILE); +} +private: System::Void button_ModFiles_Click(System::Object^ sender, System::EventArgs^ e) { + auto mpstr = listBox_Mods->SelectedItem->ToString(); + if(mpstr == "(base)") System::Diagnostics::Process::Start("."); + else System::Diagnostics::Process::Start("modpacks\\"+mpstr); +} +private: System::Void button_ModClone_Click(System::Object^ sender, System::EventArgs^ e) { +} +private: System::Void button_ModDelete_Click(System::Object^ sender, System::EventArgs^ e) { +} +private: System::Void button_ModRename_Click(System::Object^ sender, System::EventArgs^ e) { +} +private: System::Void tabPage_Modpacks_Enter(System::Object^ sender, System::EventArgs^ e) { + scanModpacks(); + wchar_t* mpstr = NULL; + mpstr = (wchar_t*)malloc(256); + memset(mpstr, 0, 256); + GetPrivateProfileStringW(L"Mods", L"Modpack", L"", mpstr, 256, CONFIG_FILE); + listBox_Mods->SelectedIndex = listBox_Mods->FindString(gcnew String(mpstr)); + free(mpstr); +} }; } diff --git a/source-code/source/plugins/Launcher/ui.resx b/source-code/source/plugins/Launcher/ui.resx index d010943..72f6f09 100644 --- a/source-code/source/plugins/Launcher/ui.resx +++ b/source-code/source/plugins/Launcher/ui.resx @@ -117,6 +117,9 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 17, 17 + PD Loader is intended for educational purposes only; not for piracy. Users should possess a legally-obtained dump of the game to use this software. @@ -294,9 +297,6 @@ AMD compatibilty pack dependencies have additional licenses, detailed in the AMD ZSNnuf0xq38QLKYcn/7WyZSb81ROzr/0gUC6FNUQmwAAAABJRU5ErkJggg== - - 17, 17 - iVBORw0KGgoAAAANSUhEUgAAAikAAAIrCAYAAAAqWwkVAAABgmlDQ1BJQ0MgcHJvZmlsZQAAKM+VkUso diff --git a/source-code/source/plugins/TLAC/Components/Input/InputEmulator.cpp b/source-code/source/plugins/TLAC/Components/Input/InputEmulator.cpp index db1ec58..194b9f3 100644 --- a/source-code/source/plugins/TLAC/Components/Input/InputEmulator.cpp +++ b/source-code/source/plugins/TLAC/Components/Input/InputEmulator.cpp @@ -306,10 +306,10 @@ namespace TLAC::Components if (buttonTestFunc(RightBinding)) buttons |= JVS_R; - if (buttonTestFunc(CoinBinding)) + if (CoinBinding->AnyTapped()) addCoin(); - if (buttonTestFunc(WireframeBinding)) + if (WireframeBinding->AnyTapped()) toggleWireframe(); return buttons;