1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-27 22:49:25 +02:00

Show message about mods that failed to load on opening main menu

This commit is contained in:
Ivan Savenko
2023-11-15 17:57:40 +02:00
parent a9f868b379
commit d1a4e84255
5 changed files with 54 additions and 9 deletions

View File

@@ -49,6 +49,7 @@
#include "../../lib/filesystem/Filesystem.h"
#include "../../lib/filesystem/CCompressedStream.h"
#include "../../lib/mapping/CMapInfo.h"
#include "../../lib/modding/CModHandler.h"
#include "../../lib/VCMIDirs.h"
#include "../../lib/CStopWatch.h"
#include "../../lib/CThreadHelper.h"
@@ -339,6 +340,17 @@ void CMainMenu::update()
menu->switchToTab(menu->getActiveTab());
}
static bool warnedAboutModDependencies = false;
if (!warnedAboutModDependencies)
{
warnedAboutModDependencies = true;
auto errorMessages = CGI->modh->getModLoadErrors();
if (!errorMessages.empty())
CInfoWindow::showInfoDialog(errorMessages, std::vector<std::shared_ptr<CComponent>>(), PlayerColor(1));
}
// Handles mouse and key input
GH.handleEvents();
GH.windows().simpleRedraw();