diff options
author | Stijn Buys <ingar@osirion.org> | 2008-10-21 19:00:39 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-10-21 19:00:39 +0000 |
commit | d79c0223315beaf55fcd10d6891675c4d57b5e2b (patch) | |
tree | 3ea902634192dfcffa21a4e7a8cd28da714f0daa /src/ui/ui.cc | |
parent | 9f2e49593639a9f1f3e5f4f7b690ff364afefd56 (diff) |
moved client console into libui
Diffstat (limited to 'src/ui/ui.cc')
-rw-r--r-- | src/ui/ui.cc | 18 |
1 files changed, 18 insertions, 0 deletions
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; } |