Change: Move baseset missing/corrupted files label to list item. (#11455)

This allows any baseset error to be displayed in the drop down list so it is more easily visible, and avoids wasted space in the layout.
This commit is contained in:
Peter Nelson
2023-11-10 12:25:56 +00:00
committed by GitHub
parent 1071acb483
commit bd2ddb07ca
5 changed files with 24 additions and 48 deletions

View File

@@ -121,6 +121,21 @@ struct BaseSet {
return this->description.at(std::string{});
}
/**
* Get string to use when listing this set in the settings window.
* If there are no invalid files, then this is just the set name,
* otherwise a string is formatted including the number of invalid files.
* @return the string to display.
*/
std::string GetListLabel() const
{
if (this->GetNumInvalid() == 0) return this->name;
SetDParamStr(0, this->name);
SetDParam(1, this->GetNumInvalid());
return GetString(STR_BASESET_STATUS);
}
/**
* Calculate and check the MD5 hash of the supplied file.
* @param file The file get the hash of.