Merge pull request #46 from rfdomingues98/fix/client-freeze-on-drag
Added Amun fix for window freeze on drag
This commit is contained in:
@@ -13,6 +13,7 @@ This repository contains the source code necessary to compile the game client ex
|
||||
## 📋 Changelog
|
||||
|
||||
### 🐛 Bug Fixes
|
||||
* **Invisibility:** Resolved an issue where effects were not visible after becoming visible again, if they were added in AFFECT_INVISIBILITY state.
|
||||
* **Invisibility:** Resolved an issue where projectile fly effects were visible on targets within AFFECT_INVISIBILITY state.
|
||||
* **Effects on low opacity meshes**: Resolved a conflict between effects on meshes with opacity < 1 and invisibility fixes.
|
||||
* **Amun's freeze on drag window**: Fixed a bug where the client window would freeze while we are dragging it around.
|
||||
* **Debug mode:** Fly effects are now registering when using Debug mode.
|
||||
* **Fix effect rendering in low opacity models:** Effects now appear normally on semi-transparent meshes.
|
||||
* **Fly targeting fixed for buff/healing skills:** Fixed an issue where fly target effect would render in the buffer's selected target even if the target was unbuffable (if viewing from another client).
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -39,7 +39,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();
|
||||
@@ -92,6 +93,8 @@ m_dwLastIdleTime(0)
|
||||
m_iForceSightRange = -1;
|
||||
|
||||
CCameraManager::Instance().AddCamera(EVENT_CAMERA_NUMBER);
|
||||
|
||||
m_InitialMouseMovingPoint = {};
|
||||
}
|
||||
|
||||
CPythonApplication::~CPythonApplication()
|
||||
@@ -806,10 +809,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())
|
||||
|
||||
@@ -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);
|
||||
@@ -436,6 +440,8 @@ class CPythonApplication : public CMSApplication, public CInputKeyboard, public
|
||||
int m_iForceSightRange;
|
||||
|
||||
protected:
|
||||
bool m_IsMovingMainWindow;
|
||||
POINT m_InitialMouseMovingPoint;
|
||||
int m_iCursorNum;
|
||||
int m_iContinuousCursorNum;
|
||||
};
|
||||
|
||||
@@ -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))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user