diff --git a/src/gkmsGUI/gkmsGUILoop.cpp b/src/gkmsGUI/gkmsGUILoop.cpp index 98b6d16..8507e17 100644 --- a/src/gkmsGUI/gkmsGUILoop.cpp +++ b/src/gkmsGUI/gkmsGUILoop.cpp @@ -3,6 +3,7 @@ #include "GUII18n.hpp" #include "GakumasLocalify/config/Config.hpp" #include "resourceUpdate/resourceUpdate.hpp" +#include "platformDefine.hpp" extern void* SetResolution_orig; extern std::function g_reload_all_data; @@ -150,6 +151,7 @@ namespace GkmsGUILoop { using namespace GakumasLocal; if (ImGui::Begin("Gakumas Plugin Config")) { + ImGui::Text("Plugin Version: %s", PLUGIN_VERSION); ImGui::Text("Resource Version: %s", GkmsResourceUpdate::GetCurrentResourceVersion(true).c_str()); if (ImGui::Button("Reload Config And Translation Data")) { diff --git a/src/platformDefine.hpp b/src/platformDefine.hpp index d11340a..87a67d8 100644 --- a/src/platformDefine.hpp +++ b/src/platformDefine.hpp @@ -11,6 +11,7 @@ #define LogMinVersion ANDROID_LOG_DEBUG +#define PLUGIN_VERSION "3.0.0" #define ADD_HOOK(name, addr) \ name##_Addr = reinterpret_cast(addr); \ diff --git a/src/resourceUpdate/resourceUpdate.cpp b/src/resourceUpdate/resourceUpdate.cpp index 2cc237e..b3b4a45 100644 --- a/src/resourceUpdate/resourceUpdate.cpp +++ b/src/resourceUpdate/resourceUpdate.cpp @@ -165,7 +165,8 @@ namespace GkmsResourceUpdate { if (localVersion == remoteVersion) { if (isManual) { - auto check = MessageBoxA(NULL, GkmsGUII18n::ts("local_file_already_latest"), "Check Update", MB_OKCANCEL); + auto check = MessageBoxW(NULL, utility::conversions::to_string_t(GkmsGUII18n::ts("local_file_already_latest")).c_str(), + L"Check Update", MB_OKCANCEL); if (check != IDOK) { return; } diff --git a/src/windowsPlatform.cpp b/src/windowsPlatform.cpp index 9186df8..1097400 100644 --- a/src/windowsPlatform.cpp +++ b/src/windowsPlatform.cpp @@ -14,6 +14,7 @@ #include "deps/UnityResolve/UnityResolve.hpp" #include #include +#include bool mh_inited; extern std::filesystem::path gakumasLocalPath; @@ -326,6 +327,30 @@ namespace GakumasLocal::WinHooks { case WM_CLOSE: { if (g_on_close) g_on_close(); }; break; + case WM_NCHITTEST: + { + POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) }; + ScreenToClient(hWnd, &pt); + RECT rcClient; + GetClientRect(hWnd, &rcClient); + const int borderWidth = 8; // 根据需要调整边缘宽度 + + bool left = pt.x < borderWidth; + bool right = pt.x >= rcClient.right - borderWidth; + bool top = pt.y < borderWidth; + bool bottom = pt.y >= rcClient.bottom - borderWidth; + + if (top && left) return HTTOPLEFT; + if (top && right) return HTTOPRIGHT; + if (bottom && left) return HTBOTTOMLEFT; + if (bottom && right) return HTBOTTOMRIGHT; + if (left) return HTLEFT; + if (right) return HTRIGHT; + if (top) return HTTOP; + if (bottom) return HTBOTTOM; + return HTCLIENT; + } break; + default: break; } @@ -335,6 +360,15 @@ namespace GakumasLocal::WinHooks { void InstallWndProcHook() { g_pfnOldWndProc = (WNDPROC)GetWindowLongPtr(FindWindowW(L"UnityWndClass", L"gakumas"), GWLP_WNDPROC); SetWindowLongPtr(FindWindowW(L"UnityWndClass", L"gakumas"), GWLP_WNDPROC, (LONG_PTR)WndProcCallback); + + HWND hwnd = FindWindowW(L"UnityWndClass", L"gakumas"); + LONG_PTR style = GetWindowLongPtr(hwnd, GWL_STYLE); + // 加上可调整大小、标题栏、系统菜单等样式 + style |= WS_OVERLAPPEDWINDOW; + SetWindowLongPtr(hwnd, GWL_STYLE, style); + // 通知系统样式已改变 + SetWindowPos(hwnd, NULL, 0, 0, 0, 0, + SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED); } void UninstallWndProcHook(HWND hWnd)