Merge branch 'wad_gamenames'

This commit is contained in:
LPFaint99 2013-09-15 21:38:31 -07:00
commit a7e1fb81b1
4 changed files with 72 additions and 55 deletions

View File

@ -145,6 +145,7 @@ std::vector<std::string> CBannerLoaderGC::GetDescriptions()
desc_count = 1; desc_count = 1;
break; break;
// English, German, French, Spanish, Italian, Dutch
case CBannerLoaderGC::BANNER_BNR2: case CBannerLoaderGC::BANNER_BNR2:
desc_count = 6; desc_count = 6;
break; break;

View File

@ -62,23 +62,24 @@ static int CompareGameListItems(const GameListItem* iso1, const GameListItem* is
int indexOne = 0; int indexOne = 0;
int indexOther = 0; int indexOther = 0;
switch (iso1->GetCountry())
// index only matters for WADS and PAL GC games, but invalid indicies for the others
// will return the (only) language in the list
if (iso1->GetPlatform() == GameListItem::WII_WAD)
{ {
case DiscIO::IVolume::COUNTRY_JAPAN: indexOne = SConfig::GetInstance().m_SYSCONF->GetData<u8>("IPL.LNG");
case DiscIO::IVolume::COUNTRY_USA: }
indexOne = 0; else
break; { // GC
default:
indexOne = SConfig::GetInstance().m_LocalCoreStartupParameter.SelectedLanguage; indexOne = SConfig::GetInstance().m_LocalCoreStartupParameter.SelectedLanguage;
} }
switch (iso2->GetCountry()) if (iso2->GetPlatform() == GameListItem::WII_WAD)
{ {
case DiscIO::IVolume::COUNTRY_JAPAN: indexOther = SConfig::GetInstance().m_SYSCONF->GetData<u8>("IPL.LNG");
case DiscIO::IVolume::COUNTRY_USA: }
indexOther = 0; else
break; { // GC
default:
indexOther = SConfig::GetInstance().m_LocalCoreStartupParameter.SelectedLanguage; indexOther = SConfig::GetInstance().m_LocalCoreStartupParameter.SelectedLanguage;
} }
@ -410,19 +411,9 @@ void CGameListCtrl::InsertItemInReportView(long _Index)
int SelectedLanguage = SConfig::GetInstance().m_LocalCoreStartupParameter.SelectedLanguage; int SelectedLanguage = SConfig::GetInstance().m_LocalCoreStartupParameter.SelectedLanguage;
// Is this sane? // Is this sane?
switch (rISOFile.GetCountry()) if (rISOFile.GetPlatform() == GameListItem::WII_WAD)
{ {
case DiscIO::IVolume::COUNTRY_TAIWAN: SelectedLanguage = SConfig::GetInstance().m_SYSCONF->GetData<u8>("IPL.LNG");
case DiscIO::IVolume::COUNTRY_JAPAN:
SelectedLanguage = -1;
break;
case DiscIO::IVolume::COUNTRY_USA:
SelectedLanguage = 0;
break;
default:
break;
} }
std::string const name = rISOFile.GetName(SelectedLanguage); std::string const name = rISOFile.GetName(SelectedLanguage);

View File

@ -78,6 +78,7 @@ GameListItem::GameListItem(const std::string& _rFileName)
{ {
if (pBannerLoader->IsValid()) if (pBannerLoader->IsValid())
{ {
if (m_Platform != WII_WAD)
m_names = pBannerLoader->GetNames(); m_names = pBannerLoader->GetNames();
m_company = pBannerLoader->GetCompany(); m_company = pBannerLoader->GetCompany();
m_descriptions = pBannerLoader->GetDescriptions(); m_descriptions = pBannerLoader->GetDescriptions();

View File

@ -75,7 +75,9 @@ CISOProperties::CISOProperties(const std::string fileName, wxWindow* parent, wxW
{ {
// Load ISO data // Load ISO data
OpenISO = DiscIO::CreateVolumeFromFilename(fileName); OpenISO = DiscIO::CreateVolumeFromFilename(fileName);
if (DiscIO::IsVolumeWiiDisc(OpenISO)) bool IsWad = DiscIO::IsVolumeWadFile(OpenISO);
bool IsWiiDisc = DiscIO::IsVolumeWiiDisc(OpenISO);
if (IsWiiDisc)
{ {
for (u32 i = 0; i < 0xFFFFFFFF; i++) // yes, technically there can be OVER NINE THOUSAND partitions... for (u32 i = 0; i < 0xFFFFFFFF; i++) // yes, technically there can be OVER NINE THOUSAND partitions...
{ {
@ -97,7 +99,7 @@ CISOProperties::CISOProperties(const std::string fileName, wxWindow* parent, wxW
else else
{ {
// TODO : Should we add a way to browse the wad file ? // TODO : Should we add a way to browse the wad file ?
if (!DiscIO::IsVolumeWadFile(OpenISO)) if (!IsWad)
{ {
GCFiles.clear(); GCFiles.clear();
pFileSystem = DiscIO::CreateFileSystem(OpenISO); pFileSystem = DiscIO::CreateFileSystem(OpenISO);
@ -132,7 +134,7 @@ CISOProperties::CISOProperties(const std::string fileName, wxWindow* parent, wxW
bRefreshList = false; bRefreshList = false;
CreateGUIControls(DiscIO::IsVolumeWadFile(OpenISO)); CreateGUIControls(IsWad);
LoadGameConfig(); LoadGameConfig();
@ -156,21 +158,33 @@ CISOProperties::CISOProperties(const std::string fileName, wxWindow* parent, wxW
break; break;
case DiscIO::IVolume::COUNTRY_USA: case DiscIO::IVolume::COUNTRY_USA:
m_Country->SetValue(_("USA")); m_Country->SetValue(_("USA"));
if (!IsWad) // For (non wad) NTSC Games, there's no multi lang
{
m_Lang->SetSelection(0); m_Lang->SetSelection(0);
m_Lang->Disable(); // For NTSC Games, there's no multi lang m_Lang->Disable();
}
break; break;
case DiscIO::IVolume::COUNTRY_JAPAN: case DiscIO::IVolume::COUNTRY_JAPAN:
m_Country->SetValue(_("JAPAN")); m_Country->SetValue(_("JAPAN"));
m_Lang->SetSelection(-1); if (!IsWad) // For (non wad) NTSC Games, there's no multi lang
m_Lang->Disable(); // For NTSC Games, there's no multi lang {
m_Lang->Insert(_("Japanese"), 0);
m_Lang->SetSelection(0);
m_Lang->Disable();
}
break; break;
case DiscIO::IVolume::COUNTRY_KOREA: case DiscIO::IVolume::COUNTRY_KOREA:
m_Country->SetValue(_("KOREA")); m_Country->SetValue(_("KOREA"));
break; break;
case DiscIO::IVolume::COUNTRY_TAIWAN: case DiscIO::IVolume::COUNTRY_TAIWAN:
m_Country->SetValue(_("TAIWAN")); m_Country->SetValue(_("TAIWAN"));
m_Lang->SetSelection(-1); if (!IsWad) // For (non wad) NTSC Games, there's no multi lang
m_Lang->Disable(); // For NTSC Games, there's no multi lang {
m_Lang->Insert(_("TAIWAN"), 0);
m_Lang->SetSelection(0);
m_Lang->Disable();
}
break; break;
case DiscIO::IVolume::COUNTRY_SDK: case DiscIO::IVolume::COUNTRY_SDK:
m_Country->SetValue(_("No Country (SDK)")); m_Country->SetValue(_("No Country (SDK)"));
@ -179,6 +193,13 @@ CISOProperties::CISOProperties(const std::string fileName, wxWindow* parent, wxW
m_Country->SetValue(_("UNKNOWN")); m_Country->SetValue(_("UNKNOWN"));
break; break;
} }
if (IsWiiDisc) // Only one language with wii banners
{
m_Lang->SetSelection(0);
m_Lang->Disable();
}
wxString temp = _T("0x") + StrToWxStr(OpenISO->GetMakerID()); wxString temp = _T("0x") + StrToWxStr(OpenISO->GetMakerID());
m_MakerID->SetValue(temp); m_MakerID->SetValue(temp);
m_Revision->SetValue(wxString::Format(wxT("%u"), OpenISO->GetRevision())); m_Revision->SetValue(wxString::Format(wxT("%u"), OpenISO->GetRevision()));
@ -186,7 +207,15 @@ CISOProperties::CISOProperties(const std::string fileName, wxWindow* parent, wxW
m_FST->SetValue(wxString::Format(wxT("%u"), OpenISO->GetFSTSize())); m_FST->SetValue(wxString::Format(wxT("%u"), OpenISO->GetFSTSize()));
// Here we set all the info to be shown (be it SJIS or Ascii) + we set the window title // Here we set all the info to be shown (be it SJIS or Ascii) + we set the window title
if (!IsWad)
{
ChangeBannerDetails((int)SConfig::GetInstance().m_LocalCoreStartupParameter.SelectedLanguage); ChangeBannerDetails((int)SConfig::GetInstance().m_LocalCoreStartupParameter.SelectedLanguage);
}
else
{
ChangeBannerDetails(SConfig::GetInstance().m_SYSCONF->GetData<u8>("IPL.LNG"));
}
m_Banner->SetBitmap(OpenGameListItem->GetImage()); m_Banner->SetBitmap(OpenGameListItem->GetImage());
m_Banner->Bind(wxEVT_RIGHT_DOWN, &CISOProperties::RightClickOnBanner, this); m_Banner->Bind(wxEVT_RIGHT_DOWN, &CISOProperties::RightClickOnBanner, this);
@ -480,8 +509,19 @@ void CISOProperties::CreateGUIControls(bool IsWad)
arrayStringFor_Lang.Add(_("Spanish")); arrayStringFor_Lang.Add(_("Spanish"));
arrayStringFor_Lang.Add(_("Italian")); arrayStringFor_Lang.Add(_("Italian"));
arrayStringFor_Lang.Add(_("Dutch")); arrayStringFor_Lang.Add(_("Dutch"));
int language = (int)SConfig::GetInstance().m_LocalCoreStartupParameter.SelectedLanguage;
if (IsWad)
{
arrayStringFor_Lang.Insert(_("Japanese"), 0);
arrayStringFor_Lang.Add(_("Simplified Chinese"));
arrayStringFor_Lang.Add(_("Traditional Chinese"));
arrayStringFor_Lang.Add(_("Korean"));
language = SConfig::GetInstance().m_SYSCONF->GetData<u8>("IPL.LNG");
}
m_Lang = new wxChoice(m_Information, ID_LANG, wxDefaultPosition, wxDefaultSize, arrayStringFor_Lang); m_Lang = new wxChoice(m_Information, ID_LANG, wxDefaultPosition, wxDefaultSize, arrayStringFor_Lang);
m_Lang->SetSelection((int)SConfig::GetInstance().m_LocalCoreStartupParameter.SelectedLanguage); m_Lang->SetSelection(language);
wxStaticText * const m_ShortText = new wxStaticText(m_Information, wxID_ANY, _("Short Name:")); wxStaticText * const m_ShortText = new wxStaticText(m_Information, wxID_ANY, _("Short Name:"));
m_ShortName = new wxTextCtrl(m_Information, ID_SHORTNAME, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY); m_ShortName = new wxTextCtrl(m_Information, ID_SHORTNAME, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY);
wxStaticText * const m_MakerText = new wxStaticText(m_Information, wxID_ANY, _("Maker:")); wxStaticText * const m_MakerText = new wxStaticText(m_Information, wxID_ANY, _("Maker:"));
@ -1348,23 +1388,7 @@ void CISOProperties::OnChangeBannerLang(wxCommandEvent& event)
void CISOProperties::ChangeBannerDetails(int lang) void CISOProperties::ChangeBannerDetails(int lang)
{ {
// why? wxString const shortName = StrToWxStr(OpenGameListItem->GetName(lang));
switch (OpenGameListItem->GetCountry())
{
case DiscIO::IVolume::COUNTRY_TAIWAN:
case DiscIO::IVolume::COUNTRY_JAPAN:
lang = -1;
break;
case DiscIO::IVolume::COUNTRY_USA:
lang = 0;
break;
default:
break;
}
wxString const shortName = StrToWxStr(OpenGameListItem->GetBannerName(lang));
wxString const comment = StrToWxStr(OpenGameListItem->GetDescription(lang)); wxString const comment = StrToWxStr(OpenGameListItem->GetDescription(lang));
wxString const maker = StrToWxStr(OpenGameListItem->GetCompany()); wxString const maker = StrToWxStr(OpenGameListItem->GetCompany());