summaryrefslogtreecommitdiff
path: root/src/gui/outfitwindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-02-25 01:20:00 +0200
committerAndrei Karas <akaras@inbox.ru>2011-02-25 01:38:14 +0200
commit5322d978519f9d5677d2096e1167439c84b23cd1 (patch)
treedfe6324fb6d3b573290687716dd98e45efb76019 /src/gui/outfitwindow.cpp
parent473dc9b1949ba7c51b59146815969b723a748d6d (diff)
downloadmanaplus-5322d978519f9d5677d2096e1167439c84b23cd1.tar.gz
manaplus-5322d978519f9d5677d2096e1167439c84b23cd1.tar.bz2
manaplus-5322d978519f9d5677d2096e1167439c84b23cd1.tar.xz
manaplus-5322d978519f9d5677d2096e1167439c84b23cd1.zip
Add tabs to spells window. Now it 5 tabs.
Also dont save to configs default cell items for different item containers.
Diffstat (limited to 'src/gui/outfitwindow.cpp')
-rw-r--r--src/gui/outfitwindow.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/gui/outfitwindow.cpp b/src/gui/outfitwindow.cpp
index ddd337767..2796e13c8 100644
--- a/src/gui/outfitwindow.cpp
+++ b/src/gui/outfitwindow.cpp
@@ -157,14 +157,25 @@ void OutfitWindow::save()
std::string outfitStr;
for (int o = 0; o < OUTFITS_COUNT; o++)
{
+ bool good = false;
for (int i = 0; i < OUTFIT_ITEM_COUNT; i++)
{
- outfitStr += mItems[o][i] ? toString(mItems[o][i]) : toString(-1);
+ int res = mItems[o][i] ? mItems[o][i] : -1;
+ if (res != -1)
+ good = true;
+ outfitStr += toString(res);
if (i < OUTFIT_ITEM_COUNT - 1)
outfitStr += " ";
}
- serverConfig.setValue("Outfit" + toString(o), outfitStr);
- serverConfig.setValue("OutfitUnequip" + toString(o), mItemsUnequip[o]);
+ if (good)
+ serverConfig.setValue("Outfit" + toString(o), outfitStr);
+ else
+ serverConfig.deleteKey("Outfit" + toString(o));
+
+ if (mItemsUnequip[o])
+ serverConfig.deleteKey("OutfitUnequip" + toString(o));
+ else
+ serverConfig.setValue("OutfitUnequip" + toString(o), mItemsUnequip[o]);
outfitStr = "";
}
serverConfig.setValue("OutfitAwayIndex", mAwayOutfit);