Commit c98ab601 authored by Stephan Kulow's avatar Stephan Kulow
Browse files

indicate game over in always displaying the highscores

svn path=/trunk/KDE/kdegames/klines/; revision=639619
parent f25aaf61
......@@ -123,8 +123,8 @@ void KLinesMainWindow::gameOver(int score)
{
KScoreDialog d(KScoreDialog::Name | KScoreDialog::Score, this);
KScoreDialog::FieldInfo scoreInfo;
if (d.addScore(score, scoreInfo, true))
d.exec();
d.addScore(score, scoreInfo, true);
d.exec();
}
void KLinesMainWindow::viewHighScore()
......
......@@ -307,10 +307,14 @@ void KLinesScene::bornAnimFinished()
// And because of that we check for gameOver in removeAnimFinished()
// rather than here - there's a chance that searchAndErase() will remove
// balls making some free cells to play in
searchAndErase();
if (!searchAndErase() && m_numFreeCells == 0)
{
kDebug() << "GAME OVER" << endl;
emit gameOver(m_score);
}
}
void KLinesScene::searchAndErase()
bool KLinesScene::searchAndErase()
{
// FIXME dimsuz: put more comments about bounds in for loops
......@@ -427,6 +431,7 @@ void KLinesScene::searchAndErase()
// after it finishes slot removeAnimFinished() will be called
// if m_itemsToDelete is empty removeAnimFinished() will be called immediately
m_animator->animateRemove( m_itemsToDelete );
return !m_itemsToDelete.isEmpty();
}
void KLinesScene::moveFocusLeft()
......
......@@ -136,7 +136,7 @@ private:
/**
* Searches for 5 or more balls in a row and deletes them from field
*/
void searchAndErase();
bool searchAndErase();
/**
* This function takes one of two actions:
* If there's a ball at fpos, it will be selected.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment