Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-05-31 09:02:50 +0000
committerStijn Buys <ingar@osirion.org>2008-05-31 09:02:50 +0000
commitda0715c2648b662892a72e32e8528a08608d0d0b (patch)
tree727e2aa37620dd932700b407ee1749e4ab1c1793 /src/client/chat.cc
parent8933b795003f8ad202fce6e553191be8932a37b6 (diff)
chatbox accepts console commands
Diffstat (limited to 'src/client/chat.cc')
-rw-r--r--src/client/chat.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/client/chat.cc b/src/client/chat.cc
index 9171387..6fd5008 100644
--- a/src/client/chat.cc
+++ b/src/client/chat.cc
@@ -44,7 +44,8 @@ void func_con_chat(std::string const &args)
void init()
{
// add engine functions
- core::Func::add("con_chat", (core::FuncPtr) func_con_chat);
+ core::Func *func = core::Func::add("ui_chat", (core::FuncPtr) func_con_chat);
+ func->set_info("toggle chatbox");
history.clear();
history.push_back("");
@@ -56,7 +57,7 @@ void init()
void shutdown()
{
// remove engine functions
- //core::Func::remove("con_chat");
+ core::Func::remove("ui_chat");
history.clear();
input_pos = 0;
@@ -150,7 +151,11 @@ void keypressed(int key)
history.pop_front();
}
- core::cmd() << "say " << (*history_pos) << std::endl;
+ if ((*history_pos).c_str()[0] == '/' || (*history_pos).c_str()[0] == '\\') {
+ core::cmd() << &(*history_pos).c_str()[1] << std::endl;
+ } else {
+ core::cmd() << "say " << (*history_pos) << std::endl;
+ }
(*history.rbegin()) = (*history_pos);
history.push_back("");