Implemented .elf and .dol support in gamelist
Fixed a TON of structuring, formatting. removed README.txt files from themes at MaJoR's request Added platform icon for ELFs/DOLs
This commit is contained in:
parent
d96be9250c
commit
faedf1bc5c
Binary file not shown.
After Width: | Height: | Size: 278 B |
|
@ -1,3 +0,0 @@
|
|||
By Michael "MaJoR" Roesch of the Dolphin team
|
||||
|
||||
dolphin-emu.org
|
Binary file not shown.
After Width: | Height: | Size: 278 B |
|
@ -1,3 +0,0 @@
|
|||
By Michael "MaJoR" Roesch of the Dolphin team
|
||||
|
||||
dolphin-emu.org
|
Binary file not shown.
After Width: | Height: | Size: 278 B |
|
@ -1,3 +0,0 @@
|
|||
By Michael "MaJoR" Roesch of the Dolphin team
|
||||
|
||||
dolphin-emu.org
|
Binary file not shown.
After Width: | Height: | Size: 278 B |
|
@ -1,3 +0,0 @@
|
|||
By Michael "MaJoR" Roesch of the Dolphin team
|
||||
|
||||
dolphin-emu.org
|
Binary file not shown.
After Width: | Height: | Size: 278 B |
|
@ -185,6 +185,7 @@ void SConfig::SaveGameListSettings(IniFile& ini)
|
|||
|
||||
gamelist->Set("ListDrives", m_ListDrives);
|
||||
gamelist->Set("ListWad", m_ListWad);
|
||||
gamelist->Set("ListElfDol", m_ListElfDol);
|
||||
gamelist->Set("ListWii", m_ListWii);
|
||||
gamelist->Set("ListGC", m_ListGC);
|
||||
gamelist->Set("ListJap", m_ListJap);
|
||||
|
@ -430,6 +431,7 @@ void SConfig::LoadGameListSettings(IniFile& ini)
|
|||
|
||||
gamelist->Get("ListDrives", &m_ListDrives, false);
|
||||
gamelist->Get("ListWad", &m_ListWad, true);
|
||||
gamelist->Get("ListElfDol", &m_ListElfDol, true);
|
||||
gamelist->Get("ListWii", &m_ListWii, true);
|
||||
gamelist->Get("ListGC", &m_ListGC, true);
|
||||
gamelist->Get("ListJap", &m_ListJap, true);
|
||||
|
|
|
@ -207,6 +207,7 @@ struct SConfig : NonCopyable
|
|||
|
||||
bool m_ListDrives;
|
||||
bool m_ListWad;
|
||||
bool m_ListElfDol;
|
||||
bool m_ListWii;
|
||||
bool m_ListGC;
|
||||
bool m_ListPal;
|
||||
|
|
|
@ -24,6 +24,7 @@ public:
|
|||
GAMECUBE_DISC = 0,
|
||||
WII_DISC,
|
||||
WII_WAD,
|
||||
ELF_DOL,
|
||||
NUMBER_OF_PLATFORMS
|
||||
};
|
||||
|
||||
|
|
|
@ -308,6 +308,8 @@ wxMenuBar* CFrame::CreateMenu()
|
|||
platformMenu->Check(IDM_LIST_GC, SConfig::GetInstance().m_ListGC);
|
||||
platformMenu->AppendCheckItem(IDM_LIST_WAD, _("Show Wad"));
|
||||
platformMenu->Check(IDM_LIST_WAD, SConfig::GetInstance().m_ListWad);
|
||||
platformMenu->AppendCheckItem(IDM_LIST_ELFDOL, _("Show Elf/Dol"));
|
||||
platformMenu->Check(IDM_LIST_ELFDOL, SConfig::GetInstance().m_ListElfDol);
|
||||
|
||||
wxMenu *regionMenu = new wxMenu;
|
||||
viewMenu->AppendSubMenu(regionMenu, _("Show Regions"));
|
||||
|
@ -1905,6 +1907,9 @@ void CFrame::GameListChanged(wxCommandEvent& event)
|
|||
case IDM_LIST_WAD:
|
||||
SConfig::GetInstance().m_ListWad = event.IsChecked();
|
||||
break;
|
||||
case IDM_LIST_ELFDOL:
|
||||
SConfig::GetInstance().m_ListElfDol = event.IsChecked();
|
||||
break;
|
||||
case IDM_LIST_JAP:
|
||||
SConfig::GetInstance().m_ListJap = event.IsChecked();
|
||||
break;
|
||||
|
|
|
@ -197,10 +197,11 @@ void CGameListCtrl::InitBitmaps()
|
|||
m_FlagImageIndex[DiscIO::IVolume::COUNTRY_WORLD] = m_imageListSmall->Add(wxBitmap(Flag_Europe_xpm)); // Uses European flag as a placeholder
|
||||
m_FlagImageIndex[DiscIO::IVolume::COUNTRY_UNKNOWN] = m_imageListSmall->Add(wxBitmap(Flag_Unknown_xpm));
|
||||
|
||||
m_PlatformImageIndex.resize(3);
|
||||
m_PlatformImageIndex.resize(4);
|
||||
m_PlatformImageIndex[0] = m_imageListSmall->Add(wxBitmap(Platform_Gamecube_xpm));
|
||||
m_PlatformImageIndex[1] = m_imageListSmall->Add(wxBitmap(Platform_Wii_xpm));
|
||||
m_PlatformImageIndex[2] = m_imageListSmall->Add(wxBitmap(Platform_Wad_xpm));
|
||||
m_PlatformImageIndex[3] = m_imageListSmall->Add(wxBitmap(StrToWxStr(File::GetThemeDir(SConfig::GetInstance().theme_name) + "fileplatform.png"), wxBITMAP_TYPE_PNG));
|
||||
|
||||
m_EmuStateImageIndex.resize(6);
|
||||
m_EmuStateImageIndex[0] = m_imageListSmall->Add(wxBitmap(rating_0));
|
||||
|
@ -482,6 +483,11 @@ void CGameListCtrl::ScanForISOs()
|
|||
}
|
||||
if (SConfig::GetInstance().m_ListWad)
|
||||
Extensions.push_back("*.wad");
|
||||
if (SConfig::GetInstance().m_ListElfDol)
|
||||
{
|
||||
Extensions.push_back("*.dol");
|
||||
Extensions.push_back("*.elf");
|
||||
}
|
||||
|
||||
auto rFilenames = DoFileSearch(Extensions, SConfig::GetInstance().m_ISOFolder, SConfig::GetInstance().m_RecursiveISOFolder);
|
||||
|
||||
|
@ -837,26 +843,31 @@ void CGameListCtrl::OnRightClick(wxMouseEvent& event)
|
|||
if (selected_iso)
|
||||
{
|
||||
wxMenu popupMenu;
|
||||
popupMenu.Append(IDM_PROPERTIES, _("&Properties"));
|
||||
popupMenu.Append(IDM_GAME_WIKI, _("&Wiki"));
|
||||
popupMenu.AppendSeparator();
|
||||
|
||||
if (selected_iso->GetPlatform() != DiscIO::IVolume::GAMECUBE_DISC)
|
||||
if (!selected_iso->IsElfOrDol())
|
||||
{
|
||||
popupMenu.Append(IDM_PROPERTIES, _("&Properties"));
|
||||
popupMenu.Append(IDM_GAME_WIKI, _("&Wiki"));
|
||||
popupMenu.AppendSeparator();
|
||||
}
|
||||
if (selected_iso->GetPlatform() != DiscIO::IVolume::GAMECUBE_DISC && !selected_iso->IsElfOrDol())
|
||||
{
|
||||
popupMenu.Append(IDM_OPEN_SAVE_FOLDER, _("Open Wii &save folder"));
|
||||
popupMenu.Append(IDM_EXPORT_SAVE, _("Export Wii save (Experimental)"));
|
||||
}
|
||||
popupMenu.Append(IDM_OPEN_CONTAINING_FOLDER, _("Open &containing folder"));
|
||||
popupMenu.AppendCheckItem(IDM_SET_DEFAULT_ISO, _("Set as &default ISO"));
|
||||
|
||||
if (!selected_iso->IsElfOrDol())
|
||||
popupMenu.AppendCheckItem(IDM_SET_DEFAULT_ISO, _("Set as &default ISO"));
|
||||
|
||||
// First we have to decide a starting value when we append it
|
||||
if (selected_iso->GetFileName() == SConfig::GetInstance().m_strDefaultISO)
|
||||
popupMenu.FindItem(IDM_SET_DEFAULT_ISO)->Check();
|
||||
|
||||
popupMenu.AppendSeparator();
|
||||
popupMenu.Append(IDM_DELETE_ISO, _("&Delete ISO..."));
|
||||
popupMenu.Append(IDM_DELETE_ISO, _("&Delete File..."));
|
||||
|
||||
if (selected_iso->GetPlatform() != DiscIO::IVolume::WII_WAD)
|
||||
if (selected_iso->GetPlatform() != DiscIO::IVolume::WII_WAD && !selected_iso->IsElfOrDol())
|
||||
{
|
||||
if (selected_iso->IsCompressed())
|
||||
popupMenu.Append(IDM_COMPRESS_ISO, _("Decompress ISO..."));
|
||||
|
@ -864,7 +875,7 @@ void CGameListCtrl::OnRightClick(wxMouseEvent& event)
|
|||
selected_iso->GetFileName().substr(selected_iso->GetFileName().find_last_of(".")) != ".wbfs")
|
||||
popupMenu.Append(IDM_COMPRESS_ISO, _("Compress ISO..."));
|
||||
}
|
||||
else
|
||||
else if (!selected_iso->IsElfOrDol())
|
||||
{
|
||||
popupMenu.Append(IDM_LIST_INSTALL_WAD, _("Install to Wii Menu"));
|
||||
}
|
||||
|
|
|
@ -133,6 +133,7 @@ enum
|
|||
IDM_LIST_WAD,
|
||||
IDM_LIST_WII,
|
||||
IDM_LIST_GC,
|
||||
IDM_LIST_ELFDOL,
|
||||
IDM_LIST_JAP,
|
||||
IDM_LIST_PAL,
|
||||
IDM_LIST_USA,
|
||||
|
|
|
@ -66,10 +66,12 @@ GameListItem::GameListItem(const std::string& _rFileName)
|
|||
, m_emu_state(0)
|
||||
, m_FileSize(0)
|
||||
, m_Revision(0)
|
||||
, m_Country(DiscIO::IVolume::COUNTRY_UNKNOWN)
|
||||
, m_Valid(false)
|
||||
, m_BlobCompressed(false)
|
||||
, m_ImageWidth(0)
|
||||
, m_ImageHeight(0)
|
||||
, m_disc_number(0)
|
||||
{
|
||||
if (LoadFromCache())
|
||||
{
|
||||
|
@ -129,6 +131,13 @@ GameListItem::GameListItem(const std::string& _rFileName)
|
|||
ini.GetIfExists("EmuState", "EmulationIssues", &m_issues);
|
||||
}
|
||||
|
||||
if (!IsValid() && IsElfOrDol())
|
||||
{
|
||||
m_Valid = true;
|
||||
m_FileSize = File::GetSize(_rFileName);
|
||||
m_Platform = DiscIO::IVolume::ELF_DOL;
|
||||
}
|
||||
|
||||
if (!m_pImage.empty())
|
||||
{
|
||||
wxImage Image(m_ImageWidth, m_ImageHeight, &m_pImage[0], true);
|
||||
|
@ -238,8 +247,11 @@ std::string GameListItem::GetName() const
|
|||
std::string name = GetName(SConfig::GetInstance().GetCurrentLanguage(wii));
|
||||
if (name.empty())
|
||||
{
|
||||
std::string ext;
|
||||
|
||||
// No usable name, return filename (better than nothing)
|
||||
SplitPath(GetFileName(), nullptr, &name, nullptr);
|
||||
SplitPath(GetFileName(), nullptr, &name, &ext);
|
||||
return name + ext;
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
@ -283,3 +295,18 @@ const std::string GameListItem::GetWiiFSPath() const
|
|||
return ret;
|
||||
}
|
||||
|
||||
bool GameListItem::IsElfOrDol() const
|
||||
{
|
||||
const std::string name = GetName();
|
||||
const size_t pos = name.rfind('.');
|
||||
|
||||
if (pos != std::string::npos)
|
||||
{
|
||||
std::string ext = name.substr(pos);
|
||||
std::transform(ext.begin(), ext.end(), ext.begin(), ::tolower);
|
||||
|
||||
return ext == ".elf" ||
|
||||
ext == ".dol";
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -42,7 +42,9 @@ public:
|
|||
u64 GetFileSize() const {return m_FileSize;}
|
||||
u64 GetVolumeSize() const {return m_VolumeSize;}
|
||||
// 0 is the first disc, 1 is the second disc
|
||||
u8 GetDiscNumber() const {return m_disc_number;}
|
||||
u8 GetDiscNumber() const { return m_disc_number; }
|
||||
bool IsElfOrDol() const;
|
||||
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
const wxBitmap& GetBitmap() const {return m_Bitmap;}
|
||||
#endif
|
||||
|
|
|
@ -75,7 +75,13 @@ static std::string BuildGameName(const GameListItem& game)
|
|||
if (game.GetRevision() != 0)
|
||||
return name + " (" + game.GetUniqueID() + ", Revision " + std::to_string((long long)game.GetRevision()) + ")";
|
||||
else
|
||||
{
|
||||
if (game.GetUniqueID().empty())
|
||||
{
|
||||
return game.GetName();
|
||||
}
|
||||
return name + " (" + game.GetUniqueID() + ")";
|
||||
}
|
||||
}
|
||||
|
||||
void NetPlayDialog::FillWithGameNames(wxListBox* game_lbox, const CGameListCtrl& game_list)
|
||||
|
|
Loading…
Reference in New Issue