Simplify ghost replay screen
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user