From 19c49d794657f87cf07790b3fad6dae09f8005df Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 26 Aug 2017 17:42:49 +0300 Subject: Show/hide get attach button in mail view window based on attached items and money. --- src/net/eathena/mail2recv.cpp | 1 + src/net/eathena/mailrecv.cpp | 4 ++++ 2 files changed, 5 insertions(+) (limited to 'src/net') diff --git a/src/net/eathena/mail2recv.cpp b/src/net/eathena/mail2recv.cpp index 14ae54383..1cb2a7f58 100644 --- a/src/net/eathena/mail2recv.cpp +++ b/src/net/eathena/mail2recv.cpp @@ -442,6 +442,7 @@ void Mail2Recv::processReadMail(Net::MessageIn &msg) inventory->setOptions(slot, options); delete options; } + mailViewWindow->updateItems(); } void Mail2Recv::processMailDelete(Net::MessageIn &msg) diff --git a/src/net/eathena/mailrecv.cpp b/src/net/eathena/mailrecv.cpp index ac638b300..d8897f38c 100644 --- a/src/net/eathena/mailrecv.cpp +++ b/src/net/eathena/mailrecv.cpp @@ -26,6 +26,7 @@ #include "gui/mailmessage.h" +#include "gui/windows/mailviewwindow.h" #include "gui/windows/mailwindow.h" #include "net/mailhandler.h" @@ -111,6 +112,9 @@ void MailRecv::processReadMail(Net::MessageIn &msg) msg.readUInt8("zero"); mail->strTime = timeToStr(mail->time); mailWindow->showMessage(mail, mail->itemId != 0 ? 1 : 0); + // +++ here need add item into item container + if (mailViewWindow) + mailViewWindow->updateItems(); } void MailRecv::processGetAttachment(Net::MessageIn &msg) -- cgit v1.2.3-60-g2f50