News about KScoreDialog

Last days I’ve implemented hightscores in KSpiral. But I need a separate hightscore for each level and this isn’t provided by the KScoreDialog. So I patched the dialog.

KScoreDialog with level selection

KScoreDialog with level selection

The image above shows the new KScoreDialog in action. If you want to add a hightscore, you can write: dialog->setLevelName(qMakePair(untranslatedName, translatedName));. Now, the hightscore is saved in the group [KHightScore_Difficulty_MAP:untranslatedName].

To read the hightscore information you have to add the levels you want to show with: dialog->addLocalizedLevelName(qMakePair(..., ...));. It’s also possible to add more then one level at once with addLocalizedLevelNames(QMap(...));.

If you call neither call „addLocalizedLevel{Name,Names}“ nor „setLevelName“ you get the old KScoreDialog (for backward compatibility).

Now I need your point of view. Please look the patch over.



Creative Commons Lizenzvertrag
Dieser Werk bzw. Inhalt ist unter einer Creative Commons-Lizenz lizenziert.

Paperblog :Die besten Artikel aus Blogs

Old but important:

Um neue Beiträge per E-Mail zu erhalten, hier die E-Mail-Adresse eingeben.

Schließe dich 2 Followern an