mirror of
https://github.com/cemu-project/Cemu.git
synced 2024-11-26 11:04:18 +01:00
Fix various issues related to title names (#192)
Fixed various issues related to title names: 1. If console language is set to non-English, the title names in Title Manager may be empty. 2. Game list do not show custom names if list style set to icon or small icon. 3. Custom title names for some languages (like JP or CN) appear confusing if re-edited. 4. Unexpected overrides of variable values in ParsedMetaXml.h
This commit is contained in:
parent
b752d2eddd
commit
4d1be950e3
@ -18,12 +18,12 @@ struct ParsedMetaXml
|
|||||||
|
|
||||||
std::string GetShortName(CafeConsoleLanguage languageId) const
|
std::string GetShortName(CafeConsoleLanguage languageId) const
|
||||||
{
|
{
|
||||||
return m_short_name[(size_t)languageId];
|
return m_short_name[(size_t)languageId].empty() ? m_short_name[(size_t)CafeConsoleLanguage::EN] : m_short_name[(size_t)languageId];
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string GetLongName(CafeConsoleLanguage languageId) const
|
std::string GetLongName(CafeConsoleLanguage languageId) const
|
||||||
{
|
{
|
||||||
return m_long_name[(size_t)languageId];
|
return m_long_name[(size_t)languageId].empty() ? m_long_name[(size_t)CafeConsoleLanguage::EN] : m_long_name[(size_t)languageId];
|
||||||
}
|
}
|
||||||
|
|
||||||
TitleId GetTitleId() const
|
TitleId GetTitleId() const
|
||||||
@ -134,7 +134,7 @@ private:
|
|||||||
else if (language == "ru")
|
else if (language == "ru")
|
||||||
return (sint32)CafeConsoleLanguage::RU;
|
return (sint32)CafeConsoleLanguage::RU;
|
||||||
else if (language == "zht")
|
else if (language == "zht")
|
||||||
return (sint32)CafeConsoleLanguage::ZH;
|
return (sint32)CafeConsoleLanguage::TW; // if return ZH here, xxx_zht values may cover xxx_zh values in function Parse()
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -536,7 +536,7 @@ void wxGameList::OnContextMenuSelected(wxCommandEvent& event)
|
|||||||
std::string customName = "";
|
std::string customName = "";
|
||||||
if (!GetConfig().GetGameListCustomName(title_id, customName))
|
if (!GetConfig().GetGameListCustomName(title_id, customName))
|
||||||
customName.clear();
|
customName.clear();
|
||||||
wxTextEntryDialog dialog(this, wxEmptyString, L"Enter a custom game title", customName);
|
wxTextEntryDialog dialog(this, wxEmptyString, _("Enter a custom game title"), wxHelper::FromUtf8(customName));
|
||||||
if(dialog.ShowModal() == wxID_OK)
|
if(dialog.ShowModal() == wxID_OK)
|
||||||
{
|
{
|
||||||
const auto custom_name = dialog.GetValue();
|
const auto custom_name = dialog.GetValue();
|
||||||
@ -859,7 +859,7 @@ void wxGameList::OnGameEntryUpdatedByTitleId(wxTitleIdEvent& event)
|
|||||||
if(index == wxNOT_FOUND)
|
if(index == wxNOT_FOUND)
|
||||||
{
|
{
|
||||||
// entry doesn't exist
|
// entry doesn't exist
|
||||||
index = InsertItem(FindInsertPosition(baseTitleId), wxHelper::FromUtf8(gameInfo.GetTitleName()));
|
index = InsertItem(FindInsertPosition(baseTitleId), wxHelper::FromUtf8(GetNameByTitleId(baseTitleId)));
|
||||||
SetItemPtrData(index, baseTitleId);
|
SetItemPtrData(index, baseTitleId);
|
||||||
isNewEntry = true;
|
isNewEntry = true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user