Fix closing Load Save dialog without game selected
Pressing Load when no savegame is selected resumes game but Load Save window stays open.1164-fix
parent
55c0c3221d
commit
1cffbb2bd3
|
@ -244,22 +244,24 @@ void CScreenIO::IOWriteScene()
|
||||||
|
|
||||||
// Reads the scene.
|
// Reads the scene.
|
||||||
|
|
||||||
void CScreenIO::IOReadScene()
|
bool CScreenIO::IOReadScene()
|
||||||
{
|
{
|
||||||
CWindow* pw;
|
CWindow* pw;
|
||||||
CList* pl;
|
CList* pl;
|
||||||
|
|
||||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
|
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
|
||||||
if ( pw == nullptr ) return;
|
if ( pw == nullptr ) return false;
|
||||||
pl = static_cast<CList*>(pw->SearchControl(EVENT_INTERFACE_IOLIST));
|
pl = static_cast<CList*>(pw->SearchControl(EVENT_INTERFACE_IOLIST));
|
||||||
if ( pl == nullptr ) return;
|
if ( pl == nullptr ) return false;
|
||||||
|
|
||||||
int sel = pl->GetSelect();
|
int sel = pl->GetSelect();
|
||||||
if (sel < 0 || sel >= static_cast<int>(m_saveList.size())) return;
|
if (sel < 0 || sel >= static_cast<int>(m_saveList.size())) return false;
|
||||||
|
|
||||||
m_main->GetPlayerProfile()->LoadScene(m_saveList.at(sel));
|
m_main->GetPlayerProfile()->LoadScene(m_saveList.at(sel));
|
||||||
|
|
||||||
m_screenLevelList->SetSelection(m_main->GetLevelCategory(), m_main->GetLevelChap()-1, m_main->GetLevelRank()-1);
|
m_screenLevelList->SetSelection(m_main->GetLevelCategory(), m_main->GetLevelChap()-1, m_main->GetLevelRank()-1);
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Ui
|
} // namespace Ui
|
||||||
|
|
|
@ -39,7 +39,7 @@ protected:
|
||||||
void IOUpdateList(bool isWrite);
|
void IOUpdateList(bool isWrite);
|
||||||
void IODeleteScene();
|
void IODeleteScene();
|
||||||
void IOWriteScene();
|
void IOWriteScene();
|
||||||
void IOReadScene();
|
bool IOReadScene();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
CScreenLevelList* m_screenLevelList;
|
CScreenLevelList* m_screenLevelList;
|
||||||
|
|
|
@ -168,8 +168,7 @@ bool CScreenIORead::EventProcess(const Event &event)
|
||||||
|
|
||||||
if ( event.type == EVENT_INTERFACE_IOREAD )
|
if ( event.type == EVENT_INTERFACE_IOREAD )
|
||||||
{
|
{
|
||||||
IOReadScene();
|
if(IOReadScene() && m_inSimulation)
|
||||||
if(m_inSimulation)
|
|
||||||
{
|
{
|
||||||
m_main->StopSuspend();
|
m_main->StopSuspend();
|
||||||
m_main->ChangePhase(PHASE_SIMUL);
|
m_main->ChangePhase(PHASE_SIMUL);
|
||||||
|
|
Loading…
Reference in New Issue