summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-01-24 15:31:06 +0300
committerAndrei Karas <akaras@inbox.ru>2015-01-24 15:31:06 +0300
commit3f5c128b889b4cb41f9782fe1531c55e7d07432f (patch)
treeb5903e10142f876d29bf4d4643261f1b058fefe9 /src/gui
parentc53839e9125a72e2bbc5e479934b5b9111bef5d6 (diff)
downloadmanaverse-3f5c128b889b4cb41f9782fe1531c55e7d07432f.tar.gz
manaverse-3f5c128b889b4cb41f9782fe1531c55e7d07432f.tar.bz2
manaverse-3f5c128b889b4cb41f9782fe1531c55e7d07432f.tar.xz
manaverse-3f5c128b889b4cb41f9782fe1531c55e7d07432f.zip
Move inventory type into separate file.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/popups/popupmenu.cpp8
-rw-r--r--src/gui/widgets/itemcontainer.cpp24
-rw-r--r--src/gui/windows/inventorywindow.cpp56
-rw-r--r--src/gui/windows/itemamountwindow.cpp8
-rw-r--r--src/gui/windows/ministatuswindow.cpp2
-rw-r--r--src/gui/windows/npcdialog.cpp2
-rw-r--r--src/gui/windows/tradewindow.cpp4
7 files changed, 52 insertions, 52 deletions
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp
index 365970fa4..af207dffe 100644
--- a/src/gui/popups/popupmenu.cpp
+++ b/src/gui/popups/popupmenu.cpp
@@ -1631,7 +1631,7 @@ void PopupMenu::showPopup(Window *const parent,
switch (type)
{
- case Inventory::INVENTORY:
+ case InventoryType::INVENTORY:
if (tradeWindow && tradeWindow->isWindowVisible() && !isProtected)
{
// TRANSLATORS: popup menu item
@@ -1693,7 +1693,7 @@ void PopupMenu::showPopup(Window *const parent,
addUseDrop(item, isProtected);
break;
- case Inventory::STORAGE:
+ case InventoryType::STORAGE:
// TRANSLATORS: popup menu item
// TRANSLATORS: get item from storage
mBrowserBox->addRow("/storagetoinv 'INVINDEX'", _("Retrieve"));
@@ -1721,8 +1721,8 @@ void PopupMenu::showPopup(Window *const parent,
}
break;
- case Inventory::CART:
- case Inventory::TRADE:
+ case InventoryType::CART:
+ case InventoryType::TRADE:
default:
break;
}
diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp
index 391f9d741..528e751fb 100644
--- a/src/gui/widgets/itemcontainer.cpp
+++ b/src/gui/widgets/itemcontainer.cpp
@@ -411,16 +411,16 @@ void ItemContainer::mousePressed(MouseEvent &event)
DragDropSource src = DRAGDROP_SOURCE_EMPTY;
switch (mInventory->getType())
{
- case Inventory::INVENTORY:
+ case InventoryType::INVENTORY:
src = DRAGDROP_SOURCE_INVENTORY;
break;
- case Inventory::STORAGE:
+ case InventoryType::STORAGE:
src = DRAGDROP_SOURCE_STORAGE;
break;
- case Inventory::TRADE:
+ case InventoryType::TRADE:
src = DRAGDROP_SOURCE_TRADE;
break;
- case Inventory::NPC:
+ case InventoryType::NPC:
src = DRAGDROP_SOURCE_NPC;
break;
default:
@@ -506,16 +506,16 @@ void ItemContainer::mouseReleased(MouseEvent &event)
DragDropSource dst = DRAGDROP_SOURCE_EMPTY;
switch (mInventory->getType())
{
- case Inventory::INVENTORY:
+ case InventoryType::INVENTORY:
dst = DRAGDROP_SOURCE_INVENTORY;
break;
- case Inventory::STORAGE:
+ case InventoryType::STORAGE:
dst = DRAGDROP_SOURCE_STORAGE;
break;
- case Inventory::TRADE:
+ case InventoryType::TRADE:
dst = DRAGDROP_SOURCE_TRADE;
break;
- case Inventory::NPC:
+ case InventoryType::NPC:
dst = DRAGDROP_SOURCE_NPC;
break;
default:
@@ -528,15 +528,15 @@ void ItemContainer::mouseReleased(MouseEvent &event)
if (src == DRAGDROP_SOURCE_INVENTORY
&& dst == DRAGDROP_SOURCE_STORAGE)
{
- srcContainer = Inventory::INVENTORY;
- dstContainer = Inventory::STORAGE;
+ srcContainer = InventoryType::INVENTORY;
+ dstContainer = InventoryType::STORAGE;
inventory = PlayerInfo::getInventory();
}
else if (src == DRAGDROP_SOURCE_STORAGE
&& dst == DRAGDROP_SOURCE_INVENTORY)
{
- srcContainer = Inventory::STORAGE;
- dstContainer = Inventory::INVENTORY;
+ srcContainer = InventoryType::STORAGE;
+ dstContainer = InventoryType::INVENTORY;
inventory = PlayerInfo::getStorageInventory();
}
if (src == DRAGDROP_SOURCE_INVENTORY
diff --git a/src/gui/windows/inventorywindow.cpp b/src/gui/windows/inventorywindow.cpp
index 80f9cc5fd..535f87f59 100644
--- a/src/gui/windows/inventorywindow.cpp
+++ b/src/gui/windows/inventorywindow.cpp
@@ -117,18 +117,18 @@ InventoryWindow::InventoryWindow(Inventory *const inventory) :
setWindowName(inventory->getName());
switch (inventory->getType())
{
- case Inventory::INVENTORY:
- case Inventory::TRADE:
- case Inventory::NPC:
+ case InventoryType::INVENTORY:
+ case InventoryType::TRADE:
+ case InventoryType::NPC:
default:
mSortDropDown->setSelected(config.getIntValue(
"inventorySortOrder"));
break;
- case Inventory::STORAGE:
+ case InventoryType::STORAGE:
mSortDropDown->setSelected(config.getIntValue(
"storageSortOrder"));
break;
- case Inventory::CART:
+ case InventoryType::CART:
mSortDropDown->setSelected(config.getIntValue(
"cartSortOrder"));
break;
@@ -176,7 +176,7 @@ InventoryWindow::InventoryWindow(Inventory *const inventory) :
switch (mInventory->getType())
{
- case Inventory::INVENTORY:
+ case InventoryType::INVENTORY:
{
// TRANSLATORS: inventory button
const std::string equip = _("Equip");
@@ -233,7 +233,7 @@ InventoryWindow::InventoryWindow(Inventory *const inventory) :
break;
}
- case Inventory::STORAGE:
+ case InventoryType::STORAGE:
{
// TRANSLATORS: storage button
mStoreButton = new Button(this, _("Store"), "store", this);
@@ -255,7 +255,7 @@ InventoryWindow::InventoryWindow(Inventory *const inventory) :
break;
}
- case Inventory::CART:
+ case InventoryType::CART:
{
// TRANSLATORS: storage button
mStoreButton = new Button(this, _("Store"), "store", this);
@@ -278,8 +278,8 @@ InventoryWindow::InventoryWindow(Inventory *const inventory) :
}
default:
- case Inventory::TRADE:
- case Inventory::NPC:
+ case InventoryType::TRADE:
+ case InventoryType::NPC:
break;
};
@@ -310,7 +310,7 @@ void InventoryWindow::postInit()
mItems->setSortType(mSortDropDown->getSelected());
widgetResized(Event(nullptr));
- if (mInventory->getType() == Inventory::INVENTORY)
+ if (mInventory->getType() == InventoryType::INVENTORY)
setVisible(true);
}
@@ -332,18 +332,18 @@ void InventoryWindow::storeSortOrder() const
{
switch (mInventory->getType())
{
- case Inventory::INVENTORY:
- case Inventory::TRADE:
- case Inventory::NPC:
+ case InventoryType::INVENTORY:
+ case InventoryType::TRADE:
+ case InventoryType::NPC:
default:
config.setValue("inventorySortOrder",
mSortDropDown->getSelected());
break;
- case Inventory::STORAGE:
+ case InventoryType::STORAGE:
config.setValue("storageSortOrder",
mSortDropDown->getSelected());
break;
- case Inventory::CART:
+ case InventoryType::CART:
config.setValue("cartSortOrder",
mSortDropDown->getSelected());
break;
@@ -421,9 +421,9 @@ void InventoryWindow::action(const ActionEvent &event)
{
if (isStorageActive())
{
- inventoryHandler->moveItem2(Inventory::INVENTORY,
+ inventoryHandler->moveItem2(InventoryType::INVENTORY,
item->getInvIndex(), item->getQuantity(),
- Inventory::STORAGE);
+ InventoryType::STORAGE);
}
else
{
@@ -526,9 +526,9 @@ void InventoryWindow::mouseClicked(MouseEvent &event)
}
else
{
- inventoryHandler->moveItem2(Inventory::INVENTORY,
+ inventoryHandler->moveItem2(InventoryType::INVENTORY,
item->getInvIndex(), item->getQuantity(),
- Inventory::STORAGE);
+ InventoryType::STORAGE);
}
}
else
@@ -540,9 +540,9 @@ void InventoryWindow::mouseClicked(MouseEvent &event)
}
else
{
- inventoryHandler->moveItem2(Inventory::STORAGE,
+ inventoryHandler->moveItem2(InventoryType::STORAGE,
item->getInvIndex(), item->getQuantity(),
- Inventory::INVENTORY);
+ InventoryType::INVENTORY);
}
}
}
@@ -711,23 +711,23 @@ void InventoryWindow::close()
{
switch (mInventory->getType())
{
- case Inventory::INVENTORY:
- case Inventory::CART:
+ case InventoryType::INVENTORY:
+ case InventoryType::CART:
setVisible(false);
break;
- case Inventory::STORAGE:
+ case InventoryType::STORAGE:
if (inventoryHandler)
{
- inventoryHandler->closeStorage(Inventory::STORAGE);
+ inventoryHandler->closeStorage(InventoryType::STORAGE);
inventoryHandler->forgotStorage();
}
scheduleDelete();
break;
default:
- case Inventory::TRADE:
- case Inventory::NPC:
+ case InventoryType::TRADE:
+ case InventoryType::NPC:
break;
}
}
diff --git a/src/gui/windows/itemamountwindow.cpp b/src/gui/windows/itemamountwindow.cpp
index 0715a2bbe..19d18eef8 100644
--- a/src/gui/windows/itemamountwindow.cpp
+++ b/src/gui/windows/itemamountwindow.cpp
@@ -69,12 +69,12 @@ void ItemAmountWindow::finish(const Item *const item,
inventoryHandler->splitItem(item, amount);
break;
case StoreAdd:
- inventoryHandler->moveItem2(Inventory::INVENTORY,
- item->getInvIndex(), amount, Inventory::STORAGE);
+ inventoryHandler->moveItem2(InventoryType::INVENTORY,
+ item->getInvIndex(), amount, InventoryType::STORAGE);
break;
case StoreRemove:
- inventoryHandler->moveItem2(Inventory::STORAGE,
- item->getInvIndex(), amount, Inventory::INVENTORY);
+ inventoryHandler->moveItem2(InventoryType::STORAGE,
+ item->getInvIndex(), amount, InventoryType::INVENTORY);
break;
case ShopBuyAdd:
if (shopWindow)
diff --git a/src/gui/windows/ministatuswindow.cpp b/src/gui/windows/ministatuswindow.cpp
index 02f1f8400..ec2cf05b2 100644
--- a/src/gui/windows/ministatuswindow.cpp
+++ b/src/gui/windows/ministatuswindow.cpp
@@ -527,7 +527,7 @@ void MiniStatusWindow::slotsChanged(Inventory *const inventory)
if (!inventory)
return;
- if (inventory->getType() == Inventory::INVENTORY)
+ if (inventory->getType() == InventoryType::INVENTORY)
StatusWindow::updateInvSlotsBar(mInvSlotsBar);
}
diff --git a/src/gui/windows/npcdialog.cpp b/src/gui/windows/npcdialog.cpp
index 6eeb3153f..fa5cb21d7 100644
--- a/src/gui/windows/npcdialog.cpp
+++ b/src/gui/windows/npcdialog.cpp
@@ -116,7 +116,7 @@ NpcDialog::NpcDialog(const int npcId) :
mButton3(new Button(this, _("Add"), "add", this)),
// TRANSLATORS: npc dialog button
mResetButton(new Button(this, _("Reset"), "reset", this)),
- mInventory(new Inventory(Inventory::NPC, 1)),
+ mInventory(new Inventory(InventoryType::NPC, 1)),
mItemContainer(new ItemContainer(this, mInventory)),
mItemScrollArea(new ScrollArea(this, mItemContainer,
getOptionBool("showitemsbackground"), "npc_listbackground.xml")),
diff --git a/src/gui/windows/tradewindow.cpp b/src/gui/windows/tradewindow.cpp
index 1ed169181..c15e56f44 100644
--- a/src/gui/windows/tradewindow.cpp
+++ b/src/gui/windows/tradewindow.cpp
@@ -75,8 +75,8 @@ TradeWindow::TradeWindow() :
Window(_("Trade: You"), false, nullptr, "trade.xml"),
ActionListener(),
SelectionListener(),
- mMyInventory(new Inventory(Inventory::TRADE)),
- mPartnerInventory(new Inventory(Inventory::TRADE)),
+ mMyInventory(new Inventory(InventoryType::TRADE)),
+ mPartnerInventory(new Inventory(InventoryType::TRADE)),
mMyItemContainer(new ItemContainer(this, mMyInventory)),
mPartnerItemContainer(new ItemContainer(this, mPartnerInventory)),
// TRANSLATORS: trade window money label