Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak mouse cursor startup behaviour #2855

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

lopezloo
Copy link
Member

@lopezloo lopezloo commented Dec 28, 2022

This PR:

  • Disables rendering of MTA (CEGUI) cursor during game startup (because it's frozen anyway).
  • Disables changing system cursor position to the center on game startup if game is being launched in windowed mode or user has multiple monitors and full screen minimize is disabled (it's annoying).
  • Enables rendering of system cursor within MTA window during game startup if game is being launched in windowed mode or user has multiple monitors and full screen minimize is disabled (feels less claustrophobic this way).
  • Removes some strange undocumented condition from CLocalGUI::InputGoesToGUI().

At first I wanted to disable this centering and show system mouse cursor only when game is being launched in windowed mode. But then I started testing it more and it feels right on fullscreen mode too to me. I literally feels less claustrophobic this way to me. You see your cursor and you can switch to other screen for example while this initial credits screen is showing. Games usually don't do that so we can discuss but for me - it simply feels good.

(startup in this context means initial SA credits screen technically)

@lopezloo lopezloo added the enhancement New feature or request label Dec 28, 2022
@patrikjuvonen
Copy link
Contributor

From what I understand cursor centering is useful in fullscreen because sometimes on multi-display setups your cursor is "stuck" somewhere outside the game and if you click once you'll end up having to alt-tab back into the game, so it prevents that back and forth. For windowed mode this is less of a problem.

@turret001
Copy link
Member

I'm not sure if this is considered offtopic but as a user, I don't really care where my mouse is when I launch the game. Centering it automatically feels very restrict-y and makes me feel like I'm being trapped in a Chinese finger lock.

@PlatinMTA
Copy link
Contributor

can't really tell what's the benefit considering I always play on windowed mode

Comment on lines -751 to +746
SetCursorPos(m_StoredMousePosition.x, m_StoredMousePosition.y);
if (m_StoredMousePosition.x != -1 && m_StoredMousePosition.y != -1)
SetCursorPos(m_StoredMousePosition.x, m_StoredMousePosition.y);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this is what reverts the cursor to its original position when you toggle showCursor while ingame?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most likely.

@lopezloo lopezloo marked this pull request as draft February 23, 2023 16:35
@lopezloo
Copy link
Member Author

lopezloo commented May 23, 2023

I have tweaked it now to show system cursor and do not center cursor only if game is being launched in windowed mode or user has multiple monitors and full screen minimize is disabled. It basically ensures that clicking outside game window won't minimize the game.

Things which remains controversial is the removal of one check from CLocalGUI::InputGoesToGUI(). It was required to make this PR work. I haven't found any issues with that but there may be though.

@lopezloo lopezloo marked this pull request as ready for review May 23, 2023 22:24
@lopezloo
Copy link
Member Author

By the way, even in current Windows 10 update screen (fullscreen) cursor is visible and unlocked. And it feels great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants