summaryrefslogtreecommitdiff
path: root/src/utils/stringutils.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-02-27 18:08:34 +0200
committerAndrei Karas <akaras@inbox.ru>2011-02-27 23:26:17 +0200
commitdf5c7ae83a80db63ab90142df9e3a93f5ee630d0 (patch)
tree465991eb7785c1d17e1b15f6798efa67951a0c83 /src/utils/stringutils.cpp
parent41e84157e0eca3a494cd6d44eec96dfbde0f5626 (diff)
downloadManaVerse-df5c7ae83a80db63ab90142df9e3a93f5ee630d0.tar.gz
ManaVerse-df5c7ae83a80db63ab90142df9e3a93f5ee630d0.tar.bz2
ManaVerse-df5c7ae83a80db63ab90142df9e3a93f5ee630d0.tar.xz
ManaVerse-df5c7ae83a80db63ab90142df9e3a93f5ee630d0.zip
First part of implimintation item colors.
Diffstat (limited to 'src/utils/stringutils.cpp')
-rw-r--r--src/utils/stringutils.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp
index d914efe30..835f9ce00 100644
--- a/src/utils/stringutils.cpp
+++ b/src/utils/stringutils.cpp
@@ -387,3 +387,13 @@ std::list<int> splitToIntList(const std::string &text, char separator)
return tokens;
}
+
+std::string combineDye(std::string file, std::string dye)
+{
+ if (dye.empty())
+ return file;
+ size_t pos = file.find_last_of("|");
+ if (pos != std::string::npos)
+ return file.substr(0, pos) + "|" + dye;
+ return file + "|" + dye;
+}