Merge branch 'feature-highscores' of https://github.com/stella-emu/stella into feature-highscores

This commit is contained in:
Thomas Jentzsch 2020-03-03 11:29:18 +01:00
commit db415d0eb9
3 changed files with 19 additions and 9 deletions

View File

@ -541,10 +541,14 @@ string HighScoresManager::fromPropString(const string& text) const
}
// some ugly formatting
char first = result[0];
result = BSPF::toLowerCase(result);
result[0] = first;
if(result.length())
{
char first = result[0];
result = BSPF::toLowerCase(result);
result[0] = first;
}
return result;
// remove leading spaces (especially for empty values)
size_t start = result.find_first_not_of(" ");
return (start == std::string::npos) ? "" : result.substr(start);
}

View File

@ -807,11 +807,14 @@ void GameInfoDialog::loadHighScoresProperties(const Properties& props)
mySpecialAddress->setText(ss.str());
for (uInt32 a = 0; a < instance().highScores().numAddrBytes(info.numDigits, info.trailingZeroes); ++a)
for (uInt32 a = 0; a < HSM::MAX_SCORE_ADDR; ++a)
{
ss.str("");
ss << hex << right //<< setw(HSM::MAX_ADDR_CHARS) << setfill(' ')
<< uppercase << info.scoreAddr[a];
if(a < instance().highScores().numAddrBytes(info.numDigits, info.trailingZeroes))
{
ss << hex << right //<< setw(HSM::MAX_ADDR_CHARS) << setfill(' ')
<< uppercase << info.scoreAddr[a];
}
myScoreAddress[a]->setText(ss.str());
}
updateHighScoresWidgets();

View File

@ -212,7 +212,10 @@ void HighScoresDialog::loadConfig()
label = label.substr(label.length() - 5);
mySpecialLabelWidget->setLabel(label);
myNotesWidget->setLabel("Note: " + instance().highScores().notes());
if(!instance().highScores().notes().empty())
myNotesWidget->setLabel("Note: " + instance().highScores().notes());
else
myNotesWidget->setLabel("");
if (instance().hasConsole())
myMD5 = instance().console().properties().get(PropType::Cart_MD5);