From d40c669b3d8e11d2ddeea43cbc8d7c6a053c9da2 Mon Sep 17 00:00:00 2001 From: Chuck Miller Date: Sat, 2 May 2009 01:44:59 -0400 Subject: Changed chat window to allow downwards arrow to create a empty line Minor: removed some debugging output no longer needed --- src/gui/chat.cpp | 25 ++++++++++++++++--------- src/net/ea/npchandler.cpp | 1 - 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp index 9930fe06..a830f556 100644 --- a/src/gui/chat.cpp +++ b/src/gui/chat.cpp @@ -359,20 +359,27 @@ void ChatWindow::scroll(int amount) void ChatWindow::keyPressed(gcn::KeyEvent &event) { - if (event.getKey().getValue() == Key::DOWN && - mCurHist != mHistory.end()) + if (event.getKey().getValue() == Key::DOWN) { - // Move forward through the history - HistoryIterator prevHist = mCurHist++; - if (mCurHist != mHistory.end()) { - mChatInput->setText(*mCurHist); - mChatInput->setCaretPosition(mChatInput->getText().length()); + // Move forward through the history + HistoryIterator prevHist = mCurHist++; + + if (mCurHist != mHistory.end()) + { + mChatInput->setText(*mCurHist); + mChatInput->setCaretPosition(mChatInput->getText().length()); + } + else + { + mChatInput->setText(""); + mCurHist = prevHist; + } } - else + else if (mChatInput->getText() != "") { - mCurHist = prevHist; + mChatInput->setText(""); } } else if (event.getKey().getValue() == Key::UP && diff --git a/src/net/ea/npchandler.cpp b/src/net/ea/npchandler.cpp index 16137476..abdac169 100644 --- a/src/net/ea/npchandler.cpp +++ b/src/net/ea/npchandler.cpp @@ -158,7 +158,6 @@ void NpcHandler::integerInput(int npcId, int value) void NpcHandler::stringInput(int npcId, const std::string &value) { - printf("I got a %s", value.c_str()); MessageOut outMsg(CMSG_NPC_STR_RESPONSE); outMsg.writeInt16(value.length() + 9); outMsg.writeInt32(npcId); -- cgit v1.2.3-70-g09d2