mirror of https://github.com/stella-emu/stella.git
remember high score initials for next session
This commit is contained in:
parent
34586be8ff
commit
906d0b169c
|
@ -153,6 +153,7 @@ Settings::Settings()
|
||||||
setPermanent("threads", "false");
|
setPermanent("threads", "false");
|
||||||
setTemporary("romloadcount", "0");
|
setTemporary("romloadcount", "0");
|
||||||
setTemporary("maxres", "");
|
setTemporary("maxres", "");
|
||||||
|
setPermanent("initials", "");
|
||||||
|
|
||||||
#ifdef DEBUGGER_SUPPORT
|
#ifdef DEBUGGER_SUPPORT
|
||||||
// Debugger/disassembly options
|
// Debugger/disassembly options
|
||||||
|
|
|
@ -203,6 +203,10 @@ void HighScoresDialog::loadConfig()
|
||||||
|
|
||||||
myVariationPopup->setEnabled(instance().highScores().numVariations() > 1);
|
myVariationPopup->setEnabled(instance().highScores().numVariations() > 1);
|
||||||
|
|
||||||
|
if(myInitials.empty())
|
||||||
|
// load initials from last session
|
||||||
|
myInitials = instance().settings().getString("initials");
|
||||||
|
|
||||||
string label = " " + instance().highScores().specialLabel();
|
string label = " " + instance().highScores().specialLabel();
|
||||||
if (label.length() > 5)
|
if (label.length() > 5)
|
||||||
label = label.substr(label.length() - 5);
|
label = label.substr(label.length() - 5);
|
||||||
|
@ -234,6 +238,8 @@ void HighScoresDialog::saveConfig()
|
||||||
{
|
{
|
||||||
myInitials = myEditNameWidgets[myHighScoreRank]->getText();
|
myInitials = myEditNameWidgets[myHighScoreRank]->getText();
|
||||||
myNames[myHighScoreRank] = myInitials;
|
myNames[myHighScoreRank] = myInitials;
|
||||||
|
// remember initials for next session
|
||||||
|
instance().settings().setValue("initials", myInitials);
|
||||||
}
|
}
|
||||||
// save selected variation
|
// save selected variation
|
||||||
saveHighScores(myVariation);
|
saveHighScores(myVariation);
|
||||||
|
|
Loading…
Reference in New Issue