From 2a8d881ef3ddfc771dc1fba09001eee66bf41b8e Mon Sep 17 00:00:00 2001 From: Ricardo Domingues Date: Fri, 26 Dec 2025 19:13:40 +0000 Subject: [PATCH 1/3] Added Amun fix for window freeze on drag --- src/UserInterface/PythonApplication.cpp | 37 +++++++++++++- src/UserInterface/PythonApplication.h | 6 +++ .../PythonApplicationProcedure.cpp | 50 ++++++++++++++++++- 3 files changed, 91 insertions(+), 2 deletions(-) diff --git a/src/UserInterface/PythonApplication.cpp b/src/UserInterface/PythonApplication.cpp index dd694f4..3888762 100644 --- a/src/UserInterface/PythonApplication.cpp +++ b/src/UserInterface/PythonApplication.cpp @@ -37,7 +37,8 @@ m_dwFaceCount(0), m_fGlobalTime(0.0f), m_fGlobalElapsedTime(0.0f), m_dwLButtonDownTime(0), -m_dwLastIdleTime(0) +m_dwLastIdleTime(0), +m_IsMovingMainWindow(false) { #ifndef _DEBUG SetEterExceptionHandler(); @@ -90,6 +91,8 @@ m_dwLastIdleTime(0) m_iForceSightRange = -1; CCameraManager::Instance().AddCamera(EVENT_CAMERA_NUMBER); + + m_InitialMouseMovingPoint = {}; } CPythonApplication::~CPythonApplication() @@ -821,10 +824,42 @@ bool CPythonApplication::CreateDevice(int width, int height, int Windowed, int b } } +void CPythonApplication::SetUserMovingMainWindow(bool flag) +{ + if (flag && !GetCursorPos(&m_InitialMouseMovingPoint)) + return; + + m_IsMovingMainWindow = flag; +} + +bool CPythonApplication::IsUserMovingMainWindow() const +{ + return m_IsMovingMainWindow; +} + +void CPythonApplication::UpdateMainWindowPosition() +{ + POINT finalPoint{}; + if (GetCursorPos(&finalPoint)) + { + LONG xDiff = finalPoint.x - m_InitialMouseMovingPoint.x; + LONG yDiff = finalPoint.y - m_InitialMouseMovingPoint.y; + + RECT r{}; + GetWindowRect(&r); + + SetPosition(r.left + xDiff, r.top + yDiff); + m_InitialMouseMovingPoint = finalPoint; + } +} + void CPythonApplication::Loop() { while (1) { + if (IsUserMovingMainWindow()) + UpdateMainWindowPosition(); + if (IsMessage()) { if (!MessageProcess()) diff --git a/src/UserInterface/PythonApplication.h b/src/UserInterface/PythonApplication.h index c60bc55..c4fe48a 100644 --- a/src/UserInterface/PythonApplication.h +++ b/src/UserInterface/PythonApplication.h @@ -151,6 +151,10 @@ class CPythonApplication : public CMSApplication, public CInputKeyboard, public void Exit(); void Abort(); + bool IsUserMovingMainWindow() const; + void SetUserMovingMainWindow(bool flag); + void UpdateMainWindowPosition(); + void SetMinFog(float fMinFog); void SetFrameSkip(bool isEnable); void SkipRenderBuffering(DWORD dwSleepMSec); @@ -437,6 +441,8 @@ class CPythonApplication : public CMSApplication, public CInputKeyboard, public int m_iForceSightRange; protected: + bool m_IsMovingMainWindow; + POINT m_InitialMouseMovingPoint; int m_iCursorNum; int m_iContinuousCursorNum; }; diff --git a/src/UserInterface/PythonApplicationProcedure.cpp b/src/UserInterface/PythonApplicationProcedure.cpp index 56dbdd4..9212d35 100644 --- a/src/UserInterface/PythonApplicationProcedure.cpp +++ b/src/UserInterface/PythonApplicationProcedure.cpp @@ -79,6 +79,11 @@ LRESULT CPythonApplication::WindowProcedure(HWND hWnd, UINT uiMsg, WPARAM wParam { __MinimizeFullScreenWindow(hWnd, m_dwWidth, m_dwHeight); } + + if (IsUserMovingMainWindow()) + { + SetUserMovingMainWindow(false); + } } } break; @@ -112,6 +117,8 @@ LRESULT CPythonApplication::WindowProcedure(HWND hWnd, UINT uiMsg, WPARAM wParam break; case WM_KEYDOWN: + if (wParam == VK_ESCAPE && IsUserMovingMainWindow()) + SetUserMovingMainWindow(false); OnIMEKeyDown(LOWORD(wParam)); break; @@ -135,6 +142,9 @@ LRESULT CPythonApplication::WindowProcedure(HWND hWnd, UINT uiMsg, WPARAM wParam s_xDownPosition = LOWORD(lParam); s_yDownPosition = HIWORD(lParam); + + if (IsUserMovingMainWindow()) + SetUserMovingMainWindow(false); return 0; case WM_LBUTTONUP: @@ -225,7 +235,45 @@ LRESULT CPythonApplication::WindowProcedure(HWND hWnd, UINT uiMsg, WPARAM wParam OnSizeChange(short(LOWORD(lParam)), short(HIWORD(lParam))); } break; - + case WM_NCLBUTTONDOWN: + { + switch (wParam) + { + case HTMAXBUTTON: + case HTSYSMENU: + return 0; + case HTMINBUTTON: + ShowWindow(hWnd, SW_MINIMIZE); + return 0; + case HTCLOSE: + RunPressExitKey(); + return 0; + case HTCAPTION: + if (!IsUserMovingMainWindow()) + SetUserMovingMainWindow(true); + + return 0; + } + + break; + } + + case WM_NCLBUTTONUP: + { + if (IsUserMovingMainWindow()) + SetUserMovingMainWindow(false); + + break; + } + + case WM_NCRBUTTONDOWN: + case WM_NCRBUTTONUP: + case WM_CONTEXTMENU: + return 0; + case WM_SYSCOMMAND: + if (wParam == SC_KEYMENU) + return 0; + break; case WM_SYSKEYDOWN: switch (LOWORD(wParam)) { From 46f2c9de0fac2f58b9a47947a3f36e40a1b3f1cd Mon Sep 17 00:00:00 2001 From: Ricardo Domingues Date: Fri, 26 Dec 2025 19:18:41 +0000 Subject: [PATCH 2/3] Updated README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 1d1ca5f..4df7326 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ This repository contains the source code necessary to compile the game client ex ## 📋 Changelog ### 🐛 Bug Fixes +* **Amun's freeze on drag window**: Fixed a bug where the client window would freeze while we are dragging it around. * **Shaman Mounted Combat:** Fixed a bug that wrongly calculated Shaman characters mounted hits that didn't collide with the target to cause damage when attack speed was had an extremely high value. * **Invisibility VFX Logic:** Fixed an issue where skill visual effects remained visible to the character while under the `AFFECT_INVISIBLE` state. * **Buff Effects Visibility Recovery:** Fixed an issue where buff skill visual effects remained invisible if the skill was cast while the character was under the `AFFECT_INVISIBLE` state. From 96876420d151f174e82f16d0dc4d13bd20262ff0 Mon Sep 17 00:00:00 2001 From: Ricardo Domingues Date: Tue, 30 Dec 2025 17:37:42 +0000 Subject: [PATCH 3/3] Increased horse rotation speed --- src/UserInterface/InstanceBase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/UserInterface/InstanceBase.cpp b/src/UserInterface/InstanceBase.cpp index ca9205d..8d53629 100644 --- a/src/UserInterface/InstanceBase.cpp +++ b/src/UserInterface/InstanceBase.cpp @@ -15,7 +15,7 @@ BOOL HAIR_COLOR_ENABLE=FALSE; BOOL USE_ARMOR_SPECULAR=FALSE; BOOL RIDE_HORSE_ENABLE=TRUE; const float c_fDefaultRotationSpeed = 1200.0f; -const float c_fDefaultHorseRotationSpeed = 300.0f; +const float c_fDefaultHorseRotationSpeed = 1800.0f; bool IsWall(unsigned race)