ENSL / NS

Natural Selection mod for Half-life
http://www.unknownworlds.com/ns
GNU General Public License v3.0
42 stars 12 forks source link

Fixed pop-up menu and commander UI cursor centering #133

Closed RGreenlees closed 12 months ago

RGreenlees commented 12 months ago

The pop-up menu and commander UI now centre the mouse cursor when opening, making it less confusing to use.

pierow commented 12 months ago

If we do this it'll fix a bug with showcursor decrementing outside of a useful range when m_rawinput == 0

                    if (this->mFramesSinceEnteredTopdownMode > 2)
                    {
                        // Workaround for not being able to center mouse with raw input enabled.
                        if (CVAR_GET_FLOAT("m_rawinput") != 0)
                        {
                            if (SDL_GetRelativeMouseMode() != SDL_TRUE)
                            {
                                SDL_SetRelativeMouseMode(SDL_TRUE);

                            }
                        }
#ifdef WIN32
                        ShowCursor(TRUE);
#endif
                    }
                    else
                    {
                        this->mFramesSinceEnteredTopdownMode++;
                    }
RGreenlees commented 12 months ago

Thanks Pierow, I've fixed that with a second commit on this PR