From 1e0df536c2fae85c317ce9c3cc17603d5f98c911 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Wed, 15 Oct 2008 20:33:15 +0000 Subject: moved client console into a Widget --- src/client/client.cc | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'src/client/client.cc') diff --git a/src/client/client.cc b/src/client/client.cc index ae4f232..200becd 100644 --- a/src/client/client.cc +++ b/src/client/client.cc @@ -58,6 +58,11 @@ void func_ui_chat(std::string const &args) } } +void func_ui_console(std::string const &args) +{ + client()->console()->toggle(); +} + //--- public ------------------------------------------------------ void client_main(int count, char **arguments) @@ -93,7 +98,6 @@ void Client::init(int count, char **arguments) // initialize core core::Cvar::sv_dedicated = core::Cvar::set("sv_private", "0"); core::Application::init(count, arguments); - Console::init(); // client variables core::Cvar *cvar = 0; @@ -114,7 +118,9 @@ void Client::init(int count, char **arguments) // initialize user interface ui::init(); + client_view = new View(ui::root()); + client_console = new Console(ui::root()); // Initialize the video subsystem if (!video::init()) { @@ -136,6 +142,9 @@ void Client::init(int count, char **arguments) func = core::Func::add("ui_chat", func_ui_chat); func->set_info("toggle chat window"); + func = core::Func::add("ui_console", func_ui_console); + func->set_info("toggle console on or off"); + //func = core::Func::add("snd_restart", (core::FuncPtr) func_snd_restart); //func->set_info("restart audio subsystem"); } @@ -149,10 +158,8 @@ void Client::run() Uint32 client_current_timestamp = 0; Uint32 client_previous_timestamp = 0; - - - console()->flush(); - console()->clear_notify(); + + //console()->clear_notify(); while (true) { // current time in microseconds @@ -222,12 +229,11 @@ void Client::shutdown() core::Func::remove("r_restart"); core::Func::remove("ui_chat"); + core::Func::remove("ui_console"); //core::Func::remove("snd_restart"); audio::shutdown(); - Console::shutdown(); - input::shutdown(); video::shutdown(); @@ -290,7 +296,7 @@ void Client::notify_message(core::Message::Channel const channel, std::string co } con_print << message << std::endl; - console()->notify(message); + //console()->notify(message); } /* FIXME -- cgit v1.2.3