fixed Gui lock while deleting/reading demos. Closes #167

This commit is contained in:
oy 2010-09-08 02:27:48 +02:00
parent cbf07ffa57
commit d4b145a8ee

View file

@ -546,6 +546,11 @@ void CMenus::RenderDemoList(CUIRect MainView)
const char *pError = Client()->DemoPlayer_Play(m_lDemos[s_SelectedItem].m_aFilename); const char *pError = Client()->DemoPlayer_Play(m_lDemos[s_SelectedItem].m_aFilename);
if(pError) if(pError)
PopupMessage(Localize("Error"), str_comp(pError, "error loading demo") ? pError : Localize("error loading demo"), Localize("Ok")); PopupMessage(Localize("Error"), str_comp(pError, "error loading demo") ? pError : Localize("error loading demo"), Localize("Ok"));
else
{
UI()->SetActiveItem(0);
return;
}
} }
} }
} }
@ -556,9 +561,12 @@ void CMenus::RenderDemoList(CUIRect MainView)
if(DoButton_Menu(&s_DeleteButton, Localize("Delete"), 0, &DeleteRect) || m_DeletePressed) if(DoButton_Menu(&s_DeleteButton, Localize("Delete"), 0, &DeleteRect) || m_DeletePressed)
{ {
if(s_SelectedItem >= 0 && s_SelectedItem < m_lDemos.size()) if(s_SelectedItem >= 0 && s_SelectedItem < m_lDemos.size())
{
UI()->SetActiveItem(0);
m_Popup = POPUP_DELETE_DEMO; m_Popup = POPUP_DELETE_DEMO;
} }
} }
}
} }
void CMenus::DemoSetParentDirectory() void CMenus::DemoSetParentDirectory()