diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-01-17 18:36:21 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-01-17 19:19:58 +0300 |
commit | 55cbf74cbe2c40b4592e72621e40f8858fc376d9 (patch) | |
tree | 1adb70df7ddddde9a504d572a789e7afb5cae58c /src/gui/widgets | |
parent | 261a118937d8b1cd41cf16d983f880e5957f84b1 (diff) | |
download | manaverse-55cbf74cbe2c40b4592e72621e40f8858fc376d9.tar.gz manaverse-55cbf74cbe2c40b4592e72621e40f8858fc376d9.tar.bz2 manaverse-55cbf74cbe2c40b4592e72621e40f8858fc376d9.tar.xz manaverse-55cbf74cbe2c40b4592e72621e40f8858fc376d9.zip |
Move cards constants into separate file.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/browserbox.cpp | 4 | ||||
-rw-r--r-- | src/gui/widgets/itemlinkhandler.cpp | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp index 9ffead378..9c5dcc77c 100644 --- a/src/gui/widgets/browserbox.cpp +++ b/src/gui/widgets/browserbox.cpp @@ -26,6 +26,8 @@ #include "itemcolormanager.h" #include "settings.h" +#include "const/resources/item/cards.h" + #include "input/inputmanager.h" #include "gui/gui.h" @@ -246,7 +248,7 @@ void BrowserBox::addRow(const std::string &row, const bool atTop) { std::vector<int> parts; splitToIntVector(parts, bLink.link.substr(idx), ','); - while (parts.size() < 4) + while (parts.size() < maxCards) parts.push_back(0); const ItemColor itemColor = ItemColorManager::getColorFromCards(&parts[0]); diff --git a/src/gui/widgets/itemlinkhandler.cpp b/src/gui/widgets/itemlinkhandler.cpp index 1f30c5da6..e363fe671 100644 --- a/src/gui/widgets/itemlinkhandler.cpp +++ b/src/gui/widgets/itemlinkhandler.cpp @@ -24,6 +24,8 @@ #include "itemcolormanager.h" +#include "const/resources/item/cards.h" + #include "gui/viewport.h" #include "gui/popups/itempopup.h" @@ -119,7 +121,7 @@ void ItemLinkHandler::handleLink(const std::string &link, MouseEvent *event) if (id > 0) { str.erase(str.begin()); - while (str.size() < 4) + while (str.size() < maxCards) str.push_back(0); const ItemColor color = ItemColorManager::getColorFromCards(&str[0]); |