mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 05:47:56 -07:00
Merge pull request #435 from YourGamesBeOver/master
Options for selecting which columns are visible in the game list.
This commit is contained in:
commit
b780ef950c
@ -226,6 +226,16 @@ void SConfig::SaveSettings()
|
||||
ini.Set("GameList", "ListSort", m_ListSort);
|
||||
ini.Set("GameList", "ListSortSecondary", m_ListSort2);
|
||||
|
||||
ini.Set("GameList", "ColorCompressed", m_ColorCompressed);
|
||||
|
||||
ini.Set("GameList", "ColumnPlatform", m_showSystemColumn);
|
||||
ini.Set("GameList", "ColumnBanner", m_showBannerColumn);
|
||||
ini.Set("GameList", "ColumnNotes", m_showNotesColumn);
|
||||
ini.Set("GameList", "ColumnID", m_showIDColumn);
|
||||
ini.Set("GameList", "ColumnRegion", m_showRegionColumn);
|
||||
ini.Set("GameList", "ColumnSize", m_showSizeColumn);
|
||||
ini.Set("GameList", "ColumnState", m_showStateColumn);
|
||||
|
||||
// Core
|
||||
ini.Set("Core", "HLE_BS2", m_LocalCoreStartupParameter.bHLE_BS2);
|
||||
ini.Set("Core", "CPUCore", m_LocalCoreStartupParameter.iCPUCore);
|
||||
@ -376,6 +386,18 @@ void SConfig::LoadSettings()
|
||||
ini.Get("GameList", "ListSort", &m_ListSort, 3);
|
||||
ini.Get("GameList", "ListSortSecondary",&m_ListSort2, 0);
|
||||
|
||||
// Determines if compressed games display in blue
|
||||
ini.Get("GameList", "ColorCompressed", &m_ColorCompressed, true);
|
||||
|
||||
// Gamelist columns toggles
|
||||
ini.Get("GameList", "ColumnPlatform", &m_showSystemColumn, true);
|
||||
ini.Get("GameList", "ColumnBanner", &m_showBannerColumn, true);
|
||||
ini.Get("GameList", "ColumnNotes", &m_showNotesColumn, true);
|
||||
ini.Get("GameList", "ColumnID", &m_showIDColumn, false);
|
||||
ini.Get("GameList", "ColumnRegion", &m_showRegionColumn, true);
|
||||
ini.Get("GameList", "ColumnSize", &m_showSizeColumn, true);
|
||||
ini.Get("GameList", "ColumnState", &m_showStateColumn, true);
|
||||
|
||||
// Core
|
||||
ini.Get("Core", "HLE_BS2", &m_LocalCoreStartupParameter.bHLE_BS2, false);
|
||||
#ifdef _M_X86
|
||||
|
@ -72,6 +72,18 @@ struct SConfig : NonCopyable
|
||||
int m_ListSort;
|
||||
int m_ListSort2;
|
||||
|
||||
// Game list column toggles
|
||||
bool m_showSystemColumn;
|
||||
bool m_showBannerColumn;
|
||||
bool m_showNotesColumn;
|
||||
bool m_showIDColumn;
|
||||
bool m_showRegionColumn;
|
||||
bool m_showSizeColumn;
|
||||
bool m_showStateColumn;
|
||||
|
||||
// Toggles whether compressed titles show up in blue in the game list
|
||||
bool m_ColorCompressed;
|
||||
|
||||
std::string m_WirelessMac;
|
||||
bool m_PauseMovie;
|
||||
bool m_ShowLag;
|
||||
|
@ -248,6 +248,7 @@ EVT_MENU(IDM_TOGGLE_SKIPIDLE, CFrame::OnToggleSkipIdle)
|
||||
EVT_MENU(IDM_TOGGLE_TOOLBAR, CFrame::OnToggleToolbar)
|
||||
EVT_MENU(IDM_TOGGLE_STATUSBAR, CFrame::OnToggleStatusbar)
|
||||
EVT_MENU_RANGE(IDM_LOGWINDOW, IDM_VIDEOWINDOW, CFrame::OnToggleWindow)
|
||||
EVT_MENU_RANGE(IDM_SHOW_SYSTEM, IDM_SHOW_STATE, CFrame::OnChangeColumnsVisible)
|
||||
|
||||
EVT_MENU(IDM_PURGECACHE, CFrame::GameListChanged)
|
||||
|
||||
|
@ -343,6 +343,7 @@ private:
|
||||
void OnRenderParentResize(wxSizeEvent& event);
|
||||
bool RendererIsFullscreen();
|
||||
void StartGame(const std::string& filename);
|
||||
void OnChangeColumnsVisible(wxCommandEvent& event);
|
||||
|
||||
// Event table
|
||||
DECLARE_EVENT_TABLE();
|
||||
|
@ -318,6 +318,26 @@ void CFrame::CreateMenu()
|
||||
viewMenu->AppendCheckItem(IDM_LISTDRIVES, _("Show Drives"));
|
||||
viewMenu->Check(IDM_LISTDRIVES, SConfig::GetInstance().m_ListDrives);
|
||||
viewMenu->Append(IDM_PURGECACHE, _("Purge Cache"));
|
||||
|
||||
wxMenu *columnsMenu = new wxMenu;
|
||||
viewMenu->AppendSubMenu(columnsMenu, _("Select Columns"));
|
||||
columnsMenu->AppendCheckItem(IDM_SHOW_SYSTEM, _("Platform"));
|
||||
columnsMenu->Check(IDM_SHOW_SYSTEM, SConfig::GetInstance().m_showSystemColumn);
|
||||
columnsMenu->AppendCheckItem(IDM_SHOW_BANNER, _("Banner"));
|
||||
columnsMenu->Check(IDM_SHOW_BANNER, SConfig::GetInstance().m_showBannerColumn);
|
||||
columnsMenu->AppendCheckItem(IDM_SHOW_NOTES, _("Notes"));
|
||||
columnsMenu->Check(IDM_SHOW_NOTES, SConfig::GetInstance().m_showNotesColumn);
|
||||
columnsMenu->AppendCheckItem(IDM_SHOW_ID, _("Game ID"));
|
||||
columnsMenu->Check(IDM_SHOW_ID, SConfig::GetInstance().m_showIDColumn);
|
||||
columnsMenu->AppendCheckItem(IDM_SHOW_REGION, _("Region"));
|
||||
columnsMenu->Check(IDM_SHOW_REGION, SConfig::GetInstance().m_showRegionColumn);
|
||||
columnsMenu->AppendCheckItem(IDM_SHOW_SIZE, _("File size"));
|
||||
columnsMenu->Check(IDM_SHOW_SIZE, SConfig::GetInstance().m_showSizeColumn);
|
||||
columnsMenu->AppendCheckItem(IDM_SHOW_STATE, _("State"));
|
||||
columnsMenu->Check(IDM_SHOW_STATE, SConfig::GetInstance().m_showStateColumn);
|
||||
|
||||
|
||||
|
||||
m_MenuBar->Append(viewMenu, _("&View"));
|
||||
|
||||
if (g_pCodeWindow)
|
||||
@ -1884,3 +1904,34 @@ void CFrame::OnToggleStatusbar(wxCommandEvent& event)
|
||||
|
||||
this->SendSizeEvent();
|
||||
}
|
||||
|
||||
void CFrame::OnChangeColumnsVisible(wxCommandEvent& event)
|
||||
{
|
||||
switch (event.GetId())
|
||||
{
|
||||
case IDM_SHOW_SYSTEM:
|
||||
SConfig::GetInstance().m_showSystemColumn = !SConfig::GetInstance().m_showSystemColumn;
|
||||
break;
|
||||
case IDM_SHOW_BANNER:
|
||||
SConfig::GetInstance().m_showBannerColumn = !SConfig::GetInstance().m_showBannerColumn;
|
||||
break;
|
||||
case IDM_SHOW_NOTES:
|
||||
SConfig::GetInstance().m_showNotesColumn = !SConfig::GetInstance().m_showNotesColumn;
|
||||
break;
|
||||
case IDM_SHOW_ID:
|
||||
SConfig::GetInstance().m_showIDColumn = !SConfig::GetInstance().m_showIDColumn;
|
||||
break;
|
||||
case IDM_SHOW_REGION:
|
||||
SConfig::GetInstance().m_showRegionColumn = !SConfig::GetInstance().m_showRegionColumn;
|
||||
break;
|
||||
case IDM_SHOW_SIZE:
|
||||
SConfig::GetInstance().m_showSizeColumn = !SConfig::GetInstance().m_showSizeColumn;
|
||||
break;
|
||||
case IDM_SHOW_STATE:
|
||||
SConfig::GetInstance().m_showStateColumn = !SConfig::GetInstance().m_showStateColumn;
|
||||
break;
|
||||
default: return;
|
||||
}
|
||||
m_GameListCtrl->Update();
|
||||
SConfig::GetInstance().SaveSettings();
|
||||
}
|
||||
|
@ -143,6 +143,8 @@ static int CompareGameListItems(const GameListItem* iso1, const GameListItem* is
|
||||
iso2->GetCompany() : iso2->GetDescription(indexOther);
|
||||
return strcasecmp(cmp1.c_str(), cmp2.c_str()) * t;
|
||||
}
|
||||
case CGameListCtrl::COLUMN_ID:
|
||||
return strcasecmp(iso1->GetUniqueID().c_str(), iso2->GetUniqueID().c_str()) * t;
|
||||
case CGameListCtrl::COLUMN_COUNTRY:
|
||||
if (iso1->GetCountry() > iso2->GetCountry())
|
||||
return 1 * t;
|
||||
@ -317,6 +319,7 @@ void CGameListCtrl::Update()
|
||||
// wii titles We show in the same column : company for GC games and
|
||||
// description for wii/wad games
|
||||
InsertColumn(COLUMN_NOTES, _("Notes"));
|
||||
InsertColumn(COLUMN_ID, _("ID"));
|
||||
InsertColumn(COLUMN_COUNTRY, "");
|
||||
InsertColumn(COLUMN_SIZE, _("Size"));
|
||||
InsertColumn(COLUMN_EMULATION_STATE, _("State"));
|
||||
@ -329,18 +332,19 @@ void CGameListCtrl::Update()
|
||||
|
||||
// set initial sizes for columns
|
||||
SetColumnWidth(COLUMN_DUMMY,0);
|
||||
SetColumnWidth(COLUMN_PLATFORM, 35 + platform_padding);
|
||||
SetColumnWidth(COLUMN_BANNER, 96 + platform_padding);
|
||||
SetColumnWidth(COLUMN_TITLE, 200 + platform_padding);
|
||||
SetColumnWidth(COLUMN_NOTES, 200 + platform_padding);
|
||||
SetColumnWidth(COLUMN_COUNTRY, 32 + platform_padding);
|
||||
SetColumnWidth(COLUMN_EMULATION_STATE, 50 + platform_padding);
|
||||
SetColumnWidth(COLUMN_PLATFORM, SConfig::GetInstance().m_showSystemColumn ? 35 + platform_padding : 0);
|
||||
SetColumnWidth(COLUMN_BANNER, SConfig::GetInstance().m_showBannerColumn ? 96 + platform_padding : 0);
|
||||
SetColumnWidth(COLUMN_TITLE, 175 + platform_padding);
|
||||
SetColumnWidth(COLUMN_NOTES, SConfig::GetInstance().m_showNotesColumn ? 150 + platform_padding : 0);
|
||||
SetColumnWidth(COLUMN_ID, SConfig::GetInstance().m_showIDColumn ? 75 + platform_padding : 0);
|
||||
SetColumnWidth(COLUMN_COUNTRY, SConfig::GetInstance().m_showRegionColumn ? 32 + platform_padding : 0);
|
||||
SetColumnWidth(COLUMN_EMULATION_STATE, SConfig::GetInstance().m_showStateColumn ? 50 + platform_padding : 0);
|
||||
|
||||
// add all items
|
||||
for (int i = 0; i < (int)m_ISOFiles.size(); i++)
|
||||
{
|
||||
InsertItemInReportView(i);
|
||||
if (m_ISOFiles[i]->IsCompressed())
|
||||
if (SConfig::GetInstance().m_ColorCompressed && m_ISOFiles[i]->IsCompressed())
|
||||
SetItemTextColour(i, wxColour(0xFF0000));
|
||||
}
|
||||
|
||||
@ -459,6 +463,9 @@ void CGameListCtrl::InsertItemInReportView(long _Index)
|
||||
// File size
|
||||
SetItem(_Index, COLUMN_SIZE, NiceSizeFormat(rISOFile.GetFileSize()), -1);
|
||||
|
||||
// Game ID
|
||||
SetItem(_Index, COLUMN_ID, rISOFile.GetUniqueID(), -1);
|
||||
|
||||
// Background color
|
||||
SetBackgroundColor();
|
||||
|
||||
@ -1278,20 +1285,29 @@ void CGameListCtrl::AutomaticColumnWidth()
|
||||
{
|
||||
SetColumnWidth(0, rc.GetWidth());
|
||||
}
|
||||
else if (GetColumnCount() > 4)
|
||||
else
|
||||
{
|
||||
|
||||
int resizable = rc.GetWidth() - (
|
||||
GetColumnWidth(COLUMN_BANNER)
|
||||
GetColumnWidth(COLUMN_PLATFORM)
|
||||
+ GetColumnWidth(COLUMN_BANNER)
|
||||
+ GetColumnWidth(COLUMN_ID)
|
||||
+ GetColumnWidth(COLUMN_COUNTRY)
|
||||
+ GetColumnWidth(COLUMN_SIZE)
|
||||
+ GetColumnWidth(COLUMN_EMULATION_STATE)
|
||||
+ GetColumnWidth(COLUMN_PLATFORM));
|
||||
+ GetColumnWidth(COLUMN_EMULATION_STATE));
|
||||
|
||||
// We hide the Notes column if the window is too small
|
||||
if (resizable > 400)
|
||||
{
|
||||
SetColumnWidth(COLUMN_TITLE, resizable / 2);
|
||||
SetColumnWidth(COLUMN_NOTES, resizable / 2);
|
||||
if (SConfig::GetInstance().m_showNotesColumn)
|
||||
{
|
||||
SetColumnWidth(COLUMN_TITLE, resizable / 2);
|
||||
SetColumnWidth(COLUMN_NOTES, resizable / 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetColumnWidth(COLUMN_TITLE, resizable);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -51,6 +51,7 @@ public:
|
||||
COLUMN_BANNER,
|
||||
COLUMN_TITLE,
|
||||
COLUMN_NOTES,
|
||||
COLUMN_ID,
|
||||
COLUMN_COUNTRY,
|
||||
COLUMN_SIZE,
|
||||
COLUMN_EMULATION_STATE,
|
||||
|
@ -138,6 +138,16 @@ enum
|
||||
IDM_VIDEOWINDOW,
|
||||
IDM_CODEWINDOW,
|
||||
|
||||
// List Column Title Toggles
|
||||
IDM_SHOW_SYSTEM,
|
||||
IDM_SHOW_BANNER,
|
||||
IDM_SHOW_NOTES,
|
||||
IDM_SHOW_ID,
|
||||
IDM_SHOW_REGION,
|
||||
IDM_SHOW_SIZE,
|
||||
IDM_SHOW_STATE,
|
||||
|
||||
|
||||
// Float Window IDs
|
||||
IDM_LOGWINDOW_PARENT,
|
||||
IDM_LOGCONFIGWINDOW_PARENT,
|
||||
|
Loading…
Reference in New Issue
Block a user