Disable mouse input affecting the menu when the console is down. This code is awful, because I am an awful man.

git-svn-id: https://svn.eduke32.com/eduke32@4906 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2015-01-12 01:54:18 +00:00
parent 130244a302
commit 0b1433b07c
3 changed files with 11 additions and 5 deletions

View File

@ -128,7 +128,7 @@ int32_t readmouseabsxy(vec2_t * const destination, vec2_t const * const source)
{
int32_t xwidth;
if (!moustat || !mouseinwindow)
if (!moustat || !appactive || !mouseinwindow || osd && osd->flags & OSD_CAPTURE)
return 0;
xwidth = max(scale(240<<16, xdim, ydim), 320<<16);
@ -141,7 +141,7 @@ int32_t readmouseabsxy(vec2_t * const destination, vec2_t const * const source)
void readmousebstatus(int32_t *b)
{
if (!moustat || !appactive || !mouseinwindow) { *b = 0; return; }
if (!moustat || !appactive || !mouseinwindow || osd && osd->flags & OSD_CAPTURE) { *b = 0; return; }
*b = mouseb;
}

View File

@ -814,9 +814,13 @@ void grabmouse(char a)
void AppGrabMouse(char a)
{
grabmouse(a);
AppMouseGrab = mousegrab;
SDL_ShowCursor(SDL_DISABLE);
if (!(a & 2))
{
grabmouse(a);
AppMouseGrab = mousegrab;
}
SDL_ShowCursor((osd && osd->flags & OSD_CAPTURE) ? SDL_ENABLE : SDL_DISABLE);
}
//

View File

@ -127,6 +127,8 @@ void GAME_onshowosd(int32_t shown)
{
G_UpdateScreenArea();
AppGrabMouse(!shown | 2);
osdshown = shown;
// XXX: it's weird to fake a keypress like this.