summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-05-24 01:20:43 +0300
committerAndrei Karas <akaras@inbox.ru>2012-05-24 01:20:43 +0300
commita3360d4c38e8dd43d6e71cc4bd38f8dc96040b2e (patch)
tree44306e2fb7f38c44ca9ca89a9e21a76b912169ca
parent2bcfc80fe18a7239e2eae5600e4ed118e038da32 (diff)
downloadmanaplus-a3360d4c38e8dd43d6e71cc4bd38f8dc96040b2e.tar.gz
manaplus-a3360d4c38e8dd43d6e71cc4bd38f8dc96040b2e.tar.bz2
manaplus-a3360d4c38e8dd43d6e71cc4bd38f8dc96040b2e.tar.xz
manaplus-a3360d4c38e8dd43d6e71cc4bd38f8dc96040b2e.zip
Dehardcode some old paths.
-rw-r--r--src/actorsprite.cpp12
-rw-r--r--src/gui/minimap.cpp4
-rw-r--r--src/item.cpp2
-rw-r--r--src/textcommand.cpp5
4 files changed, 15 insertions, 8 deletions
diff --git a/src/actorsprite.cpp b/src/actorsprite.cpp
index 267392a6c..4611ddbd2 100644
--- a/src/actorsprite.cpp
+++ b/src/actorsprite.cpp
@@ -23,6 +23,7 @@
#include "actorspritelistener.h"
#include "client.h"
+#include "configuration.h"
#include "effectmanager.h"
#include "imagesprite.h"
#include "localplayer.h"
@@ -328,7 +329,7 @@ void ActorSprite::setupSpriteDisplay(const SpriteDisplay &display,
{
if (!*it)
continue;
- std::string file = "graphics/sprites/"
+ std::string file = paths.getStringValue("sprites")
+ combineDye2((*it)->sprite, color);
int variant = (*it)->variant;
@@ -340,7 +341,8 @@ void ActorSprite::setupSpriteDisplay(const SpriteDisplay &display,
{
if (display.image.empty())
{
- addSprite(AnimatedSprite::load("graphics/sprites/error.xml"));
+ addSprite(AnimatedSprite::load(paths.getStringValue("sprites")
+ + paths.getStringValue("spriteErrorFile")));
}
else
{
@@ -350,10 +352,12 @@ void ActorSprite::setupSpriteDisplay(const SpriteDisplay &display,
{
case 0:
default:
- imagePath = "graphics/items/" + display.image;
+ imagePath = paths.getStringValue("itemIcons")
+ + display.image;
break;
case 1:
- imagePath = "graphics/items/" + display.floor;
+ imagePath = paths.getStringValue("itemIcons")
+ + display.floor;
break;
}
imagePath = combineDye2(imagePath, color);
diff --git a/src/gui/minimap.cpp b/src/gui/minimap.cpp
index 9c7ab76cb..e4bf62ec6 100644
--- a/src/gui/minimap.cpp
+++ b/src/gui/minimap.cpp
@@ -149,8 +149,8 @@ void Minimap::setMap(Map *map)
}
else
{
- std::string tempname =
- "graphics/minimaps/" + map->getFilename() + ".png";
+ std::string tempname = paths.getStringValue("minimaps")
+ + "graphics/minimaps/" + map->getFilename() + ".png";
ResourceManager *resman = ResourceManager::getInstance();
minimapName = map->getProperty("minimap");
diff --git a/src/item.cpp b/src/item.cpp
index fda05aa30..d484f64cb 100644
--- a/src/item.cpp
+++ b/src/item.cpp
@@ -106,7 +106,7 @@ Image *Item::getImage(int id, unsigned char color)
ResourceManager *resman = ResourceManager::getInstance();
const ItemInfo &info = ItemDB::get(id);
SpriteDisplay display = info.getDisplay();
- std::string imagePath = "graphics/items/" + display.image;
+ std::string imagePath = paths.getStringValue("itemIcons") + display.image;
Image *image;
image = resman->getImage(combineDye2(imagePath,
info.getDyeColorsString(color)));
diff --git a/src/textcommand.cpp b/src/textcommand.cpp
index ec9e97f61..2ca1e3996 100644
--- a/src/textcommand.cpp
+++ b/src/textcommand.cpp
@@ -22,6 +22,8 @@
#include "textcommand.h"
+#include "configuration.h"
+
#include "gui/theme.h"
#include "resources/image.h"
@@ -111,7 +113,8 @@ void TextCommand::loadImage()
ResourceManager *resman = ResourceManager::getInstance();
SpriteDisplay display = ItemDB::get(getIcon()).getDisplay();
- mImage = resman->getImage("graphics/items/" + display.image);
+ mImage = resman->getImage(paths.getStringValue("itemIcons")
+ + display.image);
if (!mImage)
mImage = Theme::getImageFromTheme("unknown-item.png");