moving part of the constructor to a method for a new derived class

This commit is contained in:
konstin
2014-05-14 20:44:15 +02:00
parent 9d2a075289
commit e981489f06

View File

@@ -67,8 +67,28 @@ GPInfoDialog::GPInfoDialog(const std::string& gp_ident) :
m_irrlicht_window);
title->setTabStop(false);
title->setTextAlignment(EGUIA_CENTER, EGUIA_CENTER);
}
// ----------------------------------------------------------------------------
GPInfoDialog::~GPInfoDialog()
{
// Place focus back on selected GP, in case the dialog was cancelled and we're back to
// the track selection screen after
Screen* curr_screen = GUIEngine::getCurrentScreen();
if (curr_screen->getName() == "tracks.stkgui")
{
((TracksScreen*)curr_screen)->setFocusOnGP(m_gp_ident);
}
}
// ----------------------------------------------------------------------------
void GPInfoDialog::InitAfterDrawingTheHeader(GrandPrixData gp, const float y1,
const float y2,
const std::string& gp_ident)
{
// ---- Track listings
const std::vector<std::string> tracks = gp->getTrackNames();
const int trackAmount = tracks.size();
@@ -185,22 +205,6 @@ GPInfoDialog::GPInfoDialog(const std::string& gp_ident) :
okBtn->setFocusForPlayer( PLAYER_ID_GAME_MASTER );
}
// ----------------------------------------------------------------------------
GPInfoDialog::~GPInfoDialog()
{
// Place focus back on selected GP, in case the dialog was cancelled and we're back to
// the track selection screen after
Screen* curr_screen = GUIEngine::getCurrentScreen();
if (curr_screen->getName() == "tracks.stkgui")
{
((TracksScreen*)curr_screen)->setFocusOnGP(m_gp_ident);
}
}
// ----------------------------------------------------------------------------
void GPInfoDialog::onEnterPressedInternal()
{
// Save the gp identifier, since dismiss will delete this object.