1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

Implemented #714 — restart functionality, including quick restart tweak (bound to CTRL+R).

This commit is contained in:
Michał W. Urbańczyk
2012-04-08 03:06:27 +00:00
parent d6223dd137
commit d9064f4f7d
5 changed files with 34 additions and 5 deletions

View File

@ -1484,6 +1484,14 @@ void CAdvMapInt::keyPressed(const SDL_KeyboardEvent & key)
if(isActive())
LOCPLINT->showPuzzleMap();
return;
case SDLK_r:
if(isActive() && LOCPLINT->ctrlPressed())
{
LOCPLINT->showYesNoDialog("Are you sure you want to restart game?", std::vector<CComponent*>(),
[]{ LOCPLINT->sendCustomEvent(RESTART_GAME); },
[]{}, true);
}
return;
case SDLK_SPACE: //space - try to revisit current object with selected hero
{
if(!isActive())