diff options
Diffstat (limited to 'src/gui/npcpostdialog.cpp')
-rw-r--r-- | src/gui/npcpostdialog.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/gui/npcpostdialog.cpp b/src/gui/npcpostdialog.cpp index 19d0cf61..c53203be 100644 --- a/src/gui/npcpostdialog.cpp +++ b/src/gui/npcpostdialog.cpp @@ -21,10 +21,10 @@ #include "gui/npcpostdialog.h" -#include "npc.h" +#include "event.h" +#include "playerinfo.h" #include "gui/widgets/button.h" -#include "gui/widgets/chattab.h" #include "gui/widgets/label.h" #include "gui/widgets/textbox.h" #include "gui/widgets/textfield.h" @@ -80,11 +80,14 @@ NpcPostDialog::NpcPostDialog(int npcId): instances.push_back(this); setVisible(true); + + PlayerInfo::setNPCPostCount(PlayerInfo::getNPCPostCount() + 1); } NpcPostDialog::~NpcPostDialog() { instances.remove(this); + PlayerInfo::setNPCPostCount(PlayerInfo::getNPCPostCount() - 1); } void NpcPostDialog::action(const gcn::ActionEvent &event) @@ -93,12 +96,12 @@ void NpcPostDialog::action(const gcn::ActionEvent &event) { if (mSender->getText().empty() || mText->getText().empty()) { - localChatTab->chatLog(_("Failed to send as sender or letter " - "invalid.")); + SERVER_NOTICE(_("Failed to send as sender or letter invalid.")) } else { - Net::getNpcHandler()->sendLetter(mNpcId, mSender->getText(), + Net::getNpcHandler()->sendLetter(mNpcId, + mSender->getText(), mText->getText()); } setVisible(false); |