Jump to content
metin2dev
  • 0
Sign in to follow this  
Abel(Tiger)

[c++] Fix camera when minimize client

Question

An annoying bug which need a fix.

#PythonApplicationProcedure.cpp
//Search this function:
void CPythonApplication::__MinimizeFullScreenWindow(HWND hWnd, DWORD dwWidth, DWORD dwHeight)
{
	ChangeDisplaySettings(0, 0);
	SetWindowPos(hWnd, 0, 0, 0,
				 dwWidth,
				 dwHeight,
				 SWP_SHOWWINDOW);
	ShowWindow(hWnd, SW_MINIMIZE);
}
//Add after:
void CPythonApplication::__ResetCameraWhenMinimize()
{
	CCameraManager& rkCmrMgr=CCameraManager::Instance();
	CCamera* pkCmrCur=rkCmrMgr.GetCurrentCamera();
	if (pkCmrCur) 
	{
		pkCmrCur->EndDrag();
	}
	
	SetCursorNum(NORMAL);
	if ( CURSOR_MODE_HARDWARE == GetCursorMode())
		SetCursorVisible(TRUE);
}

//Search:
					if (m_isWindowFullScreenEnable)
					{
						__MinimizeFullScreenWindow(hWnd, m_dwWidth, m_dwHeight);
					}
//Replace with:
					if (m_isWindowFullScreenEnable)
					{
						__MinimizeFullScreenWindow(hWnd, m_dwWidth, m_dwHeight);
						__ResetCameraWhenMinimize();
					}
					else
					{
						__ResetCameraWhenMinimize();
					}
#PythonApplication.h
//Search:
		void __MinimizeFullScreenWindow(HWND hWnd, DWORD dwWidth, DWORD dwHeight);
//Add after:
		void __ResetCameraWhenMinimize();

 

 

  • Like 11

Share this post


Link to post
Share on other sites

18 answers to this question

Recommended Posts

  • 0

When you move camera and minimize client in the same time mouse remains blocked and you need to maximize client , stop move camera and minimize again .

Share this post


Link to post
Share on other sites
  • 0
2 minutes ago, Abel(Tiger) said:

When you move camera and minimize client in the same time mouse remains blocked and you need to maximize client , stop move camera and minimize again .

thank you baba 

Share this post


Link to post
Share on other sites
  • 0
5 minutes ago, ѕeмa™ said:

db1258c3801207dc8f1ff5b15d25d1c0.gifIs this what u mean?

right click, alt+tab change window and try to move the mouse  .

I know , but not all players know alt+tab.

Share this post


Link to post
Share on other sites
  • 0
1 minute ago, Abel(Tiger) said:

I know , but not all players know alt+tab.

but as u can see in my image, i dont have full screen, that fix will work for alt+tab too?

Share this post


Link to post
Share on other sites
  • 0
2 minutes ago, ѕeмa™ said:

but as u can see in my image, i dont have full screen, that fix will work for alt+tab too?

Is the same thing dude , when you leave aplication with camera active she just stop .

Share this post


Link to post
Share on other sites
  • 0
On 8/27/2017 at 8:41 PM, lordsas61 said:

this guy is right ,  this fix creates an error which execute when you exit the game . and it only happens if you're still on the game .

 

the ??????????????? ???? error thing pops up . 

 

its not a big deal but yeah its not also a proper fix . 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×