GameList: Add RegionToFlagFilename function to map regions to flag filenames

Signed-off-by: SternXD <stern@sidestore.io>
This commit is contained in:
SternXD 2025-11-20 19:03:03 -05:00 committed by Ty
parent 359d552245
commit 36ffe3a521
2 changed files with 39 additions and 0 deletions

View File

@ -150,6 +150,44 @@ const char* GameList::RegionToString(Region region, bool translate)
return name; return name;
} }
const char* GameList::RegionToFlagFilename(Region region)
{
static constexpr std::array<const char*, static_cast<int>(Region::Count)> flag_names = {
"br", // NTSC-B
"cn", // NTSC-C
"hk", // NTSC-HK
"jp", // NTSC-J
"kr", // NTSC-K
"tw", // NTSC-T
"us", // NTSC-U
"Other", // Other
"au", // PAL-A
"za", // PAL-AF
"at", // PAL-AU
"be", // PAL-BE
"eu", // PAL-E
"fr", // PAL-F
"fi", // PAL-FI
"de", // PAL-G
"gr", // PAL-GR
"it", // PAL-I
"in", // PAL-IN
"eu", // PAL-M
"nl", // PAL-NL
"no", // PAL-NO
"pt", // PAL-P
"pl", // PAL-PL
"ru", // PAL-R
"es", // PAL-S
"scn", // PAL-SC
"se", // PAL-SW
"ch", // PAL-SWI
"gb", // PAL-UK
};
return flag_names.at(static_cast<int>(region));
}
const char* GameList::EntryCompatibilityRatingToString(CompatibilityRating rating, bool translate) const char* GameList::EntryCompatibilityRatingToString(CompatibilityRating rating, bool translate)
{ {
const char* name = ""; const char* name = "";

View File

@ -106,6 +106,7 @@ namespace GameList
const char* EntryTypeToString(EntryType type, bool translate); const char* EntryTypeToString(EntryType type, bool translate);
const char* RegionToString(Region region, bool translate); const char* RegionToString(Region region, bool translate);
const char* RegionToFlagFilename(Region region);
const char* EntryCompatibilityRatingToString(CompatibilityRating rating, bool translate); const char* EntryCompatibilityRatingToString(CompatibilityRating rating, bool translate);
/// Fills in boot parameters (iso or elf) based on the game list entry. /// Fills in boot parameters (iso or elf) based on the game list entry.