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:
selectWidget("resume", "inBattle");
show = SHOW_MENU;
SDL_SetWindowGrab(app.window, 0);
break;
case SHOW_MENU:
show = SHOW_BATTLE;
SDL_SetWindowGrab(app.window, 1);
break;
case SHOW_OBJECTIVES:
show = SHOW_BATTLE;
SDL_SetWindowGrab(app.window, 1);
break;
}
@ -321,18 +324,24 @@ static void handleKeyboard(void)
battle.status = MS_PAUSED;
selectWidget("ok", "startBattle");
SDL_SetWindowGrab(app.window, 0);
}
}
static void start(void)
{
battle.status = MS_IN_PROGRESS;
SDL_SetWindowGrab(app.window, 1);
}
static void resume(void)
{
show = SHOW_BATTLE;
SDL_SetWindowGrab(app.window, 1);
clearInput();
}