本文整理汇总了C++中LLFloaterAnimPreview::closeFloater方法的典型用法代码示例。如果您正苦于以下问题:C++ LLFloaterAnimPreview::closeFloater方法的具体用法?C++ LLFloaterAnimPreview::closeFloater怎么用?C++ LLFloaterAnimPreview::closeFloater使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLFloaterAnimPreview
的用法示例。
在下文中一共展示了LLFloaterAnimPreview::closeFloater方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onBtnOK
//-----------------------------------------------------------------------------
// onBtnOK()
//-----------------------------------------------------------------------------
void LLFloaterAnimPreview::onBtnOK(void* userdata)
{
LLFloaterAnimPreview* floaterp = (LLFloaterAnimPreview*)userdata;
if (!floaterp->getEnabled()) return;
if (floaterp->mAnimPreview)
{
LLKeyframeMotion* motionp = (LLKeyframeMotion*)floaterp->mAnimPreview->getPreviewAvatar()->findMotion(floaterp->mMotionID);
S32 file_size = motionp->getFileSize();
U8* buffer = new U8[file_size];
LLDataPackerBinaryBuffer dp(buffer, file_size);
if (motionp->serialize(dp))
{
LLVFile file(gVFS, motionp->getID(), LLAssetType::AT_ANIMATION, LLVFile::APPEND);
S32 size = dp.getCurrentSize();
file.setMaxSize(size);
if (file.write((U8*)buffer, size))
{
std::string name = floaterp->getChild<LLUICtrl>("name_form")->getValue().asString();
std::string desc = floaterp->getChild<LLUICtrl>("description_form")->getValue().asString();
LLAssetStorage::LLStoreAssetCallback callback = NULL;
S32 expected_upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload();
void *userdata = NULL;
upload_new_resource(floaterp->mTransactionID, // tid
LLAssetType::AT_ANIMATION,
name,
desc,
0,
LLFolderType::FT_NONE,
LLInventoryType::IT_ANIMATION,
LLFloaterPerms::getNextOwnerPerms(), LLFloaterPerms::getGroupPerms(), LLFloaterPerms::getEveryonePerms(),
name,
callback, expected_upload_cost, userdata);
}
else
{
llwarns << "Failure writing animation data." << llendl;
LLNotificationsUtil::add("WriteAnimationFail");
}
}
delete [] buffer;
// clear out cache for motion data
floaterp->resetMotion();
floaterp->mAnimPreview->getPreviewAvatar()->removeMotion(floaterp->mMotionID);
LLKeyframeDataCache::removeKeyframeData(floaterp->mMotionID);
floaterp->mMotionID.setNull();
}
floaterp->closeFloater(false);
}