From d79c0223315beaf55fcd10d6891675c4d57b5e2b Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Tue, 21 Oct 2008 19:00:39 +0000 Subject: moved client console into libui --- src/client/client.cc | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) (limited to 'src/client/client.cc') diff --git a/src/client/client.cc b/src/client/client.cc index 076e72a..2400089 100644 --- a/src/client/client.cc +++ b/src/client/client.cc @@ -14,7 +14,6 @@ #include "audio/sources.h" #include "client/client.h" #include "client/video.h" -#include "client/console.h" #include "client/input.h" #include "client/view.h" #include "core/core.h" @@ -65,11 +64,6 @@ void func_ui_chatsmall(std::string const &args) } } -void func_ui_console(std::string const &args) -{ - client()->console()->toggle(); -} - //--- public ------------------------------------------------------ void client_main(int count, char **arguments) @@ -100,11 +94,9 @@ void Client::quit(int status) void Client::init(int count, char **arguments) { + client_view = 0; con_print << "^BInitializing client..." << std::endl; - client_console = 0; - client_view = 0; - // initialize core core::Cvar::sv_private = core::Cvar::set("sv_private", "0"); core::Application::init(count, arguments); @@ -128,9 +120,7 @@ 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()) { @@ -155,9 +145,6 @@ void Client::init(int count, char **arguments) func = core::Func::add("ui_chatsmall", func_ui_chatsmall); func->set_info("toggle small 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"); @@ -174,8 +161,6 @@ void Client::run() Uint32 client_current_timestamp = 0; Uint32 client_previous_timestamp = 0; - //console()->clear_notify(); - while (true) { // current time in microseconds client_current_timestamp = SDL_GetTicks(); @@ -219,8 +204,8 @@ void Client::frame(unsigned long timestamp) core::application()->connect(""); } // show the console if everything fails - if (!core::application()->connected() && !console()->visible()) { - console()->toggle(); + if (!core::application()->connected() && !ui::console()->visible()) { + ui::console()->toggle(); } } else { // show the main menu on non-interactive modules @@ -243,7 +228,6 @@ void Client::shutdown() core::Func::remove("r_restart"); core::Func::remove("ui_chat"); core::Func::remove("ui_chatsmall"); - core::Func::remove("ui_console"); core::Func::remove("snd_restart"); audio::shutdown(); @@ -271,6 +255,8 @@ void Client::notify_disconnect() audio::reset(); render::reset(); input::reset(); + + // TODO clear chat and notifications } void Client::notify_zonechange() -- cgit v1.2.3