remember high score initials for next session

This commit is contained in:
Thomas Jentzsch 2020-02-26 16:47:16 +01:00
parent 34586be8ff
commit 906d0b169c
2 changed files with 7 additions and 0 deletions

View File

@ -153,6 +153,7 @@ Settings::Settings()
setPermanent("threads", "false");
setTemporary("romloadcount", "0");
setTemporary("maxres", "");
setPermanent("initials", "");
#ifdef DEBUGGER_SUPPORT
// Debugger/disassembly options

View File

@ -203,6 +203,10 @@ void HighScoresDialog::loadConfig()
myVariationPopup->setEnabled(instance().highScores().numVariations() > 1);
if(myInitials.empty())
// load initials from last session
myInitials = instance().settings().getString("initials");
string label = " " + instance().highScores().specialLabel();
if (label.length() > 5)
label = label.substr(label.length() - 5);
@ -234,6 +238,8 @@ void HighScoresDialog::saveConfig()
{
myInitials = myEditNameWidgets[myHighScoreRank]->getText();
myNames[myHighScoreRank] = myInitials;
// remember initials for next session
instance().settings().setValue("initials", myInitials);
}
// save selected variation
saveHighScores(myVariation);