FIRE-30962: Fix animation details not being displayed for animations in task inventory

meow-7.2.2
Ansariel 2021-05-27 19:39:40 +02:00
parent e6befde465
commit f7e2f750d8
2 changed files with 25 additions and 0 deletions

View File

@ -235,4 +235,28 @@ void LLPreviewAnim::onClose(bool app_quitting)
// }
// }
//}
// virtual
void LLPreviewAnim::refreshFromItem()
{
LLPreview::refreshFromItem();
const LLInventoryItem* item = getItem();
if (item)
{
pMotion = gAgentAvatarp->createMotion(item->getAssetUUID()); // preload the animation
if (pMotion)
{
LLTextBox* stats_box_left = getChild<LLTextBox>("AdvancedStatsLeft");
LLTextBox* stats_box_right = getChild<LLTextBox>("AdvancedStatsRight");
stats_box_left->setTextArg("[PRIORITY]", llformat("%d", pMotion->getPriority()));
stats_box_left->setTextArg("[DURATION]", llformat("%.2f", pMotion->getDuration()));
stats_box_left->setTextArg("[IS_LOOP]", (pMotion->getLoop() ? LLTrans::getString("PermYes") : LLTrans::getString("PermNo")));
stats_box_right->setTextArg("[EASE_IN]", llformat("%.2f", pMotion->getEaseInDuration()));
stats_box_right->setTextArg("[EASE_OUT]", llformat("%.2f", pMotion->getEaseOutDuration()));
stats_box_right->setTextArg("[NUM_JOINTS]", llformat("%d", pMotion->getNumJointMotions()));
}
}
}
// </FS:Ansariel>

View File

@ -45,6 +45,7 @@ public:
void play(const LLSD& param);
// <FS:Ansariel> Improved animation preview
//void showAdvanced();
/*virtual*/ void refreshFromItem();
protected: