diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-04-29 22:17:00 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-04-29 22:17:00 +0000 |
commit | b7dfc4d660d3ad930610c4f6af35d8e916a7feb8 (patch) | |
tree | 29e3d8c42a34a113c25e995e6a82f47687ed1e97 /src/gui/chat.h | |
parent | b4ddbd772ae2039ec9e23ce85f16f07f3533edd4 (diff) | |
download | mana-b7dfc4d660d3ad930610c4f6af35d8e916a7feb8.tar.gz mana-b7dfc4d660d3ad930610c4f6af35d8e916a7feb8.tar.bz2 mana-b7dfc4d660d3ad930610c4f6af35d8e916a7feb8.tar.xz mana-b7dfc4d660d3ad930610c4f6af35d8e916a7feb8.zip |
Chat command history should now be functional. Player movement will still need
to be stopped while chat box is focussed for it to work nicely though.
Diffstat (limited to 'src/gui/chat.h')
-rw-r--r-- | src/gui/chat.h | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/gui/chat.h b/src/gui/chat.h index b078e952..4b0946f9 100644 --- a/src/gui/chat.h +++ b/src/gui/chat.h @@ -173,25 +173,20 @@ class ChatWindow : public Window, public gcn::ActionListener, */ char *chat_send(std::string nick, std::string msg); - /** History */ - void updateHistory(const char *ptr); - void arrowUp(void); - void arrowDown(void); - /** Called when key is pressed */ void keyPress(const gcn::Key& key); - private : + private: std::ofstream chatlog_file; - typedef struct CHATLOG { // list item container object + /** One item in the chat log */ + typedef struct CHATLOG { std::string nick; std::string text; int own; }; - std::list<CHATLOG> chatlog; // list object ready to accept out CHATLOG struct :) - std::list<CHATLOG>::iterator iter; + std::list<CHATLOG> chatlog; /**< Chat log */ int items; int items_keep; @@ -213,6 +208,9 @@ class ChatWindow : public Window, public gcn::ActionListener, gcn::TextField *chatInput; /**< Input box for typing chat messages */ gcn::TextBox *textOutput; /**< Text box for displaying chat history */ ScrollArea *scrollArea; /**< Scroll area around text output */ + + std::list<std::string> history; /**< Command history */ + std::list<std::string>::iterator curHist; /**< History iterator */ }; #endif |