From a95028547981614e06ea7a6d22b853b85418cea3 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Wed, 15 Apr 2009 17:08:51 +0000 Subject: added info registry, list_info added network info transfer added info based buy menu and related game changes --- src/client/client.cc | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'src/client/client.cc') diff --git a/src/client/client.cc b/src/client/client.cc index dffa1ca..47af682 100644 --- a/src/client/client.cc +++ b/src/client/client.cc @@ -144,6 +144,9 @@ void Client::init(int count, char **arguments) func = core::Func::add("menu", func_menu); func->set_info("[command] menu functions"); + func = core::Func::add("view", func_view); + func->set_info("[command] view menu functions"); + previous_timestamp = 0; } @@ -256,6 +259,7 @@ void Client::shutdown() core::Func::remove("ui_map"); core::Func::remove("ui_menu"); core::Func::remove("menu"); + core::Func::remove("view"); audio::shutdown(); @@ -495,6 +499,15 @@ void Client::func_ui_menu(std::string const &args) } } +// entity menus +void Client::func_view(std::string const &args) +{ + if (client()->worldview()) { + client()->worldview()->playerview()->show_menu(args); + } +} + +// global menus void Client::func_menu(std::string const &args) { if (!ui::root()) { @@ -535,14 +548,6 @@ void Client::func_menu(std::string const &args) } else if (command.compare("list") == 0) { ui::root()->list_menus(); - } else if (command.compare("view") == 0) { - if (client()->worldview()) { - std::string label; - if (!(argstr >> label)) { - label.assign("main"); - } - client()->worldview()->playerview()->show_menu(label); - } } else { ui::root()->show_menu(command.c_str()); } -- cgit v1.2.3