diff options
Diffstat (limited to 'src/client/client.cc')
| -rw-r--r-- | src/client/client.cc | 21 | 
1 files changed, 13 insertions, 8 deletions
| 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());  	} | 
