Simplify ghost replay screen

This commit is contained in:
Benau
2016-03-21 15:18:47 +08:00
parent ee4c4bd962
commit 8df9ff2cd8
3 changed files with 6 additions and 28 deletions

View File

@@ -95,9 +95,6 @@ GUIEngine::EventPropagation
race_manager->setReverseTrack(reverse);
dynamic_cast<GhostReplaySelection*>(GUIEngine::getCurrentScreen())
->setConfirmReplay();
if (race_manager->isWatchingReplay())
race_manager->startWatchingReplay(track_name, laps);
else

View File

@@ -35,8 +35,6 @@ DEFINE_SCREEN_SINGLETON( GhostReplaySelection );
GhostReplaySelection::GhostReplaySelection() : Screen("ghost_replay_selection.stkgui")
{
m_sort_desc = true;
m_go_recording_ghost = false;
m_choose_replay = false;
} // GhostReplaySelection
// ----------------------------------------------------------------------------
@@ -146,7 +144,7 @@ void GhostReplaySelection::eventCallback(GUIEngine::Widget* widget,
} // click on replay file
else if (name == "record-ghost")
{
m_go_recording_ghost = true;
race_manager->setRecordRace(true);
TracksScreen::getInstance()->setOfficalTrack(false);
TracksScreen::getInstance()->push();
}
@@ -209,24 +207,11 @@ void GhostReplaySelection::onColumnClicked(int column_id)
} // onColumnClicked
// ----------------------------------------------------------------------------
void GhostReplaySelection::tearDown()
bool GhostReplaySelection::onEscapePressed()
{
if (m_go_recording_ghost)
{
m_go_recording_ghost = false;
race_manager->setRecordRace(true);
return;
}
if (m_choose_replay)
{
m_choose_replay = false;
return;
}
// Reset them when leave this screen normally (not from dialog)
m_go_recording_ghost = false;
// Reset it when leave this screen
race_manager->setRecordRace(false);
} // tearDown
return true;
} // onEscapePressed
// ----------------------------------------------------------------------------

View File

@@ -44,8 +44,6 @@ private:
GUIEngine::ListWidget* m_replay_list_widget;
std::string m_file_to_be_deleted;
bool m_sort_desc;
bool m_go_recording_ghost;
bool m_choose_replay;
public:
@@ -56,8 +54,6 @@ public:
void onDeleteReplay(std::string& filename);
void setConfirmReplay() { m_choose_replay = true; }
/** \brief implement callback from parent class GUIEngine::Screen */
virtual void loadedFromFile() OVERRIDE;
@@ -72,7 +68,7 @@ public:
virtual void init() OVERRIDE;
virtual void tearDown() OVERRIDE;
virtual bool onEscapePressed() OVERRIDE;
/** \brief Implement IConfirmDialogListener callback */
virtual void onConfirm() OVERRIDE;