diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-08-26 03:18:49 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-08-26 03:18:49 +0300 |
commit | e72b6ef50fbfe22d3c856e06db00d55643a4c148 (patch) | |
tree | 5d01d23e312dd28408d98c6146518e964f81c23b /src/gui/widgets/itemcontainer.cpp | |
parent | ee12ea1f64fe7efcbfdba7e663de1663f3367834 (diff) | |
download | manaplus-e72b6ef50fbfe22d3c856e06db00d55643a4c148.tar.gz manaplus-e72b6ef50fbfe22d3c856e06db00d55643a4c148.tar.bz2 manaplus-e72b6ef50fbfe22d3c856e06db00d55643a4c148.tar.xz manaplus-e72b6ef50fbfe22d3c856e06db00d55643a4c148.zip |
Add inventory type for mail view window. Not allow drag from/to this inventory.
Diffstat (limited to 'src/gui/widgets/itemcontainer.cpp')
-rw-r--r-- | src/gui/widgets/itemcontainer.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp index f71a7e35a..2e36ad677 100644 --- a/src/gui/widgets/itemcontainer.cpp +++ b/src/gui/widgets/itemcontainer.cpp @@ -662,7 +662,10 @@ void ItemContainer::mousePressed(MouseEvent &event) src = DragDropSource::Cart; break; case InventoryType::MailEdit: - src = DragDropSource::Mail; + src = DragDropSource::MailEdit; + break; + case InventoryType::MailView: + src = DragDropSource::MailView; break; case InventoryType::Craft: src = DragDropSource::Craft; @@ -672,6 +675,8 @@ void ItemContainer::mousePressed(MouseEvent &event) case InventoryType::TypeEnd: break; } + if (src == DragDropSource::MailView) + return; if (mSelectedIndex == index && mClicks != 2) { dragDrop.dragItem(item, src, index); @@ -769,7 +774,10 @@ void ItemContainer::mouseReleased(MouseEvent &event) dst = DragDropSource::Npc; break; case InventoryType::MailEdit: - dst = DragDropSource::Mail; + dst = DragDropSource::MailEdit; + break; + case InventoryType::MailView: + dst = DragDropSource::MailView; break; case InventoryType::Cart: dst = DragDropSource::Cart; @@ -866,7 +874,7 @@ void ItemContainer::mouseReleased(MouseEvent &event) return; } else if (src == DragDropSource::Inventory && - dst == DragDropSource::Mail) + dst == DragDropSource::MailEdit) { inventory = PlayerInfo::getInventory(); if (inventory == nullptr) @@ -1017,7 +1025,7 @@ void ItemContainer::mouseReleased(MouseEvent &event) return; } } - else if (src == DragDropSource::Mail) + else if (src == DragDropSource::MailEdit) { if (settings.enableNewMailSystem) { |