Make sure file is reloaded on opening cheat config
This commit is contained in:
parent
155d331d45
commit
9262e37c47
|
@ -165,10 +165,6 @@ void CEnhancmentFile::OpenFile(void)
|
||||||
|
|
||||||
bool CEnhancmentFile::MoveToSection(const char * Section, bool ChangeCurrentSection)
|
bool CEnhancmentFile::MoveToSection(const char * Section, bool ChangeCurrentSection)
|
||||||
{
|
{
|
||||||
if (strcmp(Section, m_CurrentSection.c_str()) == 0)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (ChangeCurrentSection)
|
if (ChangeCurrentSection)
|
||||||
{
|
{
|
||||||
SaveCurrentSection();
|
SaveCurrentSection();
|
||||||
|
|
|
@ -240,6 +240,7 @@ void CEnhancements::LoadEnhancements(const char * Ident, SectionFiles & Files, s
|
||||||
{
|
{
|
||||||
File = std::make_unique<CEnhancmentFile>(CheatFile, Ident);
|
File = std::make_unique<CEnhancmentFile>(CheatFile, Ident);
|
||||||
}
|
}
|
||||||
|
EnhancementList.clear();
|
||||||
File->GetEnhancementList(SectionIdent.c_str(), EnhancementList);
|
File->GetEnhancementList(SectionIdent.c_str(), EnhancementList);
|
||||||
FoundFile = true;
|
FoundFile = true;
|
||||||
}
|
}
|
||||||
|
@ -265,6 +266,26 @@ void CEnhancements::Load(CMipsMemoryVM * MMU, CPlugins * Plugins)
|
||||||
LoadActive(m_Enhancements, Plugins);
|
LoadActive(m_Enhancements, Plugins);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CEnhancementList CEnhancements::Cheats(void)
|
||||||
|
{
|
||||||
|
CEnhancementList List;
|
||||||
|
{
|
||||||
|
CGuard Guard(m_CS);
|
||||||
|
List = m_Cheats;
|
||||||
|
}
|
||||||
|
return List;
|
||||||
|
}
|
||||||
|
|
||||||
|
CEnhancementList CEnhancements::Enhancements(void)
|
||||||
|
{
|
||||||
|
CEnhancementList List;
|
||||||
|
{
|
||||||
|
CGuard Guard(m_CS);
|
||||||
|
List = m_Enhancements;
|
||||||
|
}
|
||||||
|
return List;
|
||||||
|
}
|
||||||
|
|
||||||
void CEnhancements::LoadActive(CEnhancementList & List, CPlugins * Plugins)
|
void CEnhancements::LoadActive(CEnhancementList & List, CPlugins * Plugins)
|
||||||
{
|
{
|
||||||
for (CEnhancementList::const_iterator itr = List.begin(); itr != List.end(); itr++)
|
for (CEnhancementList::const_iterator itr = List.begin(); itr != List.end(); itr++)
|
||||||
|
|
|
@ -38,8 +38,8 @@ public:
|
||||||
void ResetActive(CPlugins * Plugins);
|
void ResetActive(CPlugins * Plugins);
|
||||||
void Load(CMipsMemoryVM * MMU, CPlugins * Plugins);
|
void Load(CMipsMemoryVM * MMU, CPlugins * Plugins);
|
||||||
|
|
||||||
inline const CEnhancementList & Cheats(void) const { return m_Cheats; }
|
CEnhancementList Cheats(void);
|
||||||
inline const CEnhancementList & Enhancements(void) const { return m_Enhancements; }
|
CEnhancementList Enhancements(void);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct GAMESHARK_CODE
|
struct GAMESHARK_CODE
|
||||||
|
|
|
@ -492,6 +492,10 @@ void CCheatList::ChangeChildrenStatus(HTREEITEM hParent, bool Checked)
|
||||||
|
|
||||||
TV_SetCheckState(hParent, Checked ? TV_STATE_CHECKED : TV_STATE_CLEAR);
|
TV_SetCheckState(hParent, Checked ? TV_STATE_CHECKED : TV_STATE_CLEAR);
|
||||||
Enhancement->SetActive(Checked);
|
Enhancement->SetActive(Checked);
|
||||||
|
if (g_Enhancements != nullptr)
|
||||||
|
{
|
||||||
|
g_Enhancements->UpdateCheats();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
TV_CHECK_STATE state = TV_STATE_UNKNOWN;
|
TV_CHECK_STATE state = TV_STATE_UNKNOWN;
|
||||||
|
|
|
@ -305,7 +305,7 @@ LRESULT CEnhancementUI::OnEnhancementListDClicked(NMHDR * lpnmh)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
LRESULT CEnhancementUI::OnEnhancementListSelChanged(NMHDR * lpnmh)
|
LRESULT CEnhancementUI::OnEnhancementListSelChanged(NMHDR * /*lpnmh*/)
|
||||||
{
|
{
|
||||||
HTREEITEM hItem = m_TreeList.GetSelectedItem();
|
HTREEITEM hItem = m_TreeList.GetSelectedItem();
|
||||||
GetDlgItem(IDC_NOTES).SetWindowText(L"");
|
GetDlgItem(IDC_NOTES).SetWindowText(L"");
|
||||||
|
@ -394,6 +394,10 @@ void CEnhancementUI::ChangeChildrenStatus(HTREEITEM hParent, bool Checked)
|
||||||
|
|
||||||
TV_SetCheckState(hParent, Checked ? TV_STATE_CHECKED : TV_STATE_CLEAR);
|
TV_SetCheckState(hParent, Checked ? TV_STATE_CHECKED : TV_STATE_CLEAR);
|
||||||
Enhancement->SetActive(Checked);
|
Enhancement->SetActive(Checked);
|
||||||
|
if (g_Enhancements != nullptr)
|
||||||
|
{
|
||||||
|
g_Enhancements->UpdateCheats();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
TV_CHECK_STATE state = TV_STATE_UNKNOWN;
|
TV_CHECK_STATE state = TV_STATE_UNKNOWN;
|
||||||
|
|
Loading…
Reference in New Issue