diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-04-06 01:31:12 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-04-06 01:31:12 +0300 |
commit | d4e28aa97cbce34a0053d3c02cf070ef9065439f (patch) | |
tree | 8e7300771b93caeed5faefbe709bd0720766e755 /src/resources/db/textdb.cpp | |
parent | be163616712f8c360af9b3940969c7f127043dc0 (diff) | |
download | manaplus-d4e28aa97cbce34a0053d3c02cf070ef9065439f.tar.gz manaplus-d4e28aa97cbce34a0053d3c02cf070ef9065439f.tar.bz2 manaplus-d4e28aa97cbce34a0053d3c02cf070ef9065439f.tar.xz manaplus-d4e28aa97cbce34a0053d3c02cf070ef9065439f.zip |
Add quick messages with translation from current server language to default.
For use it open emotes/fonts in chat and select T tab.
Diffstat (limited to 'src/resources/db/textdb.cpp')
-rw-r--r-- | src/resources/db/textdb.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/resources/db/textdb.cpp b/src/resources/db/textdb.cpp index 28198162d..8a8771535 100644 --- a/src/resources/db/textdb.cpp +++ b/src/resources/db/textdb.cpp @@ -30,7 +30,7 @@ namespace { - std::vector<std::string> mTexts; + StringVect mTexts; } // namespace void TextDb::load() @@ -85,3 +85,18 @@ void TextDb::unload() { mTexts.clear(); } + +const StringVect &TextDb::getTexts() +{ + return mTexts; +} + +std::string TextDb::getByIndex(const int index) +{ + if (index < 0 || + static_cast<size_t>(index) >= mTexts.size()) + { + return std::string(); + } + return mTexts[index]; +} |