Grab mouse when in battle.

This commit is contained in:
Steve 2016-08-11 22:47:51 +01:00
parent 3aad3142ac
commit 2471cd0814
1 changed files with 9 additions and 0 deletions

View File

@ -300,14 +300,17 @@ static void handleKeyboard(void)
case SHOW_OPTIONS: case SHOW_OPTIONS:
selectWidget("resume", "inBattle"); selectWidget("resume", "inBattle");
show = SHOW_MENU; show = SHOW_MENU;
SDL_SetWindowGrab(app.window, 0);
break; break;
case SHOW_MENU: case SHOW_MENU:
show = SHOW_BATTLE; show = SHOW_BATTLE;
SDL_SetWindowGrab(app.window, 1);
break; break;
case SHOW_OBJECTIVES: case SHOW_OBJECTIVES:
show = SHOW_BATTLE; show = SHOW_BATTLE;
SDL_SetWindowGrab(app.window, 1);
break; break;
} }
@ -321,17 +324,23 @@ static void handleKeyboard(void)
battle.status = MS_PAUSED; battle.status = MS_PAUSED;
selectWidget("ok", "startBattle"); selectWidget("ok", "startBattle");
SDL_SetWindowGrab(app.window, 0);
} }
} }
static void start(void) static void start(void)
{ {
battle.status = MS_IN_PROGRESS; battle.status = MS_IN_PROGRESS;
SDL_SetWindowGrab(app.window, 1);
} }
static void resume(void) static void resume(void)
{ {
show = SHOW_BATTLE; show = SHOW_BATTLE;
SDL_SetWindowGrab(app.window, 1);
clearInput(); clearInput();
} }