diff options
author | Stijn Buys <ingar@osirion.org> | 2010-09-17 15:19:34 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2010-09-17 15:19:34 +0000 |
commit | c62fe609a69058e2e30f757e9a06f72a98464232 (patch) | |
tree | 53f6a671bd84924ddf7d278cf10a3e527670088e /src/client/playerview.cc | |
parent | 0c509866a37ab47ff0e48d357ca55e31658c37c2 (diff) |
Bump network protocol version to 19, menudescriptions use the info infrastructure, client-side lazy info update requests.
Updated ROADMAP
Diffstat (limited to 'src/client/playerview.cc')
-rw-r--r-- | src/client/playerview.cc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/client/playerview.cc b/src/client/playerview.cc index de4c704..4be64d2 100644 --- a/src/client/playerview.cc +++ b/src/client/playerview.cc @@ -7,6 +7,8 @@ #include <string> #include <sstream> +#include "core/info.h" +#include "core/application.h" #include "audio/audio.h" #include "client/playerview.h" #include "ui/ui.h" @@ -119,19 +121,19 @@ void PlayerView::show_menu(const std::string & args) if (label.compare("buy") == 0) { // buy menu, single item - std::string itemtype; - std::string itemname; + unsigned long id; - if ((argstr >> itemtype) && (argstr >> itemname)) { + if (argstr >> id) { // hide other menus view_entitymenu->hide(); view_trademenu->hide(); + + // requesting the info through game makes sure it is retreived from the server + view_buymenu->set_item( core::game()->info(id) ); // show buy menu - view_buymenu->set_item(itemtype, itemname); - view_buymenu->show(); - + view_buymenu->show(); } else { - con_print << "usage: view buy [string] [string] buy menu for item type and name" << std::endl; + con_print << "usage: view buy [infoid] show the buy menu for this kind of item" << std::endl; } } else if (label.compare("trade") == 0) { |