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

Merge branch 'missing-inventory-icon' into 'master'

Use default icon.tga when inventory icon is missing

Closes #4977

See merge request OpenMW/openmw!596
This commit is contained in:
psi29a 2021-02-08 08:43:54 +00:00
commit e2ec3b0db7
2 changed files with 8 additions and 1 deletions

View file

@ -109,6 +109,7 @@
Feature #2686: Timestamps in openmw.log
Feature #3171: OpenMW-CS: Instance drag selection
Feature #4894: Consider actors as obstacles for pathfinding
Feature #4977: Use the "default icon.tga" when an item's icon is not found
Feature #5043: Head Bobbing
Feature #5199: Improve Scene Colors
Feature #5297: Add a search function to the "Datafiles" tab of the OpenMW launcher

View file

@ -6,6 +6,9 @@
#include <MyGUI_TextBox.h>
// correctIconPath
#include <components/resource/resourcesystem.hpp>
#include <components/vfs/manager.hpp>
#include "../mwbase/environment.hpp"
#include "../mwbase/windowmanager.hpp"
@ -106,7 +109,10 @@ namespace MWGui
std::string invIcon = ptr.getClass().getInventoryIcon(ptr);
if (invIcon.empty())
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);
}