summaryrefslogtreecommitdiff
path: root/src/gui/widgets/itemcontainer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/itemcontainer.cpp')
-rw-r--r--src/gui/widgets/itemcontainer.cpp48
1 files changed, 25 insertions, 23 deletions
diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp
index af1d24397..3b8f349e4 100644
--- a/src/gui/widgets/itemcontainer.cpp
+++ b/src/gui/widgets/itemcontainer.cpp
@@ -1,11 +1,11 @@
/*
- * The ManaPlus Client
+ * The ManaVerse Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
* Copyright (C) 2011-2020 The ManaPlus Developers
- * Copyright (C) 2020-2023 The ManaVerse Developers
+ * Copyright (C) 2020-2025 The ManaVerse Developers
*
- * This file is part of The ManaPlus Client.
+ * This file is part of The ManaVerse Client.
*
* 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
@@ -422,8 +422,9 @@ void ItemContainer::draw(Graphics *const graphics)
graphics->drawImage(image,
itemX + mPaddingItemX,
itemY + mPaddingItemY);
- if ((mProtectedImg != nullptr) && PlayerInfo::isItemProtected(
- item->getId()))
+
+ if ((mProtectedImg != nullptr) &&
+ PlayerInfo::isItemProtected(item->getId()))
{
graphics->drawImage(mProtectedImg,
itemX + mPaddingItemX,
@@ -544,8 +545,8 @@ void ItemContainer::safeDraw(Graphics *const graphics)
graphics->drawImage(image,
itemX + mPaddingItemX,
itemY + mPaddingItemY);
- if ((mProtectedImg != nullptr) && PlayerInfo::isItemProtected(
- item->getId()))
+ if ((mProtectedImg != nullptr) &&
+ PlayerInfo::isItemProtected(item->getId()))
{
graphics->drawImage(mProtectedImg,
itemX + mPaddingItemX,
@@ -829,29 +830,30 @@ void ItemContainer::mouseReleased(MouseEvent &event)
InventoryTypeT dstContainer = InventoryType::TypeEnd;
bool checkProtection(false);
Inventory *inventory = nullptr;
- if (src == DragDropSource::Inventory
- && dst == DragDropSource::Storage)
+
+ if (src == DragDropSource::Inventory &&
+ dst == DragDropSource::Storage)
{
srcContainer = InventoryType::Inventory;
dstContainer = InventoryType::Storage;
inventory = PlayerInfo::getInventory();
}
- else if (src == DragDropSource::Storage
- && dst == DragDropSource::Inventory)
+ else if (src == DragDropSource::Storage &&
+ dst == DragDropSource::Inventory)
{
srcContainer = InventoryType::Storage;
dstContainer = InventoryType::Inventory;
inventory = PlayerInfo::getStorageInventory();
}
- if (src == DragDropSource::Inventory
- && dst == DragDropSource::Cart)
+ else if (src == DragDropSource::Inventory &&
+ dst == DragDropSource::Cart)
{
srcContainer = InventoryType::Inventory;
dstContainer = InventoryType::Cart;
inventory = PlayerInfo::getInventory();
}
- if (src == DragDropSource::Inventory
- && dst == DragDropSource::Inventory)
+ else if (src == DragDropSource::Inventory &&
+ dst == DragDropSource::Inventory)
{
if (Net::getNetworkType() == ServerType::TMWATHENA)
return;
@@ -864,29 +866,29 @@ void ItemContainer::mouseReleased(MouseEvent &event)
inventoryWindow->combineItems(index, mSelectedIndex);
return;
}
- else if (src == DragDropSource::Cart
- && dst == DragDropSource::Inventory)
+ else if (src == DragDropSource::Cart &&
+ dst == DragDropSource::Inventory)
{
srcContainer = InventoryType::Cart;
dstContainer = InventoryType::Inventory;
inventory = PlayerInfo::getCartInventory();
}
- else if (src == DragDropSource::Cart
- && dst == DragDropSource::Storage)
+ else if (src == DragDropSource::Cart &&
+ dst == DragDropSource::Storage)
{
srcContainer = InventoryType::Cart;
dstContainer = InventoryType::Storage;
inventory = PlayerInfo::getCartInventory();
}
- else if (src == DragDropSource::Storage
- && dst == DragDropSource::Cart)
+ else if (src == DragDropSource::Storage &&
+ dst == DragDropSource::Cart)
{
srcContainer = InventoryType::Storage;
dstContainer = InventoryType::Cart;
inventory = PlayerInfo::getStorageInventory();
}
- if (src == DragDropSource::Inventory
- && dst == DragDropSource::Trade)
+ else if (src == DragDropSource::Inventory &&
+ dst == DragDropSource::Trade)
{
checkProtection = true;
inventory = PlayerInfo::getInventory();