diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-04-26 00:04:45 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-04-26 00:04:45 +0000 |
commit | 8b0e30d3798cd5bdce2c3a34a3c384e90dceac99 (patch) | |
tree | 3fdca13a0cc138ed65b72de8cd3747cc79916818 /src/gui | |
parent | a31ba215a3043ebd62d415a7d855a531239fb630 (diff) | |
download | mana-8b0e30d3798cd5bdce2c3a34a3c384e90dceac99.tar.gz mana-8b0e30d3798cd5bdce2c3a34a3c384e90dceac99.tar.bz2 mana-8b0e30d3798cd5bdce2c3a34a3c384e90dceac99.tar.xz mana-8b0e30d3798cd5bdce2c3a34a3c384e90dceac99.zip |
Changed keyboard control to integrate better with mouse walk, changed location
of packet.list and chatlog.txt and removed name from player chat "balloon".
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/chat.cpp | 14 | ||||
-rw-r--r-- | src/gui/chat.h | 8 | ||||
-rw-r--r-- | src/gui/gui.cpp | 13 | ||||
-rw-r--r-- | src/gui/window.h | 2 |
4 files changed, 18 insertions, 19 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp index b7051a3b..fac868c5 100644 --- a/src/gui/chat.cpp +++ b/src/gui/chat.cpp @@ -69,15 +69,15 @@ void ChatWindow::chat_log(std::string line, int own) pos = 0; pos = (int)line.find(" : ", 0); if (pos > 0) { - tmp.nick = line.substr(0,pos); + tmp.nick = line.substr(0, pos); switch (own) { - case ACT_IS : + case ACT_IS: tmp.nick += CAT_IS; break; - case ACT_WHISPER : + case ACT_WHISPER: tmp.nick += CAT_WHISPER; break; - default : + default: tmp.nick += CAT_NORMAL; } line.erase(0, pos + 3); @@ -85,7 +85,7 @@ void ChatWindow::chat_log(std::string line, int own) tmp.nick = ""; } tmp.own = own; - + // A try to get text sentences no too long... bool finished = false; unsigned int maxLength = 80; @@ -94,7 +94,7 @@ void ChatWindow::chat_log(std::string line, int own) { std::string tempText; if (line.length() > maxLength) - { + { tempText = line; if (line.length() > maxLength) @@ -108,7 +108,7 @@ void ChatWindow::chat_log(std::string line, int own) chatlog.push_front(tmp); } else // Normal message - { + { tmp.text = line; //chatlog_file << tmp.nick << tmp.text << "\n"; //chatlog_file.flush(); diff --git a/src/gui/chat.h b/src/gui/chat.h index ad3d5e39..4aabe4c2 100644 --- a/src/gui/chat.h +++ b/src/gui/chat.h @@ -136,14 +136,14 @@ class ChatWindow : public Window, public gcn::ActionListener { * Request focus. */ void requestFocus(); - + /** - * Checks wether ChatWindow is Focused or not + * Checks whether ChatWindow is Focused or not. */ bool isFocused(); - + /* - * Determines wether to send a command or an ordinary message, then + * Determines whether to send a command or an ordinary message, then * contructs packets & sends them * * @param nick The character's name to display in front. diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 6a57f214..d9ab90bd 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -34,7 +34,8 @@ Graphics *guiGraphics; // Graphics driver gcn::SDLInput *guiInput; // GUI input WindowContainer *guiTop; // The top container -Gui::Gui(Graphics *graphics) +Gui::Gui(Graphics *graphics): + hostImageLoader(NULL) { // Set graphics guiGraphics = graphics; @@ -75,9 +76,9 @@ Gui::~Gui() delete guiFont; delete guiTop; delete imageLoader; -#ifdef USE_OPENGL - delete hostImageLoader; -#endif + if (hostImageLoader) { + delete hostImageLoader; + } delete guiInput; } @@ -108,9 +109,7 @@ void Gui::mousePress(int mx, int my, int button) if (state == GAME && tiledMap->getWalk(tilex, tiley)) { walk(tilex, tiley, 0); - player_node->setPath(tiledMap->findPath( - player_node->x, player_node->y, - tilex, tiley)); + player_node->setDestination(tilex, tiley); } } } diff --git a/src/gui/window.h b/src/gui/window.h index f2f87cc0..4a0f08c3 100644 --- a/src/gui/window.h +++ b/src/gui/window.h @@ -163,7 +163,7 @@ class Window : public gcn::Window, public ConfigListener Window *getParentWindow(); /** - * Returns wether this window is modal. This doesn't necessarily mean + * Returns whether this window is modal. This doesn't necessarily mean * that is gets input as a child modal window could get it. */ bool isModal(); |