diff options
Diffstat (limited to 'src/gui/item_amount.cpp')
-rw-r--r-- | src/gui/item_amount.cpp | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/src/gui/item_amount.cpp b/src/gui/item_amount.cpp index 5b3380c2..0f6aa593 100644 --- a/src/gui/item_amount.cpp +++ b/src/gui/item_amount.cpp @@ -1,9 +1,8 @@ /* - * Aethyra + * The Mana World * Copyright (C) 2004 The Mana World Development Team * - * This file is part of Aethyra based on original code - * from The Mana World. + * This file is part of The Mana World. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -24,7 +23,9 @@ #include "item_amount.h" #include "label.h" #include "slider.h" +#ifdef EATHENA_SUPPORT #include "storagewindow.h" +#endif #include "trade.h" #include "widgets/layout.h" @@ -35,12 +36,16 @@ #include "../utils/gettext.h" #include "../utils/strprintf.h" -ItemAmountWindow::ItemAmountWindow(int usage, Window *parent, Item *item): +ItemAmountWindow::ItemAmountWindow(int usage, Window *parent, Item *item, + int maxRange): Window("", true, parent), mItem(item), - mMax(item->getQuantity()), + mMax(maxRange), mUsage(usage) { + if (!mMax) + mMax = mItem->getQuantity(); + setCloseButton(true); // Integer field @@ -94,6 +99,9 @@ ItemAmountWindow::ItemAmountWindow(int usage, Window *parent, Item *item): case AMOUNT_STORE_REMOVE: setCaption(_("Select amount of items to retrieve.")); break; + case AMOUNT_ITEM_SPLIT: + setCaption(_("Select amount of items to split.")); + break; default: break; } @@ -140,12 +148,18 @@ void ItemAmountWindow::action(const gcn::ActionEvent &event) case AMOUNT_ITEM_DROP: player_node->dropItem(mItem, amount); break; +#ifdef TMWSERV_SUPPORT + case AMOUNT_ITEM_SPLIT: + player_node->splitItem(mItem, amount); + break; +#else case AMOUNT_STORE_ADD: storageWindow->addStore(mItem, amount); break; case AMOUNT_STORE_REMOVE: storageWindow->removeStore(mItem, amount); break; +#endif default: return; break; |