diff options
author | Stijn Buys <ingar@osirion.org> | 2009-01-10 15:36:15 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2009-01-10 15:36:15 +0000 |
commit | 272d229094309bc5875287a5063f818c58c5f4f8 (patch) | |
tree | fb9a84748c0a88bfa0e59f63be51455fc239becc /src/client/client.cc | |
parent | 44500292f5a964036e9d915a38a2773bf5aa765d (diff) |
hud widget, drawing code reorganization
Diffstat (limited to 'src/client/client.cc')
-rw-r--r-- | src/client/client.cc | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/src/client/client.cc b/src/client/client.cc index bb6fb55..b897480 100644 --- a/src/client/client.cc +++ b/src/client/client.cc @@ -110,7 +110,10 @@ void Client::init(int count, char **arguments) func = core::Func::add("r_restart", Client::func_r_restart); func->set_info("restart render subsystem"); - + + func = core::Func::add("snd_restart", Client::func_snd_restart); + func->set_info("restart audio subsystem"); + func = core::Func::add("ui_chat", Client::func_ui_chat); func->set_info("toggle chat window"); @@ -120,8 +123,8 @@ void Client::init(int count, char **arguments) func = core::Func::add("ui_map", Client::func_ui_map); func->set_info("toggle map"); - func = core::Func::add("snd_restart", Client::func_snd_restart); - func->set_info("restart audio subsystem"); + func = core::Func::add("ui_menu", Client::func_ui_menu); + func->set_info("toggle main menu"); previous_timestamp = 0; } @@ -228,9 +231,11 @@ void Client::shutdown() if (connected()) disconnect(); core::Func::remove("r_restart"); + core::Func::remove("snd_restart"); core::Func::remove("ui_chat"); core::Func::remove("ui_chatsmall"); - core::Func::remove("snd_restart"); + core::Func::remove("ui_map"); + core::Func::remove("ui_menu"); audio::shutdown(); @@ -374,5 +379,23 @@ void Client::func_ui_map(std::string const &args) } } +void Client::func_ui_menu(std::string const &args) +{ + if (client()->connected()) { + if (ui::root()->active()) { + ui::root()->hide_menu(); + } else { + // show the main menu on non-interactive modules + if (!core::game()->interactive()) { + ui::root()->show_menu("main"); + } else { + ui::root()->show_menu("game"); + } + } + } else { + con_print << "Not connected." << std::endl; + } +} + } // namespace client |