If loaded level assets fail to mount, print message to non-console users

This error case can happen, but if it does, non-console users get an
ERROR page with no further information. So use setLevelDirError if this
failure mode happens. And Menu::errorloadinglevel needs to be changed to
accomodate that.
This commit is contained in:
Misa
2021-08-18 10:02:06 -07:00
parent 124d77c041
commit bc47b86645
2 changed files with 49 additions and 38 deletions

View File

@@ -1389,9 +1389,20 @@ static void menurender(void)
graphics.Print( -1, 95, "ERROR: Could not save settings file!", tr, tg, tb, true);
break;
case Menu::errorloadinglevel:
{
const char* str;
if (FILESYSTEM_levelDirHasError())
{
str = FILESYSTEM_getLevelDirError();
}
else
{
str = graphics.error;
}
graphics.bigprint(-1, 45, "ERROR", tr, tg, tb, true);
graphics.PrintWrap(-1, 65, graphics.error, tr, tg, tb, true, 10, 304);
graphics.PrintWrap(-1, 65, str, tr, tg, tb, true, 10, 304);
break;
}
case Menu::warninglevellist:
graphics.bigprint(-1, 45, "WARNING", tr, tg, tb, true);
graphics.PrintWrap(-1, 65, FILESYSTEM_getLevelDirError(), tr, tg, tb, true, 10, 304);