1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-13 01:20:34 +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

@ -3684,7 +3684,10 @@ CSystemOptionsWindow::CSystemOptionsWindow(const SDL_Rect &Pos, CPlayerInterface
save->swappedImages = true;
save->update();
// restart = new CAdventureMapButton (CGI->generaltexth->zelp[323].first, CGI->generaltexth->zelp[323].second, boost::bind(&CSystemOptionsWindow::bmainmenuf, this), pos.x+346, pos.y+357, "SORSTRT", SDLK_r);
restart = new CAdventureMapButton (CGI->generaltexth->zelp[323].first, CGI->generaltexth->zelp[323].second,
boost::bind(&CSystemOptionsWindow::brestartf, this), 246, 357, "SORSTRT", SDLK_r);
restart->swappedImages = true;
restart->update();
mainMenu = new CAdventureMapButton (CGI->generaltexth->zelp[320].first, CGI->generaltexth->zelp[320].second,
boost::bind(&CSystemOptionsWindow::bmainmenuf, this), 357, 357, "SOMAIN.DEF", SDLK_m);
@ -3821,7 +3824,7 @@ void CSystemOptionsWindow::breturnf()
void CSystemOptionsWindow::bmainmenuf()
{
LOCPLINT->showYesNoDialog(CGI->generaltexth->allTexts[578], std::vector<CComponent*>(), boost::bind(&CSystemOptionsWindow::pushSDLEvent, this, SDL_USEREVENT, 2), 0, false);
LOCPLINT->showYesNoDialog(CGI->generaltexth->allTexts[578], std::vector<CComponent*>(), boost::bind(&CSystemOptionsWindow::pushSDLEvent, this, SDL_USEREVENT, RETURN_TO_MAIN_MENU), 0, false);
}
void CSystemOptionsWindow::bsavef()
@ -3830,6 +3833,11 @@ void CSystemOptionsWindow::bsavef()
GH.pushInt(new CSavingScreen(CPlayerInterface::howManyPeople > 1));
}
void CSystemOptionsWindow::brestartf()
{
LOCPLINT->showYesNoDialog(CGI->generaltexth->allTexts[578], std::vector<CComponent*>(), boost::bind(&CSystemOptionsWindow::pushSDLEvent, this, SDL_USEREVENT, RESTART_GAME), 0, false);
}
CTavernWindow::CTavernWindow(const CGObjectInstance *TavernObj)
: tavernObj(TavernObj)
{