Keep original LL code please

meow-7.2.2
Ansariel 2023-04-03 22:47:34 +02:00
parent 2f128c90ed
commit 9895b2f5dc
2 changed files with 54 additions and 0 deletions

View File

@ -43,6 +43,7 @@
#include "llviewercontrol.h" // <FS:Zi> Make advanced animation preview optional
extern LLAgent gAgent;
//const S32 ADVANCED_VPAD = 3; // <FS:Ansariel> Improved animation preview
LLPreviewAnim::LLPreviewAnim(const LLSD& key)
: LLPreview( key )
@ -58,6 +59,15 @@ BOOL LLPreviewAnim::postBuild()
{
childSetCommitCallback("desc", LLPreview::onText, this);
getChild<LLLineEditor>("desc")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe);
// <FS:Ansariel> Improved animation preview
//getChild<LLTextBox>("adv_trigger")->setClickedCallback(boost::bind(&LLPreviewAnim::showAdvanced, this));
//pAdvancedStatsTextBox = getChild<LLTextBox>("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);
// </FS:Ansariel>
// <FS:Zi> Make advanced animation preview optional
bool expanded = gSavedSettings.getBOOL("FSAnimationPreviewExpanded");
@ -218,6 +228,46 @@ void LLPreviewAnim::onClose(bool app_quitting)
}
}
// <FS:Ansariel> 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()));
// }
// }
//}
// </FS:Ansariel>
// <FS:Zi> Make advanced animation preview optional
void LLPreviewAnim::expand(const LLSD& param)
{

View File

@ -45,6 +45,8 @@ public:
void cleanup(); // cleanup 'playing' state
void play(const LLSD& param);
// <FS:Ansariel> Improved animation preview
//void showAdvanced();
protected:
@ -52,6 +54,8 @@ protected:
LLUUID mItemID; // Not an item id, but a playing asset id
bool mDidStart;
// <FS:Ansariel> Improved animation preview
//LLTextBox* pAdvancedStatsTextBox;
};
#endif // LL_LLPREVIEWANIM_H