diff options
author | Joursoir <chat@joursoir.net> | 2020-11-27 01:21:10 +0300 |
---|---|---|
committer | Joursoir <chat@joursoir.net> | 2020-11-27 01:21:10 +0300 |
commit | 67cdd15d97b14dd92de28fdbdb2770187c94e338 (patch) | |
tree | 1a3acc83f0187111404047f407b042671ff5d4e0 /src/client/clui.hpp | |
parent | 6139b74876a5c8417d75c2759ce0baec4ae0e171 (diff) | |
download | want-chat-67cdd15d97b14dd92de28fdbdb2770187c94e338.tar.gz want-chat-67cdd15d97b14dd92de28fdbdb2770187c94e338.tar.bz2 want-chat-67cdd15d97b14dd92de28fdbdb2770187c94e338.zip |
one more fix chat, support spec-messages, add exit from program :)
Diffstat (limited to 'src/client/clui.hpp')
-rw-r--r-- | src/client/clui.hpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/client/clui.hpp b/src/client/clui.hpp index de47177..0373f95 100644 --- a/src/client/clui.hpp +++ b/src/client/clui.hpp @@ -4,6 +4,7 @@ #define COMMANDLINEUI_H #include <ncurses.h> +#include "../const_vars.hpp" class Interface_wc { WINDOW *w; @@ -29,8 +30,9 @@ class ChatRoom { int i_nx, i_ny; struct message { - char msg[300]; + char msg[max_msg_len]; int num_lines; // number of lines + int type; message *prev; }; message *first; @@ -39,19 +41,17 @@ public: ~ChatRoom(); // for chat: - void AddMessage(char *msg); + void AddMessage(char *msg, int type); // for players: //void AddPlayer() // for input: + int InputGetch() { return wgetch(input->GetWindow()); } bool AddCharToSendMsg(char ch); bool RemoveCharFromMsg(); void InputClear() { input->Clear(false); } void SetInputCursor(int y, int x); - - WINDOW *GetInputWin() { return input->GetWindow(); } - WINDOW *GetChatWin() { return chat->GetWindow(); } private: // for chat: void ChatRedraw(); |