Add warning messages for missing fonts/lang folders

If someone makes a build of the game without copying the correct
folders, their version will have no translations, and display some text
wrong (like credits or button glyphs, or any custom levels that rely on
characters in the fonts being there). So I added a message in the
bottom left corner of the title screen to warn for that.
This commit is contained in:
Dav999
2023-08-30 16:45:04 +02:00
committed by Misa Elizabeth Kai
parent da13f39f5d
commit fd84922a92
3 changed files with 48 additions and 10 deletions

View File

@@ -220,8 +220,31 @@ static void menurender(void)
#endif
font::print(PR_RIGHT, 310, 230, RELEASE_VERSION, tr/2, tg/2, tb/2);
if(music.mmmmmm){
font::print(0, 10, 230, loc::gettext("[MMMMMM Mod Installed]"), tr/2, tg/2, tb/2);
const char* left_msg = NULL;
const bool fonts_error = !FILESYSTEM_doesFontsDirExist();
const bool lang_error = !FILESYSTEM_doesLangDirExist();
if (fonts_error && lang_error)
{
left_msg = "[No fonts&lang folders]";
}
else if (fonts_error)
{
left_msg = "[No fonts folder]";
}
else if (lang_error)
{
left_msg = "[No lang folder]";
}
else if (music.mmmmmm)
{
left_msg = loc::gettext("[MMMMMM Mod Installed]");
}
if (left_msg != NULL)
{
font::print(0, 10, 230, left_msg, tr/2, tg/2, tb/2);
}
break;
}