From 07011b04bb619663d41ea0cc2bb9960157c3b846 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 25 Aug 2017 00:55:26 +0300 Subject: Update item container after each change in mail edit window. --- src/gui/windows/maileditwindow.cpp | 5 +++++ src/gui/windows/maileditwindow.h | 2 ++ src/net/eathena/mail2recv.cpp | 2 ++ 3 files changed, 9 insertions(+) (limited to 'src') diff --git a/src/gui/windows/maileditwindow.cpp b/src/gui/windows/maileditwindow.cpp index 0abaaee74..47b4d409e 100644 --- a/src/gui/windows/maileditwindow.cpp +++ b/src/gui/windows/maileditwindow.cpp @@ -235,3 +235,8 @@ void MailEditWindow::sendMail() mMessageField->getText()); } } + +void MailEditWindow::updateItems() +{ + mItemContainer->updateMatrix(); +} diff --git a/src/gui/windows/maileditwindow.h b/src/gui/windows/maileditwindow.h index 031a1545d..37d983c1c 100644 --- a/src/gui/windows/maileditwindow.h +++ b/src/gui/windows/maileditwindow.h @@ -58,6 +58,8 @@ class MailEditWindow final : public Window, Inventory *getInventory() const A_WARN_UNUSED; + void updateItems(); + private: void sendMail(); diff --git a/src/net/eathena/mail2recv.cpp b/src/net/eathena/mail2recv.cpp index bb0403681..3b6b7ed1a 100644 --- a/src/net/eathena/mail2recv.cpp +++ b/src/net/eathena/mail2recv.cpp @@ -164,6 +164,7 @@ void Mail2Recv::processAddItemResult(Net::MessageIn &msg) inventory->setCards(slot, cards, 4); inventory->setOptions(slot, options); inventory->setTag(slot, index); + mailEditWindow->updateItems(); delete options; } @@ -224,6 +225,7 @@ void Mail2Recv::processRemoveItemResult(Net::MessageIn &msg) } item->increaseQuantity(-amount); + mailEditWindow->updateItems(); } void Mail2Recv::processCheckNameResult(Net::MessageIn &msg) -- cgit v1.2.3-70-g09d2