summaryrefslogtreecommitdiff
path: root/indra/newview/llpreviewanim.cpp
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2009-05-08 07:43:08 +0000
committerSteven Bennetts <steve@lindenlab.com>2009-05-08 07:43:08 +0000
commita4000c3744e42fcbb638e742f3b63fa31a0dee15 (patch)
tree7f472c30e65bbfa04ee9bc06631a1af305cc31fb /indra/newview/llpreviewanim.cpp
parent6c4cadbb04d633ad7b762058bdeba6e1f650dafd (diff)
merge trunk@116587 skinning-7@119389 -> viewer-2.0.0-skinning-7
Diffstat (limited to 'indra/newview/llpreviewanim.cpp')
-rw-r--r--indra/newview/llpreviewanim.cpp69
1 files changed, 34 insertions, 35 deletions
diff --git a/indra/newview/llpreviewanim.cpp b/indra/newview/llpreviewanim.cpp
index 3212de0639..efe0d3b752 100644
--- a/indra/newview/llpreviewanim.cpp
+++ b/indra/newview/llpreviewanim.cpp
@@ -47,42 +47,54 @@
extern LLAgent gAgent;
-LLPreviewAnim::LLPreviewAnim(const std::string& name, const LLRect& rect, const std::string& title, const LLUUID& item_uuid, const S32& activate, const LLUUID& object_uuid ) :
- LLPreview( name, rect, title, item_uuid, object_uuid)
+LLPreviewAnim::LLPreviewAnim(const LLSD& key)
+ : LLPreview( key )
{
- LLUICtrlFactory::getInstance()->buildFloater(this,"floater_preview_animation.xml");
-
- childSetAction("Anim play btn",playAnim,this);
- childSetAction("Anim audition btn",auditionAnim,this);
-
- const LLInventoryItem* item = getItem();
-
- childSetCommitCallback("desc", LLPreview::onText, this);
- childSetText("desc", item->getDescription());
- childSetPrevalidate("desc", &LLLineEditor::prevalidatePrintableNotPipe);
-
- setTitle(title);
+ //Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this,"floater_preview_animation.xml", FALSE);
+}
- if (!getHost())
+// static
+void LLPreviewAnim::endAnimCallback( void *userdata )
+{
+ LLHandle<LLFloater>* handlep = ((LLHandle<LLFloater>*)userdata);
+ LLFloater* self = handlep->get();
+ delete handlep; // done with the handle
+ if (self)
{
- LLRect curRect = getRect();
- translate(rect.mLeft - curRect.mLeft, rect.mTop - curRect.mTop);
+ self->childSetValue("Anim play btn", FALSE);
+ self->childSetValue("Anim audition btn", FALSE);
}
+}
- // preload the animation
+// virtual
+BOOL LLPreviewAnim::postBuild()
+{
+ const LLInventoryItem* item = getItem();
if(item)
{
- gAgent.getAvatarObject()->createMotion(item->getAssetUUID());
+ gAgent.getAvatarObject()->createMotion(item->getAssetUUID()); // preload the animation
+ childSetText("desc", item->getDescription());
}
+
+ childSetAction("Anim play btn",playAnim, this);
+ childSetAction("Anim audition btn",auditionAnim, this);
+
+ childSetCommitCallback("desc", LLPreview::onText, this);
+ childSetPrevalidate("desc", &LLLineEditor::prevalidatePrintableNotPipe);
- switch ( activate )
+ return LLPreview::postBuild();
+}
+
+void LLPreviewAnim::activate(e_activation_type type)
+{
+ switch ( type )
{
- case 1:
+ case PLAY:
{
playAnim( (void *) this );
break;
}
- case 2:
+ case AUDITION:
{
auditionAnim( (void *) this );
break;
@@ -95,19 +107,6 @@ LLPreviewAnim::LLPreviewAnim(const std::string& name, const LLRect& rect, const
}
// static
-void LLPreviewAnim::endAnimCallback( void *userdata )
-{
- LLHandle<LLFloater>* handlep = ((LLHandle<LLFloater>*)userdata);
- LLFloater* self = handlep->get();
- delete handlep; // done with the handle
- if (self)
- {
- self->childSetValue("Anim play btn", FALSE);
- self->childSetValue("Anim audition btn", FALSE);
- }
-}
-
-// static
void LLPreviewAnim::playAnim( void *userdata )
{
LLPreviewAnim* self = (LLPreviewAnim*) userdata;