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/ui/ui.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/ui/ui.cc') diff --git a/src/ui/ui.cc b/src/ui/ui.cc index bacc753..c5fdfac 100644 --- a/src/ui/ui.cc +++ b/src/ui/ui.cc @@ -43,6 +43,12 @@ void func_ui_restart(std::string const &args) } } + +void func_ui_console(std::string const &args) +{ + console()->toggle(); +} + void func_list_menu(std::string const &args) { if (global_ui) { @@ -171,6 +177,9 @@ void init() func = core::Func::add("ui_restart", func_ui_restart); func->set_info("[command] [options] reload user interface files"); + + func = core::Func::add("ui_console", func_ui_console); + func->set_info("toggle console on or off"); func = core::Func::add("menu", func_menu); func->set_info("[command] menu functions"); @@ -183,6 +192,7 @@ void shutdown() core::Func::remove("list_ui"); core::Func::remove("list_menu"); core::Func::remove("menu"); + core::Func::remove("ui_console"); core::Func::remove("ui"); if (global_ui) { @@ -200,6 +210,9 @@ UI::UI() : Window(0) set_border(false); set_background(false); + // intialize console + ui_console = new Console(this); + // default palette ui_palette = new Palette(); set_palette(ui_palette); @@ -404,6 +417,11 @@ void UI::show_menu(const char *label) ui_active_menu->show(); set_pointer("pointer"); + + // raise console if it is visible + if (ui_console->visible()) + ui_console->show(); + } else { con_warn << "Unknown window '" << label << "'" << std::endl; } -- cgit v1.2.3