1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-16 15:29:55 +00:00

Merge branch 'yell-about-missing-icon' into 'master'

Log when icon is missing and fallback is used

Closes #5857

See merge request OpenMW/openmw!611
This commit is contained in:
elsid 2021-02-14 23:57:30 +00:00
commit e1c5d05e84

View file

@ -5,6 +5,7 @@
#include <MyGUI_RenderManager.h>
#include <MyGUI_TextBox.h>
#include <components/debug/debuglog.hpp>
// correctIconPath
#include <components/resource/resourcesystem.hpp>
#include <components/vfs/manager.hpp>
@ -111,7 +112,10 @@ namespace MWGui
invIcon = "default icon.tga";
invIcon = MWBase::Environment::get().getWindowManager()->correctIconPath(invIcon);
if (!MWBase::Environment::get().getResourceSystem()->getVFS()->exists(invIcon))
{
Log(Debug::Error) << "Failed to open image: '" << invIcon << "' not found, falling back to 'default-icon.tga'";
invIcon = MWBase::Environment::get().getWindowManager()->correctIconPath("default icon.tga");
}
setIcon(invIcon);
}