diff options
author | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2011-12-22 22:52:45 +0100 |
---|---|---|
committer | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2012-01-09 07:05:13 +0100 |
commit | 8e0bc98ddf2e2c0810136d39141ee4f3de445131 (patch) | |
tree | 9c46d14ef11880d06764802fc78f6c92f39a6ecd /src/actorsprite.cpp | |
parent | bb94a1c1906de4b7d71690f15f05f5fe9fbdb444 (diff) | |
download | mana-client-8e0bc98ddf2e2c0810136d39141ee4f3de445131.tar.gz mana-client-8e0bc98ddf2e2c0810136d39141ee4f3de445131.tar.bz2 mana-client-8e0bc98ddf2e2c0810136d39141ee4f3de445131.tar.xz mana-client-8e0bc98ddf2e2c0810136d39141ee4f3de445131.zip |
Spotted some more hard-coded files and paths definitions.
Conflicts:
src/actorsprite.cpp
Diffstat (limited to 'src/actorsprite.cpp')
-rw-r--r-- | src/actorsprite.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/actorsprite.cpp b/src/actorsprite.cpp index 8dc873da..17e6b3d2 100644 --- a/src/actorsprite.cpp +++ b/src/actorsprite.cpp @@ -21,6 +21,7 @@ #include "actorsprite.h" #include "client.h" +#include "configuration.h" #include "event.h" #include "game.h" #include "imagesprite.h" @@ -323,7 +324,7 @@ void ActorSprite::setupSpriteDisplay(const SpriteDisplay &display, for (it = display.sprites.begin(), it_end = display.sprites.end(); it != it_end; it++) { - std::string file = "graphics/sprites/" + (*it)->sprite; + std::string file = paths.getStringValue("sprites") + (*it)->sprite; int variant = (*it)->variant; addSprite(AnimatedSprite::load(file, variant)); } @@ -332,15 +333,20 @@ void ActorSprite::setupSpriteDisplay(const SpriteDisplay &display, if (size() == 0 && forceDisplay) { if (display.image.empty()) - addSprite(AnimatedSprite::load("graphics/sprites/error.xml")); + { + addSprite(AnimatedSprite::load(paths.getStringValue("sprites") + + paths.getStringValue("spriteErrorFile"))); + } else { ResourceManager *resman = ResourceManager::getInstance(); - std::string imagePath = "graphics/items/" + display.image; + std::string imagePath = paths.getStringValue("itemIcons") + + display.image; Image *img = resman->getImage(imagePath); if (!img) - img = Theme::getImageFromTheme("unknown-item.png"); + img = Theme::getImageFromTheme( + paths.getStringValue("unknownItemFile")); addSprite(new ImageSprite(img)); } |