diff options
author | Chuck Miller <shadowmil@gmail.com> | 2009-05-02 01:44:59 -0400 |
---|---|---|
committer | Chuck Miller <shadowmil@gmail.com> | 2009-05-02 01:44:59 -0400 |
commit | d40c669b3d8e11d2ddeea43cbc8d7c6a053c9da2 (patch) | |
tree | da5afbd83a9fdef41d0d53f647dc5727be2f5fcb | |
parent | 51d6f634eecae2a9e68078a7272353b8b61fd4e1 (diff) | |
download | mana-d40c669b3d8e11d2ddeea43cbc8d7c6a053c9da2.tar.gz mana-d40c669b3d8e11d2ddeea43cbc8d7c6a053c9da2.tar.bz2 mana-d40c669b3d8e11d2ddeea43cbc8d7c6a053c9da2.tar.xz mana-d40c669b3d8e11d2ddeea43cbc8d7c6a053c9da2.zip |
Changed chat window to allow downwards arrow to create a empty line
Minor: removed some debugging output no longer needed
-rw-r--r-- | src/gui/chat.cpp | 25 | ||||
-rw-r--r-- | 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); |