diff options
| author | dolphin <dolphin@lindenlab.com> | 2013-08-19 09:24:04 -0700 |
|---|---|---|
| committer | dolphin <dolphin@lindenlab.com> | 2013-08-19 09:24:04 -0700 |
| commit | b980efd014ddb56650fffeb7968901b8e6bc2837 (patch) | |
| tree | 6c21ef82c540379030833af5e1a1aeae999526fd /indra/newview/llsidepaneliteminfo.cpp | |
| parent | 02b501e4dc9a389878cd323e4f781bc752fec737 (diff) | |
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).
Diffstat (limited to 'indra/newview/llsidepaneliteminfo.cpp')
| -rwxr-xr-x | indra/newview/llsidepaneliteminfo.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
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<LLTextBox>("LabelItemExperience"); + tb->setText(getString("loading_experience")); + tb->setVisible(TRUE); + ExperienceAssociationResponder::fetchAssociatedExperience(item->getParentUUID(), item->getUUID(), boost::bind(&LLSidepanelItemInfo::setAssociatedExperience, getDerivedHandle<LLSidepanelItemInfo>(), _1)); + } + ////////////////////// // ITEM NAME & DESC // ////////////////////// @@ -666,6 +677,30 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) } } + +void LLSidepanelItemInfo::setAssociatedExperience( LLHandle<LLSidepanelItemInfo> 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<LLTextBox>("LabelItemExperience"); + if(id.isNull()) + { + xpName->setText(info->getString("no_experience")); + } + else + { + xpName->setText(experience[LLExperienceCache::NAME].asString()); + } + } +} + + void LLSidepanelItemInfo::startObjectInventoryObserver() { if (!mObjectInventoryObserver) |
