From b417df720584c101f3799874a0c836a543a8d0a8 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 12 Oct 2008 14:55:10 +0000 Subject: user interface updates, work-in-progress --- src/client/client.cc | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'src/client/client.cc') diff --git a/src/client/client.cc b/src/client/client.cc index 3f368a7..ac4c0e3 100644 --- a/src/client/client.cc +++ b/src/client/client.cc @@ -12,7 +12,6 @@ #include "audio/audio.h" #include "audio/sources.h" -#include "client/chat.h" #include "client/client.h" #include "client/video.h" #include "client/console.h" @@ -52,6 +51,13 @@ void func_r_restart(std::string const &args) video::restart(); } +void func_ui_chat(std::string const &args) +{ + if (core::application()->connected()) { + client()->view()->chat()->toggle(); + } +} + //--- public ------------------------------------------------------ void client_main(int count, char **arguments) @@ -108,16 +114,13 @@ void Client::init(int count, char **arguments) // initialize user interface ui::init(); - new View(ui::root()); + client_view = new View(ui::root()); // Initialize the video subsystem if (!video::init()) { quit(1); } - // initialize console - chat::init(); - // initialize input input::init(); @@ -129,9 +132,12 @@ void Client::init(int count, char **arguments) func = core::Func::add("r_restart", (core::FuncPtr) func_r_restart); func->set_info("restart render subsystem"); + + func = core::Func::add("ui_chat", func_ui_chat); + func->set_info("toggle chat window"); - func = core::Func::add("snd_restart", (core::FuncPtr) func_snd_restart); - func->set_info("restart audio subsystem"); + //func = core::Func::add("snd_restart", (core::FuncPtr) func_snd_restart); + //func->set_info("restart audio subsystem"); } void Client::run() @@ -215,10 +221,8 @@ void Client::shutdown() if (connected()) disconnect(); core::Func::remove("r_restart"); - - core::Func::remove("snd_restart"); - - chat::shutdown(); + core::Func::remove("ui_chat"); + //core::Func::remove("snd_restart"); audio::shutdown(); @@ -245,8 +249,8 @@ void Client::notify_connect() void Client::notify_disconnect() { // FIXME unload sounds - //audio::reset(); render::reset(); + input::reset(); } void Client::notify_zonechange() -- cgit v1.2.3