From b980efd014ddb56650fffeb7968901b8e6bc2837 Mon Sep 17 00:00:00 2001 From: dolphin Date: Mon, 19 Aug 2013 09:24:04 -0700 Subject: Added experience association info llsidepaneliteminfo for scripts. Changed the cap which looks up a script association to take a object/item id pair instead of a asset id. Updated llpreviewscript to use the new cap (which also improves loading time since it can be done in parallel with the lsltext retrieval). --- indra/newview/llsidepaneliteminfo.cpp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'indra/newview/llsidepaneliteminfo.cpp') diff --git a/indra/newview/llsidepaneliteminfo.cpp b/indra/newview/llsidepaneliteminfo.cpp index 92c2863ffd..040c4ee72d 100755 --- a/indra/newview/llsidepaneliteminfo.cpp +++ b/indra/newview/llsidepaneliteminfo.cpp @@ -43,6 +43,8 @@ #include "llviewercontrol.h" #include "llviewerinventory.h" #include "llviewerobjectlist.h" +#include "llexperiencecache.h" +#include "llexperienceassociationresponder.h" //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -316,6 +318,15 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) is_obj_modify = object->permOwnerModify(); } + if(item->getInventoryType() == LLInventoryType::IT_LSL) + { + getChildView("LabelItemExperienceTitle")->setVisible(TRUE); + LLTextBox* tb = getChild("LabelItemExperience"); + tb->setText(getString("loading_experience")); + tb->setVisible(TRUE); + ExperienceAssociationResponder::fetchAssociatedExperience(item->getParentUUID(), item->getUUID(), boost::bind(&LLSidepanelItemInfo::setAssociatedExperience, getDerivedHandle(), _1)); + } + ////////////////////// // ITEM NAME & DESC // ////////////////////// @@ -666,6 +677,30 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) } } + +void LLSidepanelItemInfo::setAssociatedExperience( LLHandle hInfo, const LLSD& experience ) +{ + LLSidepanelItemInfo* info = hInfo.get(); + if(info) + { + LLUUID id; + if(experience.has(LLExperienceCache::EXPERIENCE_ID) && experience.has(LLExperienceCache::NAME)) + { + id=experience[LLExperienceCache::EXPERIENCE_ID].asUUID(); + } + LLTextBox* xpName = info->getChild("LabelItemExperience"); + if(id.isNull()) + { + xpName->setText(info->getString("no_experience")); + } + else + { + xpName->setText(experience[LLExperienceCache::NAME].asString()); + } + } +} + + void LLSidepanelItemInfo::startObjectInventoryObserver() { if (!mObjectInventoryObserver) -- cgit v1.2.3 From 48e1e10fd69aaea6ef22feb2518e80a120e9f999 Mon Sep 17 00:00:00 2001 From: dolphin Date: Mon, 23 Sep 2013 11:44:21 -0700 Subject: Added LLUrlEntryExperienceProfile to link to experience profiles Added LLExperienceHandler to handle experience links Updated LLSidepanelItemInfo to use profile links --- indra/newview/llsidepaneliteminfo.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'indra/newview/llsidepaneliteminfo.cpp') diff --git a/indra/newview/llsidepaneliteminfo.cpp b/indra/newview/llsidepaneliteminfo.cpp index 040c4ee72d..072b001890 100755 --- a/indra/newview/llsidepaneliteminfo.cpp +++ b/indra/newview/llsidepaneliteminfo.cpp @@ -43,8 +43,9 @@ #include "llviewercontrol.h" #include "llviewerinventory.h" #include "llviewerobjectlist.h" -#include "llexperiencecache.h" #include "llexperienceassociationresponder.h" +#include "llexperiencecache.h" +#include "lltrans.h" //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -684,18 +685,17 @@ void LLSidepanelItemInfo::setAssociatedExperience( LLHandle if(info) { LLUUID id; - if(experience.has(LLExperienceCache::EXPERIENCE_ID) && experience.has(LLExperienceCache::NAME)) + if(experience.has(LLExperienceCache::EXPERIENCE_ID)) { id=experience[LLExperienceCache::EXPERIENCE_ID].asUUID(); } - LLTextBox* xpName = info->getChild("LabelItemExperience"); - if(id.isNull()) + if(id.notNull()) { - xpName->setText(info->getString("no_experience")); + info->getChild("LabelItemExperience")->setText(LLSLURL("experience", id, "profile").getSLURLString()); } else { - xpName->setText(experience[LLExperienceCache::NAME].asString()); + info->getChild("LabelItemExperience")->setText(LLTrans::getString("ExperienceNameNull")); } } } -- cgit v1.2.3