Jump to content

Recommended Posts

  • Active+ Member

Required skill level: Begginer

Estimated time of work: 1 minute

Hi everyone,

Because many people from this community have helped me solve lots of issues in the past, today I’m sharing a fix for others. It addresses a frustrating problem caused by many client sources. Let’s get it resolved!

Problem:

After rotating the camera with the middle mouse button:

  • A special cursor (sell or buy in a shop) goes back to the normal cursor, so the sell or buy mode is lost.
  • The monster, NPC or player under the cursor when you release the button becomes your target (a player's menu opens), although you only rotated the camera.

This is the hidden content, please

Warning! Be careful not to copy & paste the code directly, as your syntax might slightly differ.

Success! You're all set. Good luck!

 Notice:

  • No source changes are needed. Only the return in OnMouseMiddleButtonUp is required. The one in OnMouseMiddleButtonDown has no effect and is there for consistency.
  • A plain middle mouse button click without moving the mouse still selects the target.
  • If you used the previous version of this tutorial ENABLE_MOUSE_CURSOR_RESET_FIX, remove it completely - it saved the cursor after it had already been switched to CAMERA_ROTATE and only worked because of the double call.

Sincerely,

ReFresh

Edited by ReFresh
The old fix only worked by accident, the real fix is return True in game.py.
  • Metin2 Dev 94
  • Eyes 2
  • Good 14
  • Love 3
  • Love 28

I'll be always helpful!  😉

Link to comment
https://metin2.dev/topic/33852-mouse-cursor-reset-fix/
Share on other sites

  • 2 weeks later...
  • 4 months later...

Fine did u tried fix mouse wheel focus when u swap window with pressed wheel?

How to reproduce: Open client + another one window (windows manager, empty folder or something) press mouse wheel in game and use alt+tab for swap window.. Now u will be stucked and you must again use alt+tab and go to back into client + bonus  mouse wheel is still pressed.

Link to comment
https://metin2.dev/topic/33852-mouse-cursor-reset-fix/#findComment-173567
Share on other sites

  • 7 months later...

Thanks, a solution is always a solution. Solve it with 100 lines of code or 2 lines of code. It's hard work.

Here's the real solution.

PythonApplicationProcedure.cpp

Search:

case WM_SETCURSOR:

replace:


 

		case WM_SETCURSOR:
		{
			if (LOWORD(lParam) != HTCLIENT)
				break;

			if (m_bCursorVisible && CURSOR_MODE_HARDWARE == m_iCursorMode)
				::SetCursor(static_cast<HCURSOR>(m_hCurrentCursor));
			else
				::SetCursor(nullptr);

			return TRUE;
		}

 

Link to comment
https://metin2.dev/topic/33852-mouse-cursor-reset-fix/#findComment-175979
Share on other sites

  • 2 months later...
  • Active+ Member

#updated the tutorial - replaced the old fix with the real one (return True in game.py, no C++ changes). If you used the old ENABLE_MOUSE_CURSOR_RESET_FIX version, remove it completely. The steps are in the first post.

  • Metin2 Dev 1

I'll be always helpful!  😉

Link to comment
https://metin2.dev/topic/33852-mouse-cursor-reset-fix/#findComment-176684
Share on other sites

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

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.