|
|
@ -116,6 +116,25 @@ void GameWidget::getMoves(int moves)
|
|
|
|
ys->setText(current);
|
|
|
|
ys->setText(current);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void GameWidget::mergeHighScores(int l)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
KConfigGroup oldConfig(kapp->config(), QString("High Scores Level %1").arg(l).utf8());
|
|
|
|
|
|
|
|
KConfigGroup newConfig(kapp->config(), QString("Highscores Level %1").arg(l).utf8());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
newConfig.writeEntry("LastPlayer", oldConfig.readEntry("LastPlayer"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QString num;
|
|
|
|
|
|
|
|
for (int i = 1; i <= 10; ++i)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
num.setNum(i);
|
|
|
|
|
|
|
|
QString key = "Pos" + num + "Name";
|
|
|
|
|
|
|
|
newConfig.writeEntry(key, oldConfig.readEntry(key, "-"));
|
|
|
|
|
|
|
|
key = "Pos" + num + "Score";
|
|
|
|
|
|
|
|
newConfig.writeEntry(key, oldConfig.readEntry(key, "-"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
kapp->config()->sync();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void GameWidget::updateLevel (int l)
|
|
|
|
void GameWidget::updateLevel (int l)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
level=l;
|
|
|
|
level=l;
|
|
|
@ -128,7 +147,11 @@ void GameWidget::updateLevel (int l)
|
|
|
|
cfg.setGroup("Level");
|
|
|
|
cfg.setGroup("Level");
|
|
|
|
feld->load(cfg);
|
|
|
|
feld->load(cfg);
|
|
|
|
|
|
|
|
|
|
|
|
highScore->setConfigGroup(QString("High Scores Level %1").arg(level));
|
|
|
|
if (!kapp->config()->hasGroup(QString("Highscores Level %1").arg(level)) &&
|
|
|
|
|
|
|
|
kapp->config()->hasGroup(QString("High Scores Level %1").arg(level)))
|
|
|
|
|
|
|
|
mergeHighScores(level);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
highScore->setConfigGroup(QString("Highscores Level %1").arg(level));
|
|
|
|
highest.setNum(highScore->highScore());
|
|
|
|
highest.setNum(highScore->highScore());
|
|
|
|
|
|
|
|
|
|
|
|
if (highest != "0" ) hs->setText(highest);
|
|
|
|
if (highest != "0" ) hs->setText(highest);
|
|
|
|