Transplant experience info from sidepanel item info to standalone item properties floater

master
Ansariel 2015-07-01 00:06:27 +02:00
parent f7bfd3e01a
commit 756bd8c6dc
5 changed files with 103 additions and 5 deletions

View File

@ -63,6 +63,9 @@
#include "rlvhandler.h"
// [/RLVa:KB]
#include "llviewernetwork.h" // <FS:CR> For OpenSim export perms
#include "llexperienceassociationresponder.h"
#include "llexperiencecache.h"
#include "llslurl.h"
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Class LLPropertiesObserver
@ -265,6 +268,17 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
is_obj_modify = object->permOwnerModify();
}
// <FS:Ansariel> Experience info
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(&LLFloaterProperties::setAssociatedExperience, getDerivedHandle<LLFloaterProperties>(), _1));
}
// </FS:Ansariel>
//////////////////////
// ITEM NAME & DESC //
//////////////////////
@ -574,6 +588,29 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
}
}
// <FS:Ansariel> Experience info
void LLFloaterProperties::setAssociatedExperience( LLHandle<LLFloaterProperties> hInfo, const LLSD& experience )
{
LLFloaterProperties* info = hInfo.get();
if(info)
{
LLUUID id;
if(experience.has(LLExperienceCache::EXPERIENCE_ID))
{
id=experience[LLExperienceCache::EXPERIENCE_ID].asUUID();
}
if(id.notNull())
{
info->getChild<LLTextBox>("LabelItemExperience")->setText(LLSLURL("experience", id, "profile").getSLURLString());
}
else
{
info->getChild<LLTextBox>("LabelItemExperience")->setText(LLTrans::getString("ExperienceNameNull"));
}
}
}
// </FS:Ansariel>
void LLFloaterProperties::onClickCreator()
{
LLInventoryItem* item = findItem();

View File

@ -75,6 +75,9 @@ protected:
void refreshFromItem(LLInventoryItem* item);
virtual void draw();
// <FS:Ansariel> Experience info
static void setAssociatedExperience( LLHandle<LLFloaterProperties> hInfo, const LLSD& experience );
protected:
// The item id of the inventory item in question.
LLUUID mItemID;

View File

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater name="item properties" title="Eigenschaften: Inventarobjekt">
<floater.string name="loading_experience">
(laden)
</floater.string>
<floater.string name="unknown">
(unbekannt)
</floater.string>
@ -35,6 +38,9 @@
<text name="LabelAcquiredDate">
Mittwoch, 24. Mai 2006, 12:50:46
</text>
<text name="LabelItemExperienceTitle">
Erlebnis:
</text>
<text name="OwnerLabel">
Sie:
</text>

View File

@ -1,13 +1,17 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<floater
legacy_header_height="18"
height="369"
height="389"
layout="topleft"
name="item properties"
help_topic="item_properties"
save_rect="true"
title="Inventory Item Properties"
width="350">
<floater.string
name="loading_experience">
(loading)
</floater.string>
<floater.string
name="unknown">
(unknown)
@ -178,6 +182,28 @@
width="252">
Wed May 24 12:50:46 2006
</text>
<text
type="string"
length="1"
follows="left|top"
height="16"
layout="topleft"
left="10"
name="LabelItemExperienceTitle"
top="125"
width="78">
Experience:
</text>
<text
type="string"
length="1"
follows="left|top"
height="16"
layout="topleft"
left_delta="78"
name="LabelItemExperience"
top_delta="0"
width="252"/>
<text
type="string"
length="1"
@ -186,7 +212,7 @@
layout="topleft"
left="10"
name="OwnerLabel"
top="125"
top="145"
width="78">
You:
</text>
@ -362,7 +388,7 @@
layout="topleft"
left="225"
name="BaseMaskDebug"
top="125"
top="145"
width="330">
B:
</text>

View File

@ -1,13 +1,17 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<floater
legacy_header_height="18"
height="350"
height="370"
layout="topleft"
name="item properties"
help_topic="item_properties"
save_rect="true"
title="Inventory Item Properties"
width="350">
<floater.string
name="loading_experience">
(loading)
</floater.string>
<floater.string
name="unknown">
(unknown)
@ -178,6 +182,28 @@
width="252">
Wed May 24 12:50:46 2006
</text>
<text
type="string"
length="1"
follows="left|top"
height="16"
layout="topleft"
left="10"
name="LabelItemExperienceTitle"
top="125"
width="78">
Experience:
</text>
<text
type="string"
length="1"
follows="left|top"
height="16"
layout="topleft"
left_delta="78"
name="LabelItemExperience"
top_delta="0"
width="252"/>
<text
type="string"
length="1"
@ -186,7 +212,7 @@
layout="topleft"
left="10"
name="OwnerLabel"
top="125"
top="145"
width="200">
You:
</text>