summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2021-05-27 22:44:47 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2021-05-27 22:44:47 +0300
commite611a30fe742dbae02d20062532ca92473da9bed (patch)
tree36ba084c22f962f2e7a5aa272226c3772a5ed122 /indra/newview
parent54a80085d75f2e286b29c708ae08d5f1e401ce0d (diff)
SL-14076 Fix motion preloading
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llpreview.h2
-rw-r--r--indra/newview/llpreviewanim.cpp22
-rw-r--r--indra/newview/llpreviewanim.h12
3 files changed, 22 insertions, 14 deletions
diff --git a/indra/newview/llpreview.h b/indra/newview/llpreview.h
index b41aa2be1a..9ac15d1639 100644
--- a/indra/newview/llpreview.h
+++ b/indra/newview/llpreview.h
@@ -104,7 +104,7 @@ public:
// llview
/*virtual*/ void draw();
- void refreshFromItem();
+ virtual void refreshFromItem();
// We can't modify Item or description in preview if either in-world Object
// or Item itself is unmodifiable
diff --git a/indra/newview/llpreviewanim.cpp b/indra/newview/llpreviewanim.cpp
index d29609fc1e..97f1dcd5d0 100644
--- a/indra/newview/llpreviewanim.cpp
+++ b/indra/newview/llpreviewanim.cpp
@@ -53,13 +53,6 @@ LLPreviewAnim::LLPreviewAnim(const LLSD& key)
// virtual
BOOL LLPreviewAnim::postBuild()
{
- const LLInventoryItem* item = getItem();
- if(item)
- {
- pMotion = gAgentAvatarp->createMotion(item->getAssetUUID()); // preload the animation
- getChild<LLUICtrl>("desc")->setValue(item->getDescription());
- }
-
childSetCommitCallback("desc", LLPreview::onText, this);
getChild<LLLineEditor>("desc")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe);
getChild<LLTextBox>("adv_trigger")->setClickedCallback(boost::bind(&LLPreviewAnim::showAdvanced, this));
@@ -73,7 +66,6 @@ BOOL LLPreviewAnim::postBuild()
return LLPreview::postBuild();
}
-// static
// llinventorybridge also calls into here
void LLPreviewAnim::play(const LLSD& param)
{
@@ -171,6 +163,20 @@ void LLPreviewAnim::draw()
}
// virtual
+void LLPreviewAnim::refreshFromItem()
+{
+ const LLInventoryItem* item = getItem();
+ if (!item)
+ {
+ return;
+ }
+
+ // Preload motion
+ pMotion = gAgentAvatarp->createMotion(item->getAssetUUID());
+
+ LLPreview::refreshFromItem();
+}
+
void LLPreviewAnim::cleanup()
{
this->mItemID = LLUUID::null;
diff --git a/indra/newview/llpreviewanim.h b/indra/newview/llpreviewanim.h
index ebeee367f7..14cd53b500 100644
--- a/indra/newview/llpreviewanim.h
+++ b/indra/newview/llpreviewanim.h
@@ -38,16 +38,18 @@ class LLPreviewAnim : public LLPreview
public:
LLPreviewAnim(const LLSD& key);
- /*virtual*/ BOOL postBuild();
- /*virtual*/ void onClose(bool app_quitting);
- void draw();
- void cleanup();
+ BOOL postBuild() override;
+ void onClose(bool app_quitting) override;
+ void draw() override;
+ void refreshFromItem() override;
+
+ void cleanup(); // cleanup 'playing' state
void play(const LLSD& param);
void showAdvanced();
protected:
- LLUUID mItemID;
+ LLUUID mItemID; // Not an item id, but a playing asset id
bool mDidStart;
LLMotion* pMotion;
LLTextBox* pAdvancedStatsTextBox;