diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-08-15 13:58:32 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-08-16 01:52:14 +0300 |
commit | 41cc92f73e39cec5dfea6b1164176610cccc7df4 (patch) | |
tree | 22fd3d388084d2c61fe80f0441c3c30ab8ffd33c /src/gui/windows/outfitwindow.cpp | |
parent | 7aa637abc8b0bca35aacdb9492e65f557ed32038 (diff) | |
download | mv-41cc92f73e39cec5dfea6b1164176610cccc7df4.tar.gz mv-41cc92f73e39cec5dfea6b1164176610cccc7df4.tar.bz2 mv-41cc92f73e39cec5dfea6b1164176610cccc7df4.tar.xz mv-41cc92f73e39cec5dfea6b1164176610cccc7df4.zip |
Add strong typed int for item color.
Diffstat (limited to 'src/gui/windows/outfitwindow.cpp')
-rw-r--r-- | src/gui/windows/outfitwindow.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gui/windows/outfitwindow.cpp b/src/gui/windows/outfitwindow.cpp index a0a7fa7c2..7ce43333b 100644 --- a/src/gui/windows/outfitwindow.cpp +++ b/src/gui/windows/outfitwindow.cpp @@ -172,7 +172,7 @@ void OutfitWindow::load(const bool oldConfig) for (size_t i = 0, sz = tokens2.size(); i < sz && i < OUTFIT_ITEM_COUNT; i++) { - mItemColors[o][i] = tokens2[i]; + mItemColors[o][i] = fromInt(tokens2[i], ItemColor); } mItemsUnequip[o] = cfg->getValueBool("OutfitUnequip" + toString(o), @@ -203,7 +203,7 @@ void OutfitWindow::save() const if (i < OUTFIT_ITEM_COUNT - 1) outfitStr.append(" "); outfitColorsStr.append(toString(static_cast<int>( - mItemColors[o][i]))); + toInt(mItemColors[o][i], int)))); if (i < OUTFIT_ITEM_COUNT - 1) outfitColorsStr.append(" "); } @@ -278,7 +278,8 @@ void OutfitWindow::wearOutfit(const int outfit, const bool unwearEmpty, for (unsigned i = 0; i < OUTFIT_ITEM_COUNT; i++) { const Item *const item = PlayerInfo::getInventory()->findItem( - mItems[outfit][i], mItemColors[outfit][i]); + mItems[outfit][i], + mItemColors[outfit][i]); if (item && item->isEquipped() == Equipped_false && item->getQuantity()) @@ -453,7 +454,7 @@ void OutfitWindow::mouseDragged(MouseEvent &event) return; } const int itemId = mItems[mCurrentOutfit][index]; - const unsigned char itemColor = mItemColors[mCurrentOutfit][index]; + const ItemColor itemColor = mItemColors[mCurrentOutfit][index]; if (itemId < 0) { Window::mouseDragged(event); @@ -719,7 +720,7 @@ void OutfitWindow::clearCurrentOutfit() for (unsigned f = 0; f < OUTFIT_ITEM_COUNT; f++) { mItems[mCurrentOutfit][f] = -1; - mItemColors[mCurrentOutfit][f] = 1; + mItemColors[mCurrentOutfit][f] = ItemColor_one; } save(); } |