diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-04-30 13:29:45 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-04-30 13:29:45 +0000 |
commit | ad3623ced5020c9c886cb85100ae05efa460f84a (patch) | |
tree | 2f01f33e4bf0f5e20f81a7d3f64cd6466381df95 /src/gui | |
parent | 22799314e68a0535f65cc7aa56c490cdde7ca544 (diff) | |
download | mana-ad3623ced5020c9c886cb85100ae05efa460f84a.tar.gz mana-ad3623ced5020c9c886cb85100ae05efa460f84a.tar.bz2 mana-ad3623ced5020c9c886cb85100ae05efa460f84a.tar.xz mana-ad3623ced5020c9c886cb85100ae05efa460f84a.zip |
Some fixes to player control, also attempting to solve long walk path problem.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/chat.cpp | 8 | ||||
-rw-r--r-- | src/gui/gui.cpp | 6 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp index 49841623..380d9d13 100644 --- a/src/gui/chat.cpp +++ b/src/gui/chat.cpp @@ -213,13 +213,21 @@ void ChatWindow::action(const std::string& eventId) std::string message = chatInput->getText(); if (message.length() > 0) { + // If message different from previous, put it in the history if (history.size() == 0 || message != history.back()) { history.push_back(message); } + + // Reset history iterator curHist = history.end(); + + // Send the message to the server chat_send(char_info[0].name, message.c_str()); + + // Clear the text from the chat input chatInput->setText(""); } + gui->focusNone(); } } diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index d9ab90bd..5ef31a78 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -101,9 +101,11 @@ void Gui::draw() void Gui::mousePress(int mx, int my, int button) { // Mouse pressed on window container (basically, the map) - // Experimental mouse walk support - if (button == gcn::MouseInput::LEFT) { + // When conditions for walking are met, set new player destination + if (player_node->action != DEAD && current_npc == 0 && + button == gcn::MouseInput::LEFT) + { int tilex = mx / 32 + camera_x; int tiley = my / 32 + camera_y; |