summaryrefslogtreecommitdiff
path: root/src/item.cpp
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2010-07-11 20:05:44 +0200
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2010-07-11 20:05:44 +0200
commitabde0f51b3062c158fb52e9dfff23d21d3be03d1 (patch)
tree4af561ea9e8cd3f7f981cce9817cf57f3e353787 /src/item.cpp
parent93e1a2a9e5f379945a6efb24598319b605be1dfa (diff)
downloadmana-abde0f51b3062c158fb52e9dfff23d21d3be03d1.tar.gz
mana-abde0f51b3062c158fb52e9dfff23d21d3be03d1.tar.bz2
mana-abde0f51b3062c158fb52e9dfff23d21d3be03d1.tar.xz
mana-abde0f51b3062c158fb52e9dfff23d21d3be03d1.zip
Made the different hard-coded paths and files be now taken from the
data/paths.xml configuration file. Also added default gui theme path in branding and default wallpaper path and file searched respectively in the branding and paths.xml files. Hard-coded values are still used as fallbacks. Resolves: Manasource Mantis #148. Reviewed-by: jaxad0127.
Diffstat (limited to 'src/item.cpp')
-rw-r--r--src/item.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/item.cpp b/src/item.cpp
index 79ccd2c3..b434387e 100644
--- a/src/item.cpp
+++ b/src/item.cpp
@@ -26,6 +26,7 @@
#include "resources/image.h"
#include "resources/iteminfo.h"
#include "resources/resourcemanager.h"
+#include "configuration.h"
Item::Item(int id, int quantity, bool equipment, bool equipped):
mImage(0),
@@ -57,13 +58,17 @@ void Item::setId(int id)
mDrawImage->decRef();
ResourceManager *resman = ResourceManager::getInstance();
- std::string imagePath = "graphics/items/" + getInfo().getImageName();
+ std::string imagePath = paths.getValue("itemIcons", "graphics/items/")
+ + getInfo().getImageName();
mImage = resman->getImage(imagePath);
mDrawImage = resman->getImage(imagePath);
if (!mImage)
- mImage = Theme::getImageFromTheme("unknown-item.png");
+ mImage = Theme::getImageFromTheme(paths.getValue("unknownItemFile",
+ "unknown-item.png"));
if (!mDrawImage)
- mDrawImage = Theme::getImageFromTheme("unknown-item.png");
+ mDrawImage = Theme::getImageFromTheme(
+ paths.getValue("unknownItemFile",
+ "unknown-item.png"));
}