Project64: Improve flexibility of advanced mode settings toggle
This commit is contained in:
parent
187bd64915
commit
ef30fc7fb8
|
@ -39,6 +39,10 @@ public:
|
||||||
void ApplySettings(bool UpdateScreen);
|
void ApplySettings(bool UpdateScreen);
|
||||||
bool EnableReset(void);
|
bool EnableReset(void);
|
||||||
void ResetPage(void);
|
void ResetPage(void);
|
||||||
|
bool PageAccessible(bool AdvancedMode)
|
||||||
|
{
|
||||||
|
return AdvancedMode;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void UpdatePageSettings(void);
|
void UpdatePageSettings(void);
|
||||||
|
|
|
@ -38,6 +38,10 @@ public:
|
||||||
void ApplySettings(bool UpdateScreen);
|
void ApplySettings(bool UpdateScreen);
|
||||||
bool EnableReset(void);
|
bool EnableReset(void);
|
||||||
void ResetPage(void);
|
void ResetPage(void);
|
||||||
|
bool PageAccessible(bool AdvancedMode)
|
||||||
|
{
|
||||||
|
return AdvancedMode;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void UpdatePageSettings(void);
|
void UpdatePageSettings(void);
|
||||||
|
|
|
@ -5,8 +5,7 @@
|
||||||
COptionsDirectoriesPage::COptionsDirectoriesPage(HWND hParent, const RECT & rcDispay) :
|
COptionsDirectoriesPage::COptionsDirectoriesPage(HWND hParent, const RECT & rcDispay) :
|
||||||
m_InUpdateSettings(false)
|
m_InUpdateSettings(false)
|
||||||
{
|
{
|
||||||
Create(hParent);
|
if (!Create(hParent, rcDispay))
|
||||||
if (m_hWnd == nullptr)
|
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
class COptionsDirectoriesPage :
|
class COptionsDirectoriesPage :
|
||||||
public CDialogImpl<COptionsDirectoriesPage>,
|
public CSettingsPageImpl<COptionsDirectoriesPage>,
|
||||||
public CSettingsPage
|
public CSettingsPage
|
||||||
{
|
{
|
||||||
BEGIN_MSG_MAP_EX(COptionsDirectoriesPage)
|
BEGIN_MSG_MAP_EX(COptionsDirectoriesPage)
|
||||||
|
@ -48,6 +48,11 @@ public:
|
||||||
bool EnableReset(void);
|
bool EnableReset(void);
|
||||||
void ResetPage(void);
|
void ResetPage(void);
|
||||||
|
|
||||||
|
bool PageAccessible(bool AdvancedMode)
|
||||||
|
{
|
||||||
|
return CSettingsPageImpl<COptionsDirectoriesPage>::PageAccessible(AdvancedMode);
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void SelectPluginDir(UINT Code, int id, HWND ctl);
|
void SelectPluginDir(UINT Code, int id, HWND ctl);
|
||||||
void SelectAutoDir(UINT Code, int id, HWND ctl);
|
void SelectAutoDir(UINT Code, int id, HWND ctl);
|
||||||
|
|
|
@ -34,6 +34,10 @@ public:
|
||||||
void ApplySettings(bool UpdateScreen);
|
void ApplySettings(bool UpdateScreen);
|
||||||
bool EnableReset(void);
|
bool EnableReset(void);
|
||||||
void ResetPage(void);
|
void ResetPage(void);
|
||||||
|
bool PageAccessible(bool AdvancedMode)
|
||||||
|
{
|
||||||
|
return CSettingsPageImpl<CDiskDrivePage>::PageAccessible(AdvancedMode);
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void SelectIplDirJp(UINT Code, int id, HWND ctl);
|
void SelectIplDirJp(UINT Code, int id, HWND ctl);
|
||||||
|
|
|
@ -31,4 +31,8 @@ public:
|
||||||
void ApplySettings(bool UpdateScreen);
|
void ApplySettings(bool UpdateScreen);
|
||||||
bool EnableReset(void);
|
bool EnableReset(void);
|
||||||
void ResetPage(void);
|
void ResetPage(void);
|
||||||
|
bool PageAccessible(bool AdvancedMode)
|
||||||
|
{
|
||||||
|
return CSettingsPageImpl<CGameDiskDrivePage>::PageAccessible(AdvancedMode);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -43,4 +43,8 @@ public:
|
||||||
void ApplySettings(bool UpdateScreen);
|
void ApplySettings(bool UpdateScreen);
|
||||||
bool EnableReset(void);
|
bool EnableReset(void);
|
||||||
void ResetPage(void);
|
void ResetPage(void);
|
||||||
|
bool PageAccessible(bool AdvancedMode)
|
||||||
|
{
|
||||||
|
return CSettingsPageImpl<CGameGeneralPage>::PageAccessible(AdvancedMode);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -40,6 +40,10 @@ public:
|
||||||
void ApplySettings(bool UpdateScreen);
|
void ApplySettings(bool UpdateScreen);
|
||||||
bool EnableReset(void);
|
bool EnableReset(void);
|
||||||
void ResetPage(void);
|
void ResetPage(void);
|
||||||
|
bool PageAccessible(bool AdvancedMode)
|
||||||
|
{
|
||||||
|
return CSettingsPageImpl<CGamePluginPage>::PageAccessible(AdvancedMode);
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void GfxPluginAbout(UINT /*Code*/, int /*id*/, HWND /*ctl*/)
|
void GfxPluginAbout(UINT /*Code*/, int /*id*/, HWND /*ctl*/)
|
||||||
|
|
|
@ -39,6 +39,10 @@ public:
|
||||||
void ApplySettings(bool UpdateScreen);
|
void ApplySettings(bool UpdateScreen);
|
||||||
bool EnableReset(void);
|
bool EnableReset(void);
|
||||||
void ResetPage(void);
|
void ResetPage(void);
|
||||||
|
bool PageAccessible(bool AdvancedMode)
|
||||||
|
{
|
||||||
|
return CSettingsPageImpl<CGameRecompilePage>::PageAccessible(AdvancedMode);
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CPartialGroupBox m_SelfModGroup;
|
CPartialGroupBox m_SelfModGroup;
|
||||||
|
|
|
@ -31,4 +31,8 @@ public:
|
||||||
void ApplySettings(bool UpdateScreen);
|
void ApplySettings(bool UpdateScreen);
|
||||||
bool EnableReset(void);
|
bool EnableReset(void);
|
||||||
void ResetPage(void);
|
void ResetPage(void);
|
||||||
|
bool PageAccessible(bool AdvancedMode)
|
||||||
|
{
|
||||||
|
return CSettingsPageImpl<CGameStatusPage>::PageAccessible(AdvancedMode);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -33,6 +33,10 @@ public:
|
||||||
void ApplySettings(bool UpdateScreen);
|
void ApplySettings(bool UpdateScreen);
|
||||||
bool EnableReset(void);
|
bool EnableReset(void);
|
||||||
void ResetPage(void);
|
void ResetPage(void);
|
||||||
|
bool PageAccessible(bool AdvancedMode)
|
||||||
|
{
|
||||||
|
return CSettingsPageImpl<COptionsGameBrowserPage>::PageAccessible(AdvancedMode);
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void UpdatePageSettings(void);
|
void UpdatePageSettings(void);
|
||||||
|
|
|
@ -38,6 +38,10 @@ public:
|
||||||
void ApplySettings(bool UpdateScreen);
|
void ApplySettings(bool UpdateScreen);
|
||||||
bool EnableReset(void);
|
bool EnableReset(void);
|
||||||
void ResetPage(void);
|
void ResetPage(void);
|
||||||
|
bool PageAccessible(bool AdvancedMode)
|
||||||
|
{
|
||||||
|
return CSettingsPageImpl<COptionsShortCutsPage>::PageAccessible(AdvancedMode);
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void OnCpuStateChanged(UINT Code, int id, HWND ctl);
|
void OnCpuStateChanged(UINT Code, int id, HWND ctl);
|
||||||
|
|
|
@ -35,6 +35,10 @@ public:
|
||||||
void ApplySettings(bool UpdateScreen);
|
void ApplySettings(bool UpdateScreen);
|
||||||
bool EnableReset(void);
|
bool EnableReset(void);
|
||||||
void ResetPage(void);
|
void ResetPage(void);
|
||||||
|
bool PageAccessible(bool AdvancedMode)
|
||||||
|
{
|
||||||
|
return CSettingsPageImpl<CGeneralOptionsPage>::PageAccessible(AdvancedMode);
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void OnBasicMode(UINT Code, int id, HWND ctl);
|
void OnBasicMode(UINT Code, int id, HWND ctl);
|
||||||
|
|
|
@ -39,6 +39,10 @@ public:
|
||||||
void ApplySettings(bool UpdateScreen);
|
void ApplySettings(bool UpdateScreen);
|
||||||
bool EnableReset(void);
|
bool EnableReset(void);
|
||||||
void ResetPage(void);
|
void ResetPage(void);
|
||||||
|
bool PageAccessible(bool AdvancedMode)
|
||||||
|
{
|
||||||
|
return CSettingsPageImpl<COptionPluginPage>::PageAccessible(AdvancedMode);
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void GfxPluginAbout(UINT /*Code*/, int /*id*/, HWND /*ctl*/)
|
void GfxPluginAbout(UINT /*Code*/, int /*id*/, HWND /*ctl*/)
|
||||||
|
|
|
@ -13,6 +13,7 @@ public:
|
||||||
virtual void ApplySettings(bool UpdateScreen) = 0;
|
virtual void ApplySettings(bool UpdateScreen) = 0;
|
||||||
virtual bool EnableReset(void) = 0;
|
virtual bool EnableReset(void) = 0;
|
||||||
virtual void ResetPage(void) = 0;
|
virtual void ResetPage(void) = 0;
|
||||||
|
virtual bool PageAccessible(bool AdvancedMode) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
|
@ -533,6 +534,14 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma warning(push)
|
||||||
|
#pragma warning(disable : 4100) // warning C4100: 'AdvancedMode': unreferenced formal parameter
|
||||||
|
bool PageAccessible(bool AdvancedMode)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
#pragma warning(pop)
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
TextBoxList m_TxtBoxList;
|
TextBoxList m_TxtBoxList;
|
||||||
ButtonList m_ButtonList;
|
ButtonList m_ButtonList;
|
||||||
|
|
|
@ -7,8 +7,6 @@
|
||||||
CSettingConfig::CSettingConfig(bool bJustGameSetting /* = false */) :
|
CSettingConfig::CSettingConfig(bool bJustGameSetting /* = false */) :
|
||||||
m_CurrentPage(nullptr),
|
m_CurrentPage(nullptr),
|
||||||
m_GeneralOptionsPage(nullptr),
|
m_GeneralOptionsPage(nullptr),
|
||||||
m_AdvancedPage(nullptr),
|
|
||||||
m_DefaultsPage(nullptr),
|
|
||||||
m_GameConfig(bJustGameSetting),
|
m_GameConfig(bJustGameSetting),
|
||||||
m_bTVNSelChangedSupported(false)
|
m_bTVNSelChangedSupported(false)
|
||||||
{
|
{
|
||||||
|
@ -49,6 +47,7 @@ void CSettingConfig::Display(void * ParentWindow)
|
||||||
void CSettingConfig::UpdateAdvanced(bool AdvancedMode)
|
void CSettingConfig::UpdateAdvanced(bool AdvancedMode)
|
||||||
{
|
{
|
||||||
UpdateAdvanced(AdvancedMode, m_PagesTreeList.GetRootItem());
|
UpdateAdvanced(AdvancedMode, m_PagesTreeList.GetRootItem());
|
||||||
|
DisplayAccessibleSections(AdvancedMode, true);
|
||||||
BoldChangedPages(m_PagesTreeList.GetRootItem());
|
BoldChangedPages(m_PagesTreeList.GetRootItem());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,22 +56,58 @@ void CSettingConfig::UpdateAdvanced(bool AdvancedMode, HTREEITEM hItem)
|
||||||
while (hItem)
|
while (hItem)
|
||||||
{
|
{
|
||||||
CSettingsPage * Page = (CSettingsPage *)m_PagesTreeList.GetItemData(hItem);
|
CSettingsPage * Page = (CSettingsPage *)m_PagesTreeList.GetItemData(hItem);
|
||||||
if (!AdvancedMode && (Page == m_AdvancedPage || Page == m_DefaultsPage))
|
if (Page == m_GeneralOptionsPage)
|
||||||
|
{
|
||||||
|
UpdateAdvanced(AdvancedMode, m_PagesTreeList.GetChildItem(hItem));
|
||||||
|
hItem = m_PagesTreeList.GetNextSiblingItem(hItem);
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
HTREEITEM hPage = hItem;
|
HTREEITEM hPage = hItem;
|
||||||
hItem = m_PagesTreeList.GetNextSiblingItem(hItem);
|
hItem = m_PagesTreeList.GetNextSiblingItem(hItem);
|
||||||
m_PagesTreeList.DeleteItem(hPage);
|
m_PagesTreeList.DeleteItem(hPage);
|
||||||
}
|
}
|
||||||
else if (AdvancedMode && Page == m_GeneralOptionsPage)
|
|
||||||
{
|
|
||||||
m_PagesTreeList.InsertItem(TVIF_TEXT | TVIF_PARAM, wGS(m_AdvancedPage->PageTitle()).c_str(), 0, 0, 0, 0, (LPARAM)m_AdvancedPage, hItem, TVI_FIRST);
|
|
||||||
m_PagesTreeList.InsertItem(TVIF_TEXT | TVIF_PARAM, wGS(m_DefaultsPage->PageTitle()).c_str(), 0, 0, 0, 0, (LPARAM)m_DefaultsPage, hItem, TVI_FIRST);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
|
|
||||||
|
void CSettingConfig::DisplayAccessibleSections(bool AdvancedMode, bool UpdateSections)
|
||||||
{
|
{
|
||||||
UpdateAdvanced(AdvancedMode, m_PagesTreeList.GetChildItem(hItem));
|
bool bFirstItem = true;
|
||||||
hItem = m_PagesTreeList.GetNextSiblingItem(hItem);
|
|
||||||
|
for (SETTING_SECTIONS::const_iterator iter = m_Sections.begin(); iter != m_Sections.end(); iter++)
|
||||||
|
{
|
||||||
|
CConfigSettingSection * Section = *iter;
|
||||||
|
|
||||||
|
HTREEITEM hSectionItem = nullptr;
|
||||||
|
|
||||||
|
for (size_t i = 0; i < Section->GetPageCount(); i++)
|
||||||
|
{
|
||||||
|
CSettingsPage * Page = Section->GetPage((int32_t)((UINT_PTR)i));
|
||||||
|
if (UpdateSections && Page == m_GeneralOptionsPage)
|
||||||
|
{
|
||||||
|
hSectionItem = m_PagesTreeList.GetRootItem();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!Page->PageAccessible(AdvancedMode))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (i == 0)
|
||||||
|
{
|
||||||
|
hSectionItem = m_PagesTreeList.InsertItem(TVIF_TEXT | TVIF_PARAM, Section->GetPageTitle(), 0, 0, 0, 0, (LPARAM)Page, TVI_ROOT, TVI_LAST);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (hSectionItem == nullptr)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
m_PagesTreeList.InsertItem(TVIF_TEXT | TVIF_PARAM, wGS(Page->PageTitle()).c_str(), 0, 0, 0, 0, (LPARAM)Page, hSectionItem, TVI_LAST);
|
||||||
|
}
|
||||||
|
if (bFirstItem && hSectionItem != nullptr)
|
||||||
|
{
|
||||||
|
bFirstItem = false;
|
||||||
|
m_PagesTreeList.Expand(hSectionItem);
|
||||||
|
m_PagesTreeList.SelectItem(hSectionItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -129,16 +164,13 @@ LRESULT CSettingConfig::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*
|
||||||
}
|
}
|
||||||
|
|
||||||
m_GeneralOptionsPage = new CGeneralOptionsPage(this, this->m_hWnd, rcSettingInfo);
|
m_GeneralOptionsPage = new CGeneralOptionsPage(this, this->m_hWnd, rcSettingInfo);
|
||||||
m_AdvancedPage = new CAdvancedOptionsPage(this->m_hWnd, rcSettingInfo);
|
|
||||||
m_DefaultsPage = new CDefaultsOptionsPage(this->m_hWnd, rcSettingInfo);
|
|
||||||
m_DiskDrivePage = new CDiskDrivePage(this->m_hWnd, rcSettingInfo);
|
|
||||||
|
|
||||||
SettingsSection = new CConfigSettingSection(wGS(TAB_OPTIONS).c_str());
|
SettingsSection = new CConfigSettingSection(wGS(TAB_OPTIONS).c_str());
|
||||||
SettingsSection->AddPage(m_GeneralOptionsPage);
|
SettingsSection->AddPage(m_GeneralOptionsPage);
|
||||||
SettingsSection->AddPage(m_AdvancedPage);
|
SettingsSection->AddPage(new CAdvancedOptionsPage(this->m_hWnd, rcSettingInfo));
|
||||||
SettingsSection->AddPage(m_DefaultsPage);
|
SettingsSection->AddPage(new CDefaultsOptionsPage(this->m_hWnd, rcSettingInfo));
|
||||||
SettingsSection->AddPage(new COptionsDirectoriesPage(this->m_hWnd, rcSettingInfo));
|
SettingsSection->AddPage(new COptionsDirectoriesPage(this->m_hWnd, rcSettingInfo));
|
||||||
SettingsSection->AddPage(m_DiskDrivePage);
|
SettingsSection->AddPage(new CDiskDrivePage(this->m_hWnd, rcSettingInfo));
|
||||||
m_Sections.push_back(SettingsSection);
|
m_Sections.push_back(SettingsSection);
|
||||||
|
|
||||||
SettingsSection = new CConfigSettingSection(wGS(TAB_ROMSELECTION).c_str());
|
SettingsSection = new CConfigSettingSection(wGS(TAB_ROMSELECTION).c_str());
|
||||||
|
@ -174,40 +206,8 @@ LRESULT CSettingConfig::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*
|
||||||
|
|
||||||
m_PagesTreeList.Attach(GetDlgItem(IDC_PAGELIST));
|
m_PagesTreeList.Attach(GetDlgItem(IDC_PAGELIST));
|
||||||
|
|
||||||
bool bFirstItem = true;
|
|
||||||
bool HideAdvanced = g_Settings->LoadBool(UserInterface_BasicMode);
|
bool HideAdvanced = g_Settings->LoadBool(UserInterface_BasicMode);
|
||||||
for (SETTING_SECTIONS::const_iterator iter = m_Sections.begin(); iter != m_Sections.end(); iter++)
|
DisplayAccessibleSections(!HideAdvanced, false);
|
||||||
{
|
|
||||||
CConfigSettingSection * Section = *iter;
|
|
||||||
|
|
||||||
HTREEITEM hSectionItem = nullptr;
|
|
||||||
|
|
||||||
for (size_t i = 0; i < Section->GetPageCount(); i++)
|
|
||||||
{
|
|
||||||
CSettingsPage * Page = Section->GetPage((int32_t)((UINT_PTR)i));
|
|
||||||
if (HideAdvanced && (Page == m_AdvancedPage || Page == m_DefaultsPage))
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (i == 0)
|
|
||||||
{
|
|
||||||
hSectionItem = m_PagesTreeList.InsertItem(TVIF_TEXT | TVIF_PARAM, Section->GetPageTitle(), 0, 0, 0, 0, (LPARAM)Page, TVI_ROOT, TVI_LAST);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (hSectionItem == nullptr)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
m_PagesTreeList.InsertItem(TVIF_TEXT | TVIF_PARAM, wGS(Page->PageTitle()).c_str(), 0, 0, 0, 0, (LPARAM)Page, hSectionItem, TVI_LAST);
|
|
||||||
}
|
|
||||||
if (bFirstItem && hSectionItem != nullptr)
|
|
||||||
{
|
|
||||||
bFirstItem = false;
|
|
||||||
m_PagesTreeList.Expand(hSectionItem);
|
|
||||||
m_PagesTreeList.SelectItem(hSectionItem);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
BoldChangedPages(m_PagesTreeList.GetRootItem());
|
BoldChangedPages(m_PagesTreeList.GetRootItem());
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,6 +40,7 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void UpdateAdvanced(bool AdvancedMode, HTREEITEM hItem);
|
void UpdateAdvanced(bool AdvancedMode, HTREEITEM hItem);
|
||||||
|
void DisplayAccessibleSections(bool AdvancedMode, bool UpdateSections);
|
||||||
void ApplySettings(bool UpdateScreen);
|
void ApplySettings(bool UpdateScreen);
|
||||||
void BoldChangedPages(HTREEITEM hItem);
|
void BoldChangedPages(HTREEITEM hItem);
|
||||||
|
|
||||||
|
@ -47,7 +48,7 @@ private:
|
||||||
|
|
||||||
CTreeViewCtrl m_PagesTreeList;
|
CTreeViewCtrl m_PagesTreeList;
|
||||||
SETTING_SECTIONS m_Sections;
|
SETTING_SECTIONS m_Sections;
|
||||||
CSettingsPage *m_CurrentPage, *m_GeneralOptionsPage, *m_AdvancedPage, *m_DefaultsPage, *m_DiskDrivePage;
|
CSettingsPage *m_CurrentPage, *m_GeneralOptionsPage;
|
||||||
bool m_GameConfig;
|
bool m_GameConfig;
|
||||||
bool m_bTVNSelChangedSupported;
|
bool m_bTVNSelChangedSupported;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue