From 8e0bc98ddf2e2c0810136d39141ee4f3de445131 Mon Sep 17 00:00:00 2001 From: Yohann Ferreira Date: Thu, 22 Dec 2011 22:52:45 +0100 Subject: Spotted some more hard-coded files and paths definitions. Conflicts: src/actorsprite.cpp --- src/actorsprite.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/actorsprite.cpp') 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)); } -- cgit v1.2.3-70-g09d2