mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-29 16:06:44 +00:00
Use default icon.tga when inventory icon is missing
This commit is contained in:
parent
4b7d00530d
commit
da6223fc4b
1 changed files with 7 additions and 1 deletions
|
@ -6,6 +6,9 @@
|
||||||
#include <MyGUI_TextBox.h>
|
#include <MyGUI_TextBox.h>
|
||||||
|
|
||||||
// correctIconPath
|
// correctIconPath
|
||||||
|
#include <components/resource/resourcesystem.hpp>
|
||||||
|
#include <components/vfs/manager.hpp>
|
||||||
|
|
||||||
#include "../mwbase/environment.hpp"
|
#include "../mwbase/environment.hpp"
|
||||||
#include "../mwbase/windowmanager.hpp"
|
#include "../mwbase/windowmanager.hpp"
|
||||||
|
|
||||||
|
@ -106,7 +109,10 @@ namespace MWGui
|
||||||
std::string invIcon = ptr.getClass().getInventoryIcon(ptr);
|
std::string invIcon = ptr.getClass().getInventoryIcon(ptr);
|
||||||
if (invIcon.empty())
|
if (invIcon.empty())
|
||||||
invIcon = "default icon.tga";
|
invIcon = "default icon.tga";
|
||||||
setIcon(MWBase::Environment::get().getWindowManager()->correctIconPath(invIcon));
|
invIcon = MWBase::Environment::get().getWindowManager()->correctIconPath(invIcon);
|
||||||
|
if (!MWBase::Environment::get().getResourceSystem()->getVFS()->exists(invIcon))
|
||||||
|
invIcon = MWBase::Environment::get().getWindowManager()->correctIconPath("default icon.tga");
|
||||||
|
setIcon(invIcon);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue