Jump to content
×
×
  • Create New...

Fix Camera when Minimize Client


Recommended Posts

An annoying bug which need a fix.

Gif with the problem (from ѕeмa™) 

Hidden Content

    Give reaction to this post to see the hidden content.

// PythonApplicationProcedure.cpp
// After:
					if (m_isWindowFullScreenEnable)
					{
						__MinimizeFullScreenWindow(hWnd, m_dwWidth, m_dwHeight);
					}
// Just add:
					OnMouseMiddleButtonUp(0, 0);

 

Edited by Abel(Tiger)
  • Metin2 Dev 16
  • Love 26
  • Love 1
  • Good 4
  • Troll 1
Link to comment
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 

Link to comment
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 .

Link to comment
  • 7 months later...
  • 4 weeks later...
  • 4 months later...
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 . 

Link to comment
  • 2 months later...
  • 8 months later...
  • 2 years later...

I am reviving this discussion to say, yeah this just causes a crash during the closing of the client. I was trying to finally tackle all the .dmp files generated and everytime they pointed to "SetCursorNum".

a2qby8l.png

 

As I fix, I did something a little bit dirty but effective.

in PythonApplicationCursor.cpp, in the function bool CPythonApplication::CreateCursors(), under:

m_bLiarCursorOn = false;

add:

m_bCursorsDestroyed = false;

 

at the end of the function void CPythonApplication::DestroyCursors(), add:

m_bCursorsDestroyed = true;

 

then modify the void CPythonApplication::__ResetCameraWhenMinimize() like this:

void CPythonApplication::__ResetCameraWhenMinimize()
{
	CCameraManager& rkCmrMgr = CCameraManager::Instance();
	CCamera* pkCmrCur = rkCmrMgr.GetCurrentCamera();
	if (pkCmrCur)
	{
		pkCmrCur->EndDrag();
	}
	if(!m_bCursorsDestroyed)
	{
		SetCursorNum(NORMAL);
		if (CURSOR_MODE_HARDWARE == GetCursorMode())
			SetCursorVisible(TRUE);
	}
}

and finally declare m_bCursorsDestroyed in PythonApplication.h under m_bCursorVisible:

NcvwlLF.png

 

 

Result:

 

daCRM8f.png

Edited by xXIntelXx
and -> under
Link to comment
Just now, ReFresh said:

You mean under DestroyCursor((HCURSOR) itor->second);?

Yeah, outside the for loop of course:

void CPythonApplication::DestroyCursors()
{
	TCursorHandleMap::iterator itor;
	for (itor = m_CursorHandleMap.begin(); itor != m_CursorHandleMap.end(); ++itor)
	{
		DestroyCursor((HCURSOR) itor->second);
	}
	m_bCursorsDestroyed = true;
}

 

Link to comment

The tutorial is very old 😅

New tutorial:

// PythonApplicationProcedure.cpp
// After:
					if (m_isWindowFullScreenEnable)
					{
						__MinimizeFullScreenWindow(hWnd, m_dwWidth, m_dwHeight);
					}
// Just add:
					OnMouseMiddleButtonUp(0, 0);

That's all! 😬

  • Love 2
  • Good 1
Link to comment

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


Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.