From d0942a35b1b466fed57a657e5c572c592218bbfa Mon Sep 17 00:00:00 2001 From: somewhatlurker <52014015+somewhatlurker@users.noreply.github.com> Date: Sun, 6 Oct 2019 15:51:09 +1100 Subject: [PATCH] add launcher info for most plugins, add launcher build date for plugins (DivaMovie excluded to avoid conflicts when merging changes to that later) --- .../dependencies/PluginConfigApi/PluginConfigApi.h | 8 ++++++++ source-code/source/plugins/Launcher/framework.h | 9 +++++++++ source-code/source/plugins/Patches/Patches.vcxproj | 6 +++--- source-code/source/plugins/Patches/dllmain.cpp | 14 ++++++++++++++ source-code/source/plugins/Render/Render.vcxproj | 6 +++--- source-code/source/plugins/Render/dllmain.cpp | 14 ++++++++++++++ source-code/source/plugins/TLAC/TLAC.vcxproj | 5 +++-- .../source/plugins/TLAC/TLAC.vcxproj.filters | 3 +++ source-code/source/plugins/TLAC/dllmain.cpp | 1 + source-code/source/plugins/TLAC/pluginconfig.h | 13 +++++++++++++ 10 files changed, 71 insertions(+), 8 deletions(-) create mode 100644 source-code/source/plugins/TLAC/pluginconfig.h diff --git a/source-code/dependencies/PluginConfigApi/PluginConfigApi.h b/source-code/dependencies/PluginConfigApi/PluginConfigApi.h index d0ffd94..bb39dca 100644 --- a/source-code/dependencies/PluginConfigApi/PluginConfigApi.h +++ b/source-code/dependencies/PluginConfigApi/PluginConfigApi.h @@ -165,4 +165,12 @@ namespace PluginConfig PluginConfigOption* options; }; #pragma pack(pop) + + // note: this is actually the build date of PluginConfigApi -- make sure this isn't cached for CI + extern "C" __declspec(dllexport) LPCWSTR GetBuildDate(void) + { + WCHAR utf16buf[128]; + MultiByteToWideChar(CP_UTF8, 0, __DATE__, -1, utf16buf, 128); + return _wcsdup(utf16buf); + } } \ No newline at end of file diff --git a/source-code/source/plugins/Launcher/framework.h b/source-code/source/plugins/Launcher/framework.h index 3fb94ae..7493bd8 100644 --- a/source-code/source/plugins/Launcher/framework.h +++ b/source-code/source/plugins/Launcher/framework.h @@ -311,6 +311,7 @@ struct PluginInfo { std::wstring filename; std::wstring name; std::wstring description; + std::wstring builddate; std::vector configopts; }; std::vector LoadPlugins() @@ -341,6 +342,7 @@ std::vector LoadPlugins() auto nameFunc = (LPCWSTR(*)())GetProcAddress(thisplugin.handle, "GetPluginName"); auto descFunc = (LPCWSTR(*)())GetProcAddress(thisplugin.handle, "GetPluginDescription"); + auto dateFunc = (LPCWSTR(*)())GetProcAddress(thisplugin.handle, "GetBuildDate"); auto optsFunc = (PluginConfig::PluginConfigArray(*)())GetProcAddress(thisplugin.handle, "GetPluginOptions"); if (nameFunc != NULL) @@ -353,6 +355,13 @@ std::vector LoadPlugins() else thisplugin.description = (thisplugin.filename + L" Plugin").c_str(); + if (dateFunc != NULL) + thisplugin.builddate = dateFunc(); + else + thisplugin.builddate = L"Unknown"; + + thisplugin.description += L"\n\nVersion: " + thisplugin.builddate; + if (optsFunc != NULL) thisplugin.configopts = PluginConfig::GetConfigOptionVec(optsFunc()); diff --git a/source-code/source/plugins/Patches/Patches.vcxproj b/source-code/source/plugins/Patches/Patches.vcxproj index 578fd8a..8bb8937 100644 --- a/source-code/source/plugins/Patches/Patches.vcxproj +++ b/source-code/source/plugins/Patches/Patches.vcxproj @@ -1,4 +1,4 @@ - + @@ -96,7 +96,7 @@ true pch.h stdcpp17 - ..\..\..\dependencies\freeglut\include;%(AdditionalIncludeDirectories) + ..\..\..\dependencies\PluginConfigApi;..\..\..\dependencies\freeglut\include;%(AdditionalIncludeDirectories) Windows @@ -133,7 +133,7 @@ true - ..\..\..\dependencies\freeglut\include;%(AdditionalIncludeDirectories) + ..\..\..\dependencies\PluginConfigApi;..\..\..\dependencies\freeglut\include;%(AdditionalIncludeDirectories) stdcpp17 diff --git a/source-code/source/plugins/Patches/dllmain.cpp b/source-code/source/plugins/Patches/dllmain.cpp index 5e5c6d6..c7b912e 100644 --- a/source-code/source/plugins/Patches/dllmain.cpp +++ b/source-code/source/plugins/Patches/dllmain.cpp @@ -6,6 +6,7 @@ #include #include #include +#include "PluginConfigApi.h" void InjectCode(void* address, const std::vector data); void ApplyPatches(); @@ -322,3 +323,16 @@ void InjectCode(void* address, const std::vector data) memcpy(address, data.data(), byteCount); VirtualProtect(address, byteCount, oldProtect, nullptr); } + + +using namespace PluginConfig; + +extern "C" __declspec(dllexport) LPCWSTR GetPluginName(void) +{ + return L"Patches"; +} + +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 diff --git a/source-code/source/plugins/Render/Render.vcxproj b/source-code/source/plugins/Render/Render.vcxproj index 32edb89..0ca8562 100644 --- a/source-code/source/plugins/Render/Render.vcxproj +++ b/source-code/source/plugins/Render/Render.vcxproj @@ -1,4 +1,4 @@ - + @@ -96,7 +96,7 @@ true - ..\..\..\dependencies\freeglut\include;..\..\..\dependencies\detours\include;%(AdditionalIncludeDirectories) + ..\..\..\dependencies\PluginConfigApi;..\..\..\dependencies\freeglut\include;..\..\..\dependencies\detours\include;%(AdditionalIncludeDirectories) stdcpp17 @@ -135,7 +135,7 @@ stdcpp17 - ..\..\..\dependencies\freeglut\include;..\..\..\dependencies\detours\include;%(AdditionalIncludeDirectories) + ..\..\..\dependencies\PluginConfigApi;..\..\..\dependencies\freeglut\include;..\..\..\dependencies\detours\include;%(AdditionalIncludeDirectories) Windows diff --git a/source-code/source/plugins/Render/dllmain.cpp b/source-code/source/plugins/Render/dllmain.cpp index 6c0809a..1c1e2fa 100644 --- a/source-code/source/plugins/Render/dllmain.cpp +++ b/source-code/source/plugins/Render/dllmain.cpp @@ -11,6 +11,8 @@ #include +#include "PluginConfigApi.h" + using namespace std::chrono; int hookedCreateWindow(const char* title, void(__cdecl* exit_function)(int)) @@ -238,3 +240,15 @@ BOOL APIENTRY DllMain(HMODULE hModule, return TRUE; } + +using namespace PluginConfig; + +extern "C" __declspec(dllexport) LPCWSTR GetPluginName(void) +{ + return L"Render"; +} + +extern "C" __declspec(dllexport) LPCWSTR GetPluginDescription(void) +{ + return L"Applies window mode/size and FPS limiting."; +} \ No newline at end of file diff --git a/source-code/source/plugins/TLAC/TLAC.vcxproj b/source-code/source/plugins/TLAC/TLAC.vcxproj index 6d8cf0f..d09047a 100644 --- a/source-code/source/plugins/TLAC/TLAC.vcxproj +++ b/source-code/source/plugins/TLAC/TLAC.vcxproj @@ -99,7 +99,7 @@ stdcpp17 - ..\..\..\dependencies\detours\include;..\..\..\dependencies\freeglut\include;%(AdditionalIncludeDirectories) + ..\..\..\dependencies\PluginConfigApi;..\..\..\dependencies\detours\include;..\..\..\dependencies\freeglut\include;%(AdditionalIncludeDirectories) Windows @@ -139,7 +139,7 @@ stdcpp17 - ..\..\..\dependencies\detours\include;..\..\..\dependencies\freeglut\include;%(AdditionalIncludeDirectories) + ..\..\..\dependencies\PluginConfigApi;..\..\..\dependencies\detours\include;..\..\..\dependencies\freeglut\include;%(AdditionalIncludeDirectories) Windows @@ -225,6 +225,7 @@ + diff --git a/source-code/source/plugins/TLAC/TLAC.vcxproj.filters b/source-code/source/plugins/TLAC/TLAC.vcxproj.filters index 33c5ee7..ad474b4 100644 --- a/source-code/source/plugins/TLAC/TLAC.vcxproj.filters +++ b/source-code/source/plugins/TLAC/TLAC.vcxproj.filters @@ -195,6 +195,9 @@ Header Files + + Header Files + diff --git a/source-code/source/plugins/TLAC/dllmain.cpp b/source-code/source/plugins/TLAC/dllmain.cpp index 4ed8162..6569cd1 100644 --- a/source-code/source/plugins/TLAC/dllmain.cpp +++ b/source-code/source/plugins/TLAC/dllmain.cpp @@ -5,6 +5,7 @@ #include #include "Constants.h" #include "framework.h" +#include "pluginconfig.h" #include "Input/Mouse/Mouse.h" #include "Input/Xinput/Xinput.h" #include "Input/Keyboard/Keyboard.h" diff --git a/source-code/source/plugins/TLAC/pluginconfig.h b/source-code/source/plugins/TLAC/pluginconfig.h new file mode 100644 index 0000000..69ae889 --- /dev/null +++ b/source-code/source/plugins/TLAC/pluginconfig.h @@ -0,0 +1,13 @@ +#include "PluginConfigApi.h" + +using namespace PluginConfig; + +extern "C" __declspec(dllexport) LPCWSTR GetPluginName(void) +{ + return L"TLAC"; +} + +extern "C" __declspec(dllexport) LPCWSTR GetPluginDescription(void) +{ + return L"Provides keyboard/mouse/controller input, player data management, bug fixes for running on more PCs, etc.\nThis plugin is required."; +} \ No newline at end of file