Show an error message on missing file

This commit is contained in:
def 2020-09-11 09:59:05 +02:00
parent 277040fc7c
commit aeb8bcbd9a
2 changed files with 12 additions and 2 deletions

View file

@ -113,7 +113,17 @@ void CMenus::RenderStartMenu(CUIRect MainView)
else
{
char aBuf[MAX_PATH_LENGTH];
m_ServerProcess.Process = shell_execute(Storage()->GetBinaryPath(PLAT_SERVER_EXEC, aBuf, sizeof(aBuf)));
Storage()->GetBinaryPath(PLAT_SERVER_EXEC, aBuf, sizeof(aBuf));
IOHANDLE File = io_open(aBuf, IOFLAG_READ);
if(File)
{
io_close(File);
m_ServerProcess.Process = shell_execute(PLAT_SERVER_EXEC);
}
else
{
PopupWarning(Localize("Warning"), Localize("Server executable not found, can't run server"), Localize("Ok"), 10000000);
}
}
}

View file

@ -632,7 +632,7 @@ void CGameClient::OnRender()
{
if(m_pMenus->CanDisplayWarning())
{
m_pMenus->PopupWarning("Warning!", pWarning->m_aWarningMsg, "Ok", 10000000);
m_pMenus->PopupWarning(Localize("Warning"), pWarning->m_aWarningMsg, "Ok", 10000000);
pWarning->m_WasShown = true;
}