From c62fe609a69058e2e30f757e9a06f72a98464232 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Fri, 17 Sep 2010 15:19:34 +0000 Subject: Bump network protocol version to 19, menudescriptions use the info infrastructure, client-side lazy info update requests. Updated ROADMAP --- src/client/playerview.cc | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/client/playerview.cc') 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 #include +#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) { -- cgit v1.2.3