From db37dcd73f3116917584e81a474f70e0d0786bc4 Mon Sep 17 00:00:00 2001 From: David Athay Date: Tue, 13 Jan 2009 12:48:36 +0000 Subject: Added WoW style item adding to chat window. Right Ctrl and Left click to put the item in the chat input. Left click the item link to show a popup description, and click the link again to remove the popup. --- src/gui/itempopup.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/gui/itempopup.cpp') diff --git a/src/gui/itempopup.cpp b/src/gui/itempopup.cpp index ee58c5cd..7a662151 100644 --- a/src/gui/itempopup.cpp +++ b/src/gui/itempopup.cpp @@ -81,19 +81,16 @@ ItemPopup::ItemPopup() mItemEffect->setTextWrapped( "" ); } -void ItemPopup::setItem(Item *item) +void ItemPopup::setItem(const ItemInfo &item) { - - ItemInfo const *info = item ? &item->getInfo() : NULL; - - mItemName->setCaption(info->getName()); - mItemDesc->setTextWrapped( info->getDescription() ); - mItemEffect->setTextWrapped( info->getEffect() ); + mItemName->setCaption(item.getName()); + mItemDesc->setTextWrapped(item.getDescription()); + mItemEffect->setTextWrapped(item.getEffect()); int numRowsDesc = mItemDesc->getNumberOfRows(); int numRowsEffect = mItemEffect->getNumberOfRows(); - if(info->getEffect() == "") + if(item.getEffect() == "") { setContentSize(200, (numRowsDesc * 14) + 30); } else { -- cgit v1.2.3-60-g2f50