diff --git a/indra/newview/llpreviewanim.cpp b/indra/newview/llpreviewanim.cpp index 95557725ea..dbfd9da643 100644 --- a/indra/newview/llpreviewanim.cpp +++ b/indra/newview/llpreviewanim.cpp @@ -43,6 +43,7 @@ #include "llviewercontrol.h" // Make advanced animation preview optional extern LLAgent gAgent; +//const S32 ADVANCED_VPAD = 3; // Improved animation preview LLPreviewAnim::LLPreviewAnim(const LLSD& key) : LLPreview( key ) @@ -58,6 +59,15 @@ BOOL LLPreviewAnim::postBuild() { childSetCommitCallback("desc", LLPreview::onText, this); getChild("desc")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe); + // Improved animation preview + //getChild("adv_trigger")->setClickedCallback(boost::bind(&LLPreviewAnim::showAdvanced, this)); + //pAdvancedStatsTextBox = getChild("AdvancedStats"); + + //// Assume that advanced stats start visible (for XUI preview tool's purposes) + //pAdvancedStatsTextBox->setVisible(FALSE); + //LLRect rect = getRect(); + //reshape(rect.getWidth(), rect.getHeight() - pAdvancedStatsTextBox->getRect().getHeight() - ADVANCED_VPAD, FALSE); + // // Make advanced animation preview optional bool expanded = gSavedSettings.getBOOL("FSAnimationPreviewExpanded"); @@ -218,6 +228,46 @@ void LLPreviewAnim::onClose(bool app_quitting) } } +// Improved animation preview +//void LLPreviewAnim::showAdvanced() +//{ +// BOOL was_visible = pAdvancedStatsTextBox->getVisible(); +// +// if (was_visible) +// { +// pAdvancedStatsTextBox->setVisible(FALSE); +// LLRect rect = getRect(); +// reshape(rect.getWidth(), rect.getHeight() - pAdvancedStatsTextBox->getRect().getHeight() - ADVANCED_VPAD, FALSE); +// } +// else +// { +// pAdvancedStatsTextBox->setVisible(TRUE); +// LLRect rect = getRect(); +// reshape(rect.getWidth(), rect.getHeight() + pAdvancedStatsTextBox->getRect().getHeight() + ADVANCED_VPAD, FALSE); +// +// LLMotion *motion = NULL; +// const LLInventoryItem* item = getItem(); +// if (item) +// { +// // if motion exists, will return existing one. +// // Needed because viewer can purge motions +// motion = gAgentAvatarp->createMotion(item->getAssetUUID()); +// } +// +// // set text +// if (motion) +// { +// pAdvancedStatsTextBox->setTextArg("[PRIORITY]", llformat("%d", pMotion->getPriority())); +// pAdvancedStatsTextBox->setTextArg("[DURATION]", llformat("%.2f", pMotion->getDuration())); +// pAdvancedStatsTextBox->setTextArg("[EASE_IN]", llformat("%.2f", pMotion->getEaseInDuration())); +// pAdvancedStatsTextBox->setTextArg("[EASE_OUT]", llformat("%.2f", pMotion->getEaseOutDuration())); +// pAdvancedStatsTextBox->setTextArg("[IS_LOOP]", (pMotion->getLoop() ? LLTrans::getString("PermYes") : LLTrans::getString("PermNo"))); +// pAdvancedStatsTextBox->setTextArg("[NUM_JOINTS]", llformat("%d", pMotion->getNumJointMotions())); +// } +// } +//} +// + // Make advanced animation preview optional void LLPreviewAnim::expand(const LLSD& param) { diff --git a/indra/newview/llpreviewanim.h b/indra/newview/llpreviewanim.h index ba5bb58277..a3b29d5b00 100644 --- a/indra/newview/llpreviewanim.h +++ b/indra/newview/llpreviewanim.h @@ -45,6 +45,8 @@ public: void cleanup(); // cleanup 'playing' state void play(const LLSD& param); + // Improved animation preview + //void showAdvanced(); protected: @@ -52,6 +54,8 @@ protected: LLUUID mItemID; // Not an item id, but a playing asset id bool mDidStart; + // Improved animation preview + //LLTextBox* pAdvancedStatsTextBox; }; #endif // LL_LLPREVIEWANIM_H