Use English game title when available.
This commit is contained in:
parent
9ccdbb2153
commit
4ce43369a7
|
@ -677,7 +677,12 @@ X_STATUS Emulator::CompleteLaunch(const std::filesystem::path& path,
|
|||
kernel::util::XdbfGameData db(
|
||||
module->memory()->TranslateVirtual(resource_data), resource_size);
|
||||
if (db.is_valid()) {
|
||||
game_title_ = db.title();
|
||||
// TODO(gibbed): get title respective to user locale.
|
||||
game_title_ = db.title(kernel::util::XdbfLocale::kEnglish);
|
||||
if (game_title_.empty()) {
|
||||
// If English title is unavailable, get the title in default locale.
|
||||
game_title_ = db.title();
|
||||
}
|
||||
auto icon_block = db.icon();
|
||||
if (icon_block) {
|
||||
display_window_->SetIcon(icon_block.buffer, icon_block.size);
|
||||
|
|
|
@ -102,6 +102,10 @@ std::string XdbfGameData::title() const {
|
|||
return GetStringTableEntry(default_language(), kXdbfIdTitle);
|
||||
}
|
||||
|
||||
std::string XdbfGameData::title(XdbfLocale locale) const {
|
||||
return GetStringTableEntry(locale, kXdbfIdTitle);
|
||||
}
|
||||
|
||||
} // namespace util
|
||||
} // namespace kernel
|
||||
} // namespace xe
|
||||
|
|
|
@ -137,6 +137,8 @@ class XdbfGameData : public XdbfWrapper {
|
|||
|
||||
// The game's title in its default language.
|
||||
std::string title() const;
|
||||
|
||||
std::string title(XdbfLocale locale) const;
|
||||
};
|
||||
|
||||
} // namespace util
|
||||
|
|
Loading…
Reference in New Issue