From 5a9a0e0b1b78279ec5e73f99d64e8360ca96f2cf Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Wed, 26 Jun 2013 03:51:27 -0400 Subject: [PATCH] Upload code cleansing I found our upload classes were in need of a tune up while researching Issue 896: Animation upload setting causes viewer crash So I started working to clean up llfloaterbvhpreview which lead me to llfloaternamedesc and the rest of our upload floaters I ended up pulling the sound upload hack out of LLFloaterNameDesc and into LLFloaterSoundPreview and moving LLFloaterAnimPreview into llfloaternamedesc.* Updated llviewermenufile.cpp a bit Removed setUploadAmount from LLFloaterImagePreview and LLFloaterBvhPreview as its purpose is served by LLGlobalEconomy::getPriceUpload and the hippogridmanager too. Fixed an issue with floater_animation_anim_preview.xml using [AMOUNT] instead of [UPLOADFEE] for its label. I'd say this might fix Issue 896, I certainly can't reproduce the crash I was having when testing for it anymore. --- indra/newview/CMakeLists.txt | 2 - indra/newview/llfloateranimpreview.cpp | 46 -- indra/newview/llfloateranimpreview.h | 42 -- indra/newview/llfloaterbvhpreview.cpp | 690 +++++++----------- indra/newview/llfloaterbvhpreview.h | 38 +- indra/newview/llfloaterimagepreview.cpp | 40 +- indra/newview/llfloaterimagepreview.h | 9 +- indra/newview/llfloaternamedesc.cpp | 139 ++-- indra/newview/llfloaternamedesc.h | 35 +- indra/newview/llviewermenufile.cpp | 44 +- indra/newview/llviewermessage.cpp | 5 - .../en-us/floater_animation_anim_preview.xml | 2 +- 12 files changed, 421 insertions(+), 671 deletions(-) delete mode 100644 indra/newview/llfloateranimpreview.cpp delete mode 100644 indra/newview/llfloateranimpreview.h diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 7ae2f0f82..7b53c5d0c 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -172,7 +172,6 @@ set(viewer_SOURCE_FILES llflexibleobject.cpp llfloaterabout.cpp llfloateractivespeakers.cpp - llfloateranimpreview.cpp llfloaterauction.cpp llfloateravatarinfo.cpp llfloateravatarlist.cpp @@ -677,7 +676,6 @@ set(viewer_HEADER_FILES llflexibleobject.h llfloaterabout.h llfloateractivespeakers.h - llfloateranimpreview.h llfloaterauction.h llfloateravatarinfo.h llfloateravatarlist.h diff --git a/indra/newview/llfloateranimpreview.cpp b/indra/newview/llfloateranimpreview.cpp deleted file mode 100644 index 8fdfc1a93..000000000 --- a/indra/newview/llfloateranimpreview.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @file llfloateranimpreview.cpp - * @brief LLFloaterAnimPreview class implementation - * - * Copyright (c) 2012, Linden Research, Inc. - * - * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 - * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception - * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ - */ - -#include "llviewerprecompiledheaders.h" -#include "llfloateranimpreview.h" - -LLFloaterAnimPreview::LLFloaterAnimPreview(LLSD const& filename) : LLFloaterNameDesc(filename) -{ -} - -BOOL LLFloaterAnimPreview::postBuild() -{ - if (!LLFloaterNameDesc::postBuild()) - { - return FALSE; - } - getChild("ok_btn")->setCommitCallback(boost::bind(&LLFloaterNameDesc::onBtnOK, this)); - return TRUE; -} diff --git a/indra/newview/llfloateranimpreview.h b/indra/newview/llfloateranimpreview.h deleted file mode 100644 index 7603286e7..000000000 --- a/indra/newview/llfloateranimpreview.h +++ /dev/null @@ -1,42 +0,0 @@ -/** - * @file llfloateranimpreview.h - * @brief LLFloaterAnimPreview class definition - * - * Copyright (c) 2012, Linden Research, Inc. - * - * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 - * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception - * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ - */ - -#ifndef LL_LLFLOATERANIMPREVIEW_H -#define LL_LLFLOATERANIMPREVIEW_H - -#include "llfloaternamedesc.h" - -class LLFloaterAnimPreview : public LLFloaterNameDesc { - public: - LLFloaterAnimPreview(LLSD const& filename); - virtual BOOL postBuild(void); -}; - -#endif // LL_LLFLOATERANIMPREVIEW_H diff --git a/indra/newview/llfloaterbvhpreview.cpp b/indra/newview/llfloaterbvhpreview.cpp index a5eb65b01..2544f6788 100644 --- a/indra/newview/llfloaterbvhpreview.cpp +++ b/indra/newview/llfloaterbvhpreview.cpp @@ -3,10 +3,9 @@ * @brief LLFloaterBvhPreview class implementation * * $LicenseInfo:firstyear=2004&license=viewergpl$ - * + * Second Life Viewer Source Code * Copyright (c) 2004-2009, Linden Research, Inc. * - * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab * to you under the terms of the GNU General Public License, version 2.0 * ("GPL"), unless you have obtained a separate licensing agreement @@ -37,6 +36,7 @@ #include "llbvhloader.h" #include "lldatapacker.h" #include "lldir.h" +#include "lleconomy.h" #include "llnotificationsutil.h" #include "llvfile.h" #include "llapr.h" @@ -68,7 +68,6 @@ #include "llvoavatarself.h" #include "pipeline.h" #include "lluictrlfactory.h" -#include "llviewercontrol.h" #include "hippogridmanager.h" @@ -76,8 +75,6 @@ #include "llinventorymodel.h" // gInventoryModel // -S32 LLFloaterBvhPreview::sUploadAmount = 10; - const S32 PREVIEW_BORDER_WIDTH = 2; const S32 PREVIEW_RESIZE_HANDLE_SIZE = S32(RESIZE_HANDLE_WIDTH * OO_SQRT2) + PREVIEW_BORDER_WIDTH; const S32 PREVIEW_HPAD = PREVIEW_RESIZE_HANDLE_SIZE; @@ -143,17 +140,15 @@ std::string STATUS[] = "E_ST_BAD_ROOT" }; - //----------------------------------------------------------------------------- // LLFloaterBvhPreview() //----------------------------------------------------------------------------- LLFloaterBvhPreview::LLFloaterBvhPreview(const std::string& filename, void* item) : - LLFloaterNameDesc(filename) + LLFloaterNameDesc(filename, item) { // mItem = item; // - mLastMouseX = 0; mLastMouseY = 0; @@ -189,27 +184,27 @@ LLFloaterBvhPreview::LLFloaterBvhPreview(const std::string& filename, void* item //----------------------------------------------------------------------------- void LLFloaterBvhPreview::setAnimCallbacks() { - childSetCommitCallback("playback_slider", onSliderMove, this); + getChild("playback_slider")->setCommitCallback(boost::bind(&LLFloaterBvhPreview::onSliderMove, this)); - childSetCommitCallback("preview_base_anim", onCommitBaseAnim, this); - childSetValue("preview_base_anim", "Standing"); + getChild("preview_base_anim")->setCommitCallback(boost::bind(&LLFloaterBvhPreview::onCommitBaseAnim, this)); + getChild("preview_base_anim")->setValue("Standing"); - childSetCommitCallback("priority", onCommitPriority, this); - childSetCommitCallback("loop_check", onCommitLoop, this); - childSetCommitCallback("loop_in_point", onCommitLoopIn, this); - childSetValidate("loop_in_point", validateLoopIn); - childSetCommitCallback("loop_out_point", onCommitLoopOut, this); - childSetValidate("loop_out_point", validateLoopOut); + getChild("priority")->setCommitCallback(boost::bind(&LLFloaterBvhPreview::onCommitPriority, this)); + getChild("loop_check")->setCommitCallback(boost::bind(&LLFloaterBvhPreview::onCommitLoop, this)); + getChild("loop_in_point")->setCommitCallback(boost::bind(&LLFloaterBvhPreview::onCommitLoopIn, this)); + getChild("loop_in_point")->setValidateBeforeCommit( boost::bind(&LLFloaterBvhPreview::validateLoopIn, this, _1)); + getChild("loop_out_point")->setCommitCallback(boost::bind(&LLFloaterBvhPreview::onCommitLoopOut, this)); + getChild("loop_out_point")->setValidateBeforeCommit( boost::bind(&LLFloaterBvhPreview::validateLoopOut, this, _1)); - childSetCommitCallback("hand_pose_combo", onCommitHandPose, this); + getChild("hand_pose_combo")->setCommitCallback(boost::bind(&LLFloaterBvhPreview::onCommitHandPose, this)); - childSetCommitCallback("emote_combo", onCommitEmote, this); - childSetValue("emote_combo", "[None]"); + getChild("emote_combo")->setCommitCallback(boost::bind(&LLFloaterBvhPreview::onCommitEmote, this)); + getChild("emote_combo")->setValue("[None]"); - childSetCommitCallback("ease_in_time", onCommitEaseIn, this); - childSetValidate("ease_in_time", validateEaseIn); - childSetCommitCallback("ease_out_time", onCommitEaseOut, this); - childSetValidate("ease_out_time", validateEaseOut); + getChild("ease_in_time")->setCommitCallback(boost::bind(&LLFloaterBvhPreview::onCommitEaseIn, this)); + getChild("ease_in_time")->setValidateBeforeCommit( boost::bind(&LLFloaterBvhPreview::validateEaseIn, this, _1)); + getChild("ease_out_time")->setCommitCallback(boost::bind(&LLFloaterBvhPreview::onCommitEaseOut, this)); + getChild("ease_out_time")->setValidateBeforeCommit( boost::bind(&LLFloaterBvhPreview::validateEaseOut, this, _1)); } //----------------------------------------------------------------------------- @@ -228,11 +223,11 @@ BOOL LLFloaterBvhPreview::postBuild() mInWorld = gSavedSettings.getBOOL("PreviewAnimInWorld"); - childSetCommitCallback("name_form", onCommitName, this); + getChild("name_form")->setCommitCallback(boost::bind(&LLFloaterBvhPreview::onCommitName, this)); if (gSavedSettings.getBOOL("AscentPowerfulWizard")) { - childSetMaxValue("priority", 7); + getChild("priority")->setMaxValue(7); } childSetLabelArg("ok_btn", "[UPLOADFEE]", gHippoGridManager->getConnectedGrid()->getUploadFee()); @@ -244,12 +239,12 @@ BOOL LLFloaterBvhPreview::postBuild() r = getRect(); translate(0, 230); reshape(r.getWidth(), r.getHeight() - 230); - childSetValue("bad_animation_text", getString("in_world")); - childShow("bad_animation_text"); + getChild("bad_animation_text")->setValue(getString("in_world")); + getChildView("bad_animation_text")->setVisible(TRUE); } else { - childHide("bad_animation_text"); + getChildView("bad_animation_text")->setVisible(FALSE); } mPreviewRect.set(PREVIEW_HPAD, @@ -263,10 +258,6 @@ BOOL LLFloaterBvhPreview::postBuild() r.set( btn_left, y, btn_left + 32, y - BTN_HEIGHT ); mPlayButton = getChild( "play_btn"); - if (!mPlayButton) - { - mPlayButton = new LLButton("play_btn"); - } mPlayButton->setClickedCallback(boost::bind(&LLFloaterBvhPreview::onBtnPlay,this)); mPlayButton->setImages(std::string("button_anim_play.tga"), @@ -278,10 +269,6 @@ BOOL LLFloaterBvhPreview::postBuild() mPlayButton->setScaleImage(TRUE); mStopButton = getChild( "stop_btn"); - if (!mStopButton) - { - mStopButton = new LLButton("stop_btn"); - } mStopButton->setClickedCallback(boost::bind(&LLFloaterBvhPreview::onBtnStop, this)); mStopButton->setImages(std::string("button_anim_stop.tga"), @@ -293,27 +280,6 @@ BOOL LLFloaterBvhPreview::postBuild() mStopButton->setScaleImage(TRUE); r.set(r.mRight + PREVIEW_HPAD, y, getRect().getWidth() - PREVIEW_HPAD, y - BTN_HEIGHT); - //childSetCommitCallback("playback_slider", onSliderMove, this); - - //childSetCommitCallback("preview_base_anim", onCommitBaseAnim, this); - //childSetValue("preview_base_anim", "Standing"); - - //childSetCommitCallback("priority", onCommitPriority, this); - //childSetCommitCallback("loop_check", onCommitLoop, this); - //childSetCommitCallback("loop_in_point", onCommitLoopIn, this); - //childSetValidate("loop_in_point", validateLoopIn); - //childSetCommitCallback("loop_out_point", onCommitLoopOut, this); - //childSetValidate("loop_out_point", validateLoopOut); - - //childSetCommitCallback("hand_pose_combo", onCommitHandPose, this); - - //childSetCommitCallback("emote_combo", onCommitEmote, this); - //childSetValue("emote_combo", "[None]"); - - //childSetCommitCallback("ease_in_time", onCommitEaseIn, this); - //childSetValidate("ease_in_time", validateEaseIn); - //childSetCommitCallback("ease_out_time", onCommitEaseOut, this); - //childSetValidate("ease_out_time", validateEaseOut); // moved declaration from below BOOL success = false; @@ -364,6 +330,7 @@ BOOL LLFloaterBvhPreview::postBuild() // moved everything bvh from below if(loaderp && loaderp->isInitialized() && loaderp->getDuration() <= MAX_ANIM_DURATION) { + // generate unique id for this motion mTransactionID.generate(); mMotionID = mTransactionID.makeAssetID(gAgent.getSecureSessionID()); @@ -373,13 +340,9 @@ BOOL LLFloaterBvhPreview::postBuild() // this motion will not request an asset transfer until next update, so we have a chance to // load the keyframe data locally if (mInWorld) - { motionp = (LLKeyframeMotion*)gAgentAvatarp->createMotion(mMotionID); - } else - { motionp = (LLKeyframeMotion*)mAnimPreview->getDummyAvatar()->createMotion(mMotionID); - } // create data buffer for keyframe initialization S32 buffer_size = loaderp->getOutputSize(); @@ -476,21 +439,20 @@ BOOL LLFloaterBvhPreview::postBuild() mAnimPreview->setZoom(camera_zoom); } - motionp->setName(childGetValue("name_form").asString()); + motionp->setName(getChild("name_form")->getValue().asString()); if (!mInWorld) - { mAnimPreview->getDummyAvatar()->startMotion(mMotionID); - } - childSetMinValue("playback_slider", 0.0); - childSetMaxValue("playback_slider", 1.0); - childSetValue("loop_check", LLSD(motionp->getLoop())); - childSetValue("loop_in_point", LLSD(motionp->getLoopIn() / motionp->getDuration() * 100.f)); - childSetValue("loop_out_point", LLSD(motionp->getLoopOut() / motionp->getDuration() * 100.f)); - childSetValue("priority", LLSD((F32)motionp->getPriority())); - childSetValue("hand_pose_combo", LLHandMotion::getHandPoseName(motionp->getHandPose())); - childSetValue("ease_in_time", LLSD(motionp->getEaseInDuration())); - childSetValue("ease_out_time", LLSD(motionp->getEaseOutDuration())); + getChild("playback_slider")->setMinValue(0.0); + getChild("playback_slider")->setMaxValue(1.0); + + getChild("loop_check")->setValue(LLSD(motionp->getLoop())); + getChild("loop_in_point")->setValue(LLSD(motionp->getLoopIn() / motionp->getDuration() * 100.f)); + getChild("loop_out_point")->setValue(LLSD(motionp->getLoopOut() / motionp->getDuration() * 100.f)); + getChild("priority")->setValue(LLSD((F32)motionp->getPriority())); + getChild("hand_pose_combo")->setValue(LLHandMotion::getHandPoseName(motionp->getHandPose())); + getChild("ease_in_time")->setValue(LLSD(motionp->getEaseInDuration())); + getChild("ease_out_time")->setValue(LLSD(motionp->getEaseOutDuration())); setEnabled(TRUE); std::string seconds_string; seconds_string = llformat(" - %.2f seconds", motionp->getDuration()); @@ -501,7 +463,7 @@ BOOL LLFloaterBvhPreview::postBuild() { mAnimPreview = NULL; mMotionID.setNull(); - childSetValue("bad_animation_text", getString("failed_to_initialize")); + getChild("bad_animation_text")->setValue(getString("failed_to_initialize")); } @@ -587,38 +549,37 @@ void LLFloaterBvhPreview::draw() void LLFloaterBvhPreview::resetMotion() { LLVOAvatar* avatarp; - if (mInWorld) - { + if (mInWorld && gAgentAvatarp) avatarp = gAgentAvatarp; - } - else - { + else if (mAnimPreview) avatarp = mAnimPreview->getDummyAvatar(); - } - if (!avatarp) - { + else return; - } BOOL paused = avatarp->areAnimationsPaused(); - // *TODO: Fix awful casting hack - LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(mMotionID); + LLKeyframeMotion* motionp = dynamic_cast(avatarp->findMotion(mMotionID)); + if( motionp ) + { + // Set emotion + std::string emote = getChild("emote_combo")->getValue().asString(); + motionp->setEmote(mIDList[emote]); + } - // Set emotion - std::string emote = childGetValue("emote_combo").asString(); - motionp->setEmote(mIDList[emote]); - - LLUUID base_id = mIDList[childGetValue("preview_base_anim").asString()]; + LLUUID base_id = mIDList[getChild("preview_base_anim")->getValue().asString()]; avatarp->deactivateAllMotions(); - avatarp->startMotion(base_id, BASE_ANIM_TIME_OFFSET); avatarp->startMotion(mMotionID, 0.0f); - childSetValue("playback_slider", 0.0f); + avatarp->startMotion(base_id, BASE_ANIM_TIME_OFFSET); + getChild("playback_slider")->setValue(0.0f); // Set pose - std::string handpose = childGetValue("hand_pose_combo").asString(); + std::string handpose = getChild("hand_pose_combo")->getValue().asString(); avatarp->startMotion( ANIM_AGENT_HAND_MOTION, 0.0f ); - motionp->setHandPose(LLHandMotion::getHandPose(handpose)); + + if( motionp ) + { + motionp->setHandPose(LLHandMotion::getHandPose(handpose)); + } if (paused) { @@ -667,9 +628,7 @@ BOOL LLFloaterBvhPreview::handleMouseUp(S32 x, S32 y, MASK mask) BOOL LLFloaterBvhPreview::handleHover(S32 x, S32 y, MASK mask) { if (mInWorld) - { return TRUE; - } MASK local_mask = mask & ~MASK_ALT; @@ -726,11 +685,12 @@ BOOL LLFloaterBvhPreview::handleHover(S32 x, S32 y, MASK mask) //----------------------------------------------------------------------------- BOOL LLFloaterBvhPreview::handleScrollWheel(S32 x, S32 y, S32 clicks) { - if (!mInWorld) - { - mAnimPreview->zoom((F32)clicks * -0.2f); - mAnimPreview->requestUpdate(); - } + if (mInWorld || !mAnimPreview) + return false; + + mAnimPreview->zoom((F32)clicks * -0.2f); + mAnimPreview->requestUpdate(); + return TRUE; } @@ -740,9 +700,7 @@ BOOL LLFloaterBvhPreview::handleScrollWheel(S32 x, S32 y, S32 clicks) void LLFloaterBvhPreview::onMouseCaptureLost() { if (!mInWorld) - { gViewerWindow->showCursor(); - } } //----------------------------------------------------------------------------- @@ -756,38 +714,25 @@ void LLFloaterBvhPreview::onBtnPlay() if (mMotionID.notNull()) { LLVOAvatar* avatarp; - if (mInWorld) - { - if (!gAgentAvatarp) - { - return; - } + if (mInWorld && gAgentAvatarp) avatarp = gAgentAvatarp; - } - else - { - if (!mAnimPreview) - { - return; - } + else if (mAnimPreview) avatarp = mAnimPreview->getDummyAvatar(); - } + else + return; if(!avatarp->isMotionActive(mMotionID)) { resetMotion(); mPauseRequest = NULL; } - else + else if (avatarp->areAnimationsPaused()) { - if (avatarp->areAnimationsPaused()) - { - mPauseRequest = NULL; - } - else - { - mPauseRequest = avatarp->requestPause(); - } + mPauseRequest = NULL; + } + else //onBtnPause() does this in v3 + { + mPauseRequest = avatarp->requestPause(); } } } @@ -803,22 +748,12 @@ void LLFloaterBvhPreview::onBtnStop() if (mMotionID.notNull()) { LLVOAvatar* avatarp; - if (mInWorld) - { - if (!gAgentAvatarp) - { - return; - } + if (mInWorld && gAgentAvatarp) avatarp = gAgentAvatarp; - } - else - { - if (!mAnimPreview) - { - return; - } + else if (mAnimPreview) avatarp = mAnimPreview->getDummyAvatar(); - } + else + return; resetMotion(); mPauseRequest = avatarp->requestPause(); } @@ -827,435 +762,320 @@ void LLFloaterBvhPreview::onBtnStop() //----------------------------------------------------------------------------- // onSliderMove() //----------------------------------------------------------------------------- -void LLFloaterBvhPreview::onSliderMove(LLUICtrl* ctrl, void*user_data) +void LLFloaterBvhPreview::onSliderMove() { - LLFloaterBvhPreview* previewp = (LLFloaterBvhPreview*)user_data; - if (!previewp->getEnabled()) + if (!getEnabled()) return; LLVOAvatar* avatarp; - if (previewp->mInWorld) - { - if (!gAgentAvatarp) - { - return; - } + if (mInWorld && gAgentAvatarp) avatarp = gAgentAvatarp; - } + else if (mAnimPreview) + avatarp = mAnimPreview->getDummyAvatar(); else - { - if (!previewp->mAnimPreview) - { - return; - } - avatarp = previewp->mAnimPreview->getDummyAvatar(); - } - F32 slider_value = (F32)previewp->childGetValue("playback_slider").asReal(); - LLUUID base_id = previewp->mIDList[previewp->childGetValue("preview_base_anim").asString()]; - LLMotion* motionp = avatarp->findMotion(previewp->mMotionID); + return; + + F32 slider_value = (F32)getChild("playback_slider")->getValue().asReal(); + LLUUID base_id = mIDList[getChild("preview_base_anim")->getValue().asString()]; + LLMotion* motionp = avatarp->findMotion(mMotionID); F32 duration = motionp->getDuration();// + motionp->getEaseOutDuration(); F32 delta_time = duration * slider_value; avatarp->deactivateAllMotions(); avatarp->startMotion(base_id, delta_time + BASE_ANIM_TIME_OFFSET); - avatarp->startMotion(previewp->mMotionID, delta_time); - previewp->mPauseRequest = avatarp->requestPause(); - previewp->refresh(); + avatarp->startMotion(mMotionID, delta_time); + mPauseRequest = avatarp->requestPause(); + refresh(); } //----------------------------------------------------------------------------- // onCommitBaseAnim() //----------------------------------------------------------------------------- -void LLFloaterBvhPreview::onCommitBaseAnim(LLUICtrl* ctrl, void* data) +void LLFloaterBvhPreview::onCommitBaseAnim() { - LLFloaterBvhPreview* previewp = (LLFloaterBvhPreview*)data; - if (!previewp->getEnabled()) + if (!getEnabled()) return; LLVOAvatar* avatarp; - if (previewp->mInWorld) - { - if (!gAgentAvatarp) - { - return; - } + if (mInWorld && gAgentAvatarp) avatarp = gAgentAvatarp; - } + else if (mAnimPreview) + avatarp = mAnimPreview->getDummyAvatar(); else - { - if (!previewp->mAnimPreview) - { - return; - } - avatarp = previewp->mAnimPreview->getDummyAvatar(); - } + return; BOOL paused = avatarp->areAnimationsPaused(); // stop all other possible base motions - avatarp->stopMotion(ANIM_AGENT_STAND, TRUE); - avatarp->stopMotion(ANIM_AGENT_WALK, TRUE); - avatarp->stopMotion(ANIM_AGENT_SIT, TRUE); - avatarp->stopMotion(ANIM_AGENT_HOVER, TRUE); + avatarp->stopMotion(mIDList["Standing"], TRUE); + avatarp->stopMotion(mIDList["Walking"], TRUE); + avatarp->stopMotion(mIDList["Sitting"], TRUE); + avatarp->stopMotion(mIDList["Flying"], TRUE); - previewp->resetMotion(); + resetMotion(); if (!paused) { - previewp->mPauseRequest = NULL; + mPauseRequest = NULL; } } //----------------------------------------------------------------------------- // onCommitLoop() //----------------------------------------------------------------------------- -void LLFloaterBvhPreview::onCommitLoop(LLUICtrl* ctrl, void* data) +void LLFloaterBvhPreview::onCommitLoop() { - LLFloaterBvhPreview* previewp = (LLFloaterBvhPreview*)data; - if (!previewp->getEnabled()) + if (!getEnabled()) return; - + LLVOAvatar* avatarp; - if (previewp->mInWorld) - { - if (!gAgentAvatarp) - { - return; - } + if (mInWorld && gAgentAvatarp) avatarp = gAgentAvatarp; - } + else if (mAnimPreview) + avatarp = mAnimPreview->getDummyAvatar(); else - { - if (!previewp->mAnimPreview) - { - return; - } - avatarp = previewp->mAnimPreview->getDummyAvatar(); - } - LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID); + return; + + LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(mMotionID); if (motionp) { - motionp->setLoop(previewp->childGetValue("loop_check").asBoolean()); - motionp->setLoopIn((F32)previewp->childGetValue("loop_in_point").asReal() * 0.01f * motionp->getDuration()); - motionp->setLoopOut((F32)previewp->childGetValue("loop_out_point").asReal() * 0.01f * motionp->getDuration()); + motionp->setLoop(getChild("loop_check")->getValue().asBoolean()); + motionp->setLoopIn((F32)getChild("loop_in_point")->getValue().asReal() * 0.01f * motionp->getDuration()); + motionp->setLoopOut((F32)getChild("loop_out_point")->getValue().asReal() * 0.01f * motionp->getDuration()); } } //----------------------------------------------------------------------------- // onCommitLoopIn() //----------------------------------------------------------------------------- -void LLFloaterBvhPreview::onCommitLoopIn(LLUICtrl* ctrl, void* data) +void LLFloaterBvhPreview::onCommitLoopIn() { - LLFloaterBvhPreview* previewp = (LLFloaterBvhPreview*)data; - if (!previewp->getEnabled()) + if (!getEnabled()) return; LLVOAvatar* avatarp; - if (previewp->mInWorld) - { - if (!gAgentAvatarp) - { - return; - } + if (mInWorld && gAgentAvatarp) avatarp = gAgentAvatarp; - } + else if (mAnimPreview) + avatarp = mAnimPreview->getDummyAvatar(); else - { - if (!previewp->mAnimPreview) - { - return; - } - avatarp = previewp->mAnimPreview->getDummyAvatar(); - } - LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID); + return; + + LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(mMotionID); if (motionp) { - motionp->setLoopIn((F32)previewp->childGetValue("loop_in_point").asReal() / 100.f); - previewp->resetMotion(); - previewp->childSetValue("loop_check", LLSD(TRUE)); - onCommitLoop(ctrl, data); + motionp->setLoopIn((F32)getChild("loop_in_point")->getValue().asReal() / 100.f); + resetMotion(); + getChild("loop_check")->setValue(LLSD(TRUE)); + onCommitLoop(); } } //----------------------------------------------------------------------------- // onCommitLoopOut() //----------------------------------------------------------------------------- -void LLFloaterBvhPreview::onCommitLoopOut(LLUICtrl* ctrl, void* data) +void LLFloaterBvhPreview::onCommitLoopOut() { - LLFloaterBvhPreview* previewp = (LLFloaterBvhPreview*)data; - if (!previewp->getEnabled()) + if (!getEnabled()) return; LLVOAvatar* avatarp; - if (previewp->mInWorld) - { - if (!gAgentAvatarp) - { - return; - } + if (mInWorld && gAgentAvatarp) avatarp = gAgentAvatarp; - } + else if (mAnimPreview) + avatarp = mAnimPreview->getDummyAvatar(); else - { - if (!previewp->mAnimPreview) - { - return; - } - avatarp = previewp->mAnimPreview->getDummyAvatar(); - } - LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID); + return; + + LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(mMotionID); if (motionp) { - motionp->setLoopOut((F32)previewp->childGetValue("loop_out_point").asReal() * 0.01f * motionp->getDuration()); - previewp->resetMotion(); - previewp->childSetValue("loop_check", LLSD(TRUE)); - onCommitLoop(ctrl, data); + motionp->setLoopOut((F32)getChild("loop_out_point")->getValue().asReal() * 0.01f * motionp->getDuration()); + resetMotion(); + getChild("loop_check")->setValue(LLSD(TRUE)); + onCommitLoop(); } } //----------------------------------------------------------------------------- // onCommitName() //----------------------------------------------------------------------------- -void LLFloaterBvhPreview::onCommitName(LLUICtrl* ctrl, void* data) +void LLFloaterBvhPreview::onCommitName() { - LLFloaterBvhPreview* previewp = (LLFloaterBvhPreview*)data; - if (!previewp->getEnabled()) + if (!getEnabled()) return; LLVOAvatar* avatarp; - if (previewp->mInWorld) - { - if (!gAgentAvatarp) - { - return; - } + if (mInWorld && gAgentAvatarp) avatarp = gAgentAvatarp; - } + else if (mAnimPreview) + avatarp = mAnimPreview->getDummyAvatar(); else - { - if (!previewp->mAnimPreview) - { - return; - } - avatarp = previewp->mAnimPreview->getDummyAvatar(); - } - LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID); + return; + + LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(mMotionID); if (motionp) { - motionp->setName(previewp->childGetValue("name_form").asString()); + motionp->setName(getChild("name_form")->getValue().asString()); } - LLFloaterNameDesc::doCommit(ctrl, data); + doCommit(); } //----------------------------------------------------------------------------- // onCommitHandPose() //----------------------------------------------------------------------------- -void LLFloaterBvhPreview::onCommitHandPose(LLUICtrl* ctrl, void* data) +void LLFloaterBvhPreview::onCommitHandPose() { - LLFloaterBvhPreview* previewp = (LLFloaterBvhPreview*)data; - if (!previewp->getEnabled()) + if (!getEnabled()) return; - previewp->resetMotion(); // sets hand pose + resetMotion(); // sets hand pose } //----------------------------------------------------------------------------- // onCommitEmote() //----------------------------------------------------------------------------- -void LLFloaterBvhPreview::onCommitEmote(LLUICtrl* ctrl, void* data) +void LLFloaterBvhPreview::onCommitEmote() { - LLFloaterBvhPreview* previewp = (LLFloaterBvhPreview*)data; - if (!previewp->getEnabled()) + if (!getEnabled()) return; - previewp->resetMotion(); // ssts emote + resetMotion(); // ssts emote } //----------------------------------------------------------------------------- // onCommitPriority() //----------------------------------------------------------------------------- -void LLFloaterBvhPreview::onCommitPriority(LLUICtrl* ctrl, void* data) +void LLFloaterBvhPreview::onCommitPriority() { - LLFloaterBvhPreview* previewp = (LLFloaterBvhPreview*)data; - if (!previewp->getEnabled()) + if (!getEnabled()) return; LLVOAvatar* avatarp; - if (previewp->mInWorld) - { - if (!gAgentAvatarp) - { - return; - } + if (mInWorld && gAgentAvatarp) avatarp = gAgentAvatarp; - } + else if (mAnimPreview) + avatarp = mAnimPreview->getDummyAvatar(); else - { - if (!previewp->mAnimPreview) - { - return; - } - avatarp = previewp->mAnimPreview->getDummyAvatar(); - } - LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID); + return; - motionp->setPriority(llfloor((F32)previewp->childGetValue("priority").asReal())); + LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(mMotionID); + + motionp->setPriority(llfloor((F32)getChild("priority")->getValue().asReal())); } //----------------------------------------------------------------------------- // onCommitEaseIn() //----------------------------------------------------------------------------- -void LLFloaterBvhPreview::onCommitEaseIn(LLUICtrl* ctrl, void* data) +void LLFloaterBvhPreview::onCommitEaseIn() { - LLFloaterBvhPreview* previewp = (LLFloaterBvhPreview*)data; - if (!previewp->getEnabled()) + if (!getEnabled()) return; LLVOAvatar* avatarp; - if (previewp->mInWorld) - { - if (!gAgentAvatarp) - { - return; - } + if (mInWorld && gAgentAvatarp) avatarp = gAgentAvatarp; - } + else if (mAnimPreview) + avatarp = mAnimPreview->getDummyAvatar(); else - { - if (!previewp->mAnimPreview) - { - return; - } - avatarp = previewp->mAnimPreview->getDummyAvatar(); - } - LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID); + return; - motionp->setEaseIn((F32)previewp->childGetValue("ease_in_time").asReal()); - previewp->resetMotion(); + LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(mMotionID); + + motionp->setEaseIn((F32)getChild("ease_in_time")->getValue().asReal()); + resetMotion(); } //----------------------------------------------------------------------------- // onCommitEaseOut() //----------------------------------------------------------------------------- -void LLFloaterBvhPreview::onCommitEaseOut(LLUICtrl* ctrl, void* data) +void LLFloaterBvhPreview::onCommitEaseOut() { - LLFloaterBvhPreview* previewp = (LLFloaterBvhPreview*)data; - if (!previewp->getEnabled()) + if (!getEnabled()) return; LLVOAvatar* avatarp; - if (previewp->mInWorld) - { - if (!gAgentAvatarp) - { - return; - } + if (mInWorld && gAgentAvatarp) avatarp = gAgentAvatarp; - } + else if (mAnimPreview) + avatarp = mAnimPreview->getDummyAvatar(); else - { - if (!previewp->mAnimPreview) - { - return; - } - avatarp = previewp->mAnimPreview->getDummyAvatar(); - } - LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID); + return; - motionp->setEaseOut((F32)previewp->childGetValue("ease_out_time").asReal()); - previewp->resetMotion(); + LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(mMotionID); + + motionp->setEaseOut((F32)getChild("ease_out_time")->getValue().asReal()); + resetMotion(); } //----------------------------------------------------------------------------- // validateEaseIn() //----------------------------------------------------------------------------- -BOOL LLFloaterBvhPreview::validateEaseIn(LLUICtrl* spin, void* data) +bool LLFloaterBvhPreview::validateEaseIn(const LLSD& data) { - LLFloaterBvhPreview* previewp = (LLFloaterBvhPreview*)data; - if (!previewp->getEnabled()) - return FALSE; + if (!getEnabled()) + return false; LLVOAvatar* avatarp; - if (previewp->mInWorld) - { - if (!gAgentAvatarp) - { - return FALSE; - } + if (mInWorld && gAgentAvatarp) avatarp = gAgentAvatarp; - } + else if (mAnimPreview) + avatarp = mAnimPreview->getDummyAvatar(); else - { - if (!previewp->mAnimPreview) - { - return FALSE; - } - avatarp = previewp->mAnimPreview->getDummyAvatar(); - } - LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID); + return false; + + LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(mMotionID); if (!motionp->getLoop()) { - F32 new_ease_in = llclamp((F32)previewp->childGetValue("ease_in_time").asReal(), 0.f, motionp->getDuration() - motionp->getEaseOutDuration()); - previewp->childSetValue("ease_in_time", LLSD(new_ease_in)); + F32 new_ease_in = llclamp((F32)getChild("ease_in_time")->getValue().asReal(), 0.f, motionp->getDuration() - motionp->getEaseOutDuration()); + getChild("ease_in_time")->setValue(LLSD(new_ease_in)); } - return TRUE; + return true; } //----------------------------------------------------------------------------- // validateEaseOut() //----------------------------------------------------------------------------- -BOOL LLFloaterBvhPreview::validateEaseOut(LLUICtrl* spin, void* data) +bool LLFloaterBvhPreview::validateEaseOut(const LLSD& data) { - LLFloaterBvhPreview* previewp = (LLFloaterBvhPreview*)data; - - if (!previewp->getEnabled()) - return FALSE; + if (!getEnabled()) + return false; LLVOAvatar* avatarp; - if (previewp->mInWorld) - { - if (!gAgentAvatarp) - { - return FALSE; - } + if (mInWorld && gAgentAvatarp) avatarp = gAgentAvatarp; - } + else if (mAnimPreview) + avatarp = mAnimPreview->getDummyAvatar(); else - { - if (!previewp->mAnimPreview) - { - return FALSE; - } - avatarp = previewp->mAnimPreview->getDummyAvatar(); - } - LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(previewp->mMotionID); + return false; + + LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(mMotionID); if (!motionp->getLoop()) { - F32 new_ease_out = llclamp((F32)previewp->childGetValue("ease_out_time").asReal(), 0.f, motionp->getDuration() - motionp->getEaseInDuration()); - previewp->childSetValue("ease_out_time", LLSD(new_ease_out)); + F32 new_ease_out = llclamp((F32)getChild("ease_out_time")->getValue().asReal(), 0.f, motionp->getDuration() - motionp->getEaseInDuration()); + getChild("ease_out_time")->setValue(LLSD(new_ease_out)); } - return TRUE; + return true; } //----------------------------------------------------------------------------- // validateLoopIn() //----------------------------------------------------------------------------- -BOOL LLFloaterBvhPreview::validateLoopIn(LLUICtrl* ctrl, void* data) +bool LLFloaterBvhPreview::validateLoopIn(const LLSD& data) { - LLFloaterBvhPreview* previewp = (LLFloaterBvhPreview*)data; - if (!previewp->getEnabled()) - return FALSE; + if (!getEnabled()) + return false; - F32 loop_in_value = (F32)previewp->childGetValue("loop_in_point").asReal(); - F32 loop_out_value = (F32)previewp->childGetValue("loop_out_point").asReal(); + F32 loop_in_value = (F32)getChild("loop_in_point")->getValue().asReal(); + F32 loop_out_value = (F32)getChild("loop_out_point")->getValue().asReal(); if (loop_in_value < 0.f) { @@ -1270,21 +1090,20 @@ BOOL LLFloaterBvhPreview::validateLoopIn(LLUICtrl* ctrl, void* data) loop_in_value = loop_out_value; } - previewp->childSetValue("loop_in_point", LLSD(loop_in_value)); - return TRUE; + getChild("loop_in_point")->setValue(LLSD(loop_in_value)); + return true; } //----------------------------------------------------------------------------- // validateLoopOut() //----------------------------------------------------------------------------- -BOOL LLFloaterBvhPreview::validateLoopOut(LLUICtrl* spin, void* data) +bool LLFloaterBvhPreview::validateLoopOut(const LLSD& data) { - LLFloaterBvhPreview* previewp = (LLFloaterBvhPreview*)data; - if (!previewp->getEnabled()) - return FALSE; + if (!getEnabled()) + return false; - F32 loop_out_value = (F32)previewp->childGetValue("loop_out_point").asReal(); - F32 loop_in_value = (F32)previewp->childGetValue("loop_in_point").asReal(); + F32 loop_out_value = (F32)getChild("loop_out_point")->getValue().asReal(); + F32 loop_in_value = (F32)getChild("loop_in_point")->getValue().asReal(); if (loop_out_value < 0.f) { @@ -1299,8 +1118,8 @@ BOOL LLFloaterBvhPreview::validateLoopOut(LLUICtrl* spin, void* data) loop_out_value = loop_in_value; } - previewp->childSetValue("loop_out_point", LLSD(loop_out_value)); - return TRUE; + getChild("loop_out_point")->setValue(LLSD(loop_out_value)); + return true; } @@ -1309,66 +1128,59 @@ BOOL LLFloaterBvhPreview::validateLoopOut(LLUICtrl* spin, void* data) //----------------------------------------------------------------------------- void LLFloaterBvhPreview::refresh() { + // Are we showing the play button (default) or the pause button? + bool show_play = true; if (!mAnimPreview) { - childShow("bad_animation_text"); + getChildView("bad_animation_text")->setVisible(TRUE); + // play button visible but disabled mPlayButton->setEnabled(FALSE); mStopButton->setEnabled(FALSE); - childDisable("ok_btn"); + getChildView("ok_btn")->setEnabled(FALSE); } else { if (!mInWorld) - { - childHide("bad_animation_text"); - } + getChildView("bad_animation_text")->setVisible(FALSE); + // re-enabled in case previous animation was bad mPlayButton->setEnabled(TRUE); + mStopButton->setEnabled(TRUE); LLVOAvatar* avatarp; - if (mInWorld) - { + if (mInWorld && gAgentAvatarp) avatarp = gAgentAvatarp; - } - else - { + else if (mAnimPreview) avatarp = mAnimPreview->getDummyAvatar(); - } + else + return; if (avatarp->isMotionActive(mMotionID)) { mStopButton->setEnabled(TRUE); LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(mMotionID); - if (avatarp->areAnimationsPaused()) - { - - mPlayButton->setImages(std::string("button_anim_play.tga"), - std::string("button_anim_play_selected.tga")); - - } - else + if (!avatarp->areAnimationsPaused()) { + // animation is playing if (motionp) { F32 fraction_complete = motionp->getLastUpdateTime() / motionp->getDuration(); - childSetValue("playback_slider", fraction_complete); + getChild("playback_slider")->setValue(fraction_complete); } - mPlayButton->setImages(std::string("button_anim_pause.tga"), - std::string("button_anim_pause_selected.tga")); - + show_play = false; } } else { + // Motion just finished playing mPauseRequest = avatarp->requestPause(); - mPlayButton->setImages(std::string("button_anim_play.tga"), - std::string("button_anim_play_selected.tga")); - - mStopButton->setEnabled(TRUE); // stop also resets, leave enabled. } - childEnable("ok_btn"); + getChildView("ok_btn")->setEnabled(TRUE); if (!mInWorld) - { mAnimPreview->requestUpdate(); - } } + if (show_play) + mPlayButton->setImages(std::string("button_anim_play.tga"), std::string("button_anim_play_selected.tga")); + else + mPlayButton->setImages(std::string("button_anim_pause.tga"), std::string("button_anim_pause_selected.tga")); + } //----------------------------------------------------------------------------- @@ -1403,10 +1215,10 @@ void LLFloaterBvhPreview::onBtnOK(void* userdata) file.setMaxSize(size); if (file.write((U8*)buffer, size)) { - std::string name = floaterp->childGetValue("name_form").asString(); - std::string desc = floaterp->childGetValue("description_form").asString(); + std::string name = floaterp->getChild("name_form")->getValue().asString(); + std::string desc = floaterp->getChild("description_form")->getValue().asString(); LLAssetStorage::LLStoreAssetCallback callback = NULL; - S32 expected_upload_cost = sUploadAmount; + S32 expected_upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); void *userdata = NULL; // @@ -1572,9 +1384,13 @@ BOOL LLPreviewAnimation::render() LLVertexBuffer::unbind(); LLGLDepthTest gls_depth(GL_TRUE); - LLDrawPoolAvatar *avatarPoolp = (LLDrawPoolAvatar *)avatarp->mDrawable->getFace(0)->getPool(); - avatarp->dirtyMesh(); - avatarPoolp->renderAvatars(avatarp); // renders only one avatar + LLFace* face = avatarp->mDrawable->getFace(0); + if (face) + { + LLDrawPoolAvatar *avatarPoolp = (LLDrawPoolAvatar *)face->getPool(); + avatarp->dirtyMesh(); + avatarPoolp->renderAvatars(avatarp); // renders only one avatar + } } gGL.color4f(1,1,1,1); diff --git a/indra/newview/llfloaterbvhpreview.h b/indra/newview/llfloaterbvhpreview.h index 78b9db6a0..7f31054c0 100644 --- a/indra/newview/llfloaterbvhpreview.h +++ b/indra/newview/llfloaterbvhpreview.h @@ -3,10 +3,9 @@ * @brief LLFloaterBvhPreview class definition * * $LicenseInfo:firstyear=2004&license=viewergpl$ - * + * Second Life Viewer Source Code * Copyright (c) 2004-2009, Linden Research, Inc. * - * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab * to you under the terms of the GNU General Public License, version 2.0 * ("GPL"), unless you have obtained a separate licensing agreement @@ -92,22 +91,21 @@ public: void onBtnPlay(); void onBtnStop(); - static void setUploadAmount(S32 amount) { sUploadAmount = amount; } - static void onSliderMove(LLUICtrl*, void*); - static void onCommitBaseAnim(LLUICtrl*, void*); - static void onCommitLoop(LLUICtrl*, void*); - static void onCommitLoopIn(LLUICtrl*, void*); - static void onCommitLoopOut(LLUICtrl*, void*); - static BOOL validateLoopIn(LLUICtrl*, void*); - static BOOL validateLoopOut(LLUICtrl*, void*); - static void onCommitName(LLUICtrl*, void*); - static void onCommitHandPose(LLUICtrl*, void*); - static void onCommitEmote(LLUICtrl*, void*); - static void onCommitPriority(LLUICtrl*, void*); - static void onCommitEaseIn(LLUICtrl*, void*); - static void onCommitEaseOut(LLUICtrl*, void*); - static BOOL validateEaseIn(LLUICtrl*, void*); - static BOOL validateEaseOut(LLUICtrl*, void*); + void onSliderMove(); + void onCommitBaseAnim(); + void onCommitLoop(); + void onCommitLoopIn(); + void onCommitLoopOut(); + bool validateLoopIn(const LLSD& data); + bool validateLoopOut(const LLSD& data); + void onCommitName(); + void onCommitHandPose(); + void onCommitEmote(); + void onCommitPriority(); + void onCommitEaseIn(); + void onCommitEaseOut(); + bool validateEaseIn(const LLSD& data); + bool validateEaseOut(const LLSD& data); static void onBtnOK(void*); static void onSaveComplete(const LLUUID& asset_uuid, LLAssetType::EType type, @@ -129,14 +127,10 @@ protected: LLRectf mPreviewImageRect; LLAssetID mMotionID; LLTransactionID mTransactionID; - BOOL mEnabled; BOOL mInWorld; LLAnimPauseRequest mPauseRequest; std::map mIDList; - - static S32 sUploadAmount; - // void* mItem; // diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp index a46790763..74093f243 100644 --- a/indra/newview/llfloaterimagepreview.cpp +++ b/indra/newview/llfloaterimagepreview.cpp @@ -3,10 +3,9 @@ * @brief LLFloaterImagePreview class implementation * * $LicenseInfo:firstyear=2004&license=viewergpl$ - * + * Second Life Viewer Source Code * Copyright (c) 2004-2009, Linden Research, Inc. * - * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab * to you under the terms of the GNU General Public License, version 2.0 * ("GPL"), unless you have obtained a separate licensing agreement @@ -60,15 +59,9 @@ #include "llviewershadermgr.h" #include "llviewertexturelist.h" #include "llstring.h" -// -#include "llviewercontrol.h" -// #include "hippogridmanager.h" -//static -S32 LLFloaterImagePreview::sUploadAmount = 10; - const S32 PREVIEW_BORDER_WIDTH = 2; const S32 PREVIEW_RESIZE_HANDLE_SIZE = S32(RESIZE_HANDLE_WIDTH * OO_SQRT2) + PREVIEW_BORDER_WIDTH; const S32 PREVIEW_HPAD = PREVIEW_RESIZE_HANDLE_SIZE; @@ -79,20 +72,11 @@ const S32 PREVIEW_TEXTURE_HEIGHT = 300; //----------------------------------------------------------------------------- // LLFloaterImagePreview() //----------------------------------------------------------------------------- -LLFloaterImagePreview::LLFloaterImagePreview(const std::string& filename) : - LLFloaterNameDesc(filename), - mAvatarPreview(NULL), - mSculptedPreview(NULL), - mLastMouseX(0), - mLastMouseY(0), - mImagep(NULL) -{ - loadImage(mFilenameAndPath); -} - // LLFloaterImagePreview::LLFloaterImagePreview(const std::string& filename, void* item) : LLFloaterNameDesc(filename, item), +// + mAvatarPreview(NULL), mSculptedPreview(NULL), mLastMouseX(0), @@ -101,7 +85,6 @@ LLFloaterImagePreview::LLFloaterImagePreview(const std::string& filename, void* { loadImage(mFilenameAndPath); } -// //----------------------------------------------------------------------------- // postBuild() @@ -114,7 +97,6 @@ BOOL LLFloaterImagePreview::postBuild() } childSetLabelArg("ok_btn", "[UPLOADFEE]", gHippoGridManager->getConnectedGrid()->getUploadFee()); - childSetAction("ok_btn", onBtnOK, this); LLCtrlSelectionInterface* iface = childGetSelectionInterface("clothing_type_combo"); if (iface) @@ -129,7 +111,7 @@ BOOL LLFloaterImagePreview::postBuild() PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD); mPreviewImageRect.set(0.f, 1.f, 1.f, 0.f); - childHide("bad_image_text"); + getChildView("bad_image_text")->setVisible(FALSE); if (mRawImagep.notNull() && gAgent.getRegion() != NULL) { @@ -140,7 +122,7 @@ BOOL LLFloaterImagePreview::postBuild() mSculptedPreview->setPreviewTarget(mRawImagep, 2.0f); if (mRawImagep->getWidth() * mRawImagep->getHeight () <= LL_IMAGE_REZ_LOSSLESS_CUTOFF * LL_IMAGE_REZ_LOSSLESS_CUTOFF) - childEnable("lossless_check"); + getChildView("lossless_check")->setEnabled(TRUE); // gSavedSettings.setBOOL("TemporaryUpload",FALSE); @@ -151,11 +133,13 @@ BOOL LLFloaterImagePreview::postBuild() { mAvatarPreview = NULL; mSculptedPreview = NULL; - childShow("bad_image_text"); - childDisable("clothing_type_combo"); - childDisable("ok_btn"); + getChildView("bad_image_text")->setVisible(TRUE); + getChildView("clothing_type_combo")->setEnabled(FALSE); + getChildView("ok_btn")->setEnabled(FALSE); } + getChild("ok_btn")->setCommitCallback(boost::bind(&LLFloaterNameDesc::onBtnOK, this)); + return TRUE; } @@ -169,7 +153,6 @@ LLFloaterImagePreview::~LLFloaterImagePreview() mRawImagep = NULL; mAvatarPreview = NULL; mSculptedPreview = NULL; - mImagep = NULL ; } @@ -352,7 +335,6 @@ void LLFloaterImagePreview::draw() bool LLFloaterImagePreview::loadImage(const std::string& src_filename) { std::string exten = gDirUtilp->getExtension(src_filename); - U32 codec = LLImageBase::getCodecFromExtension(exten); LLPointer raw_image = new LLImageRaw; @@ -771,7 +753,6 @@ BOOL LLImagePreviewAvatar::render() LLVertexBuffer::unbind(); avatarp->updateLOD(); - if (avatarp->mDrawable.notNull()) { LLGLDepthTest gls_depth(GL_TRUE, GL_TRUE); @@ -918,7 +899,6 @@ void LLImagePreviewSculpted::setPreviewTarget(LLImageRaw* imagep, F32 distance) BOOL LLImagePreviewSculpted::render() { mNeedsUpdate = FALSE; - LLGLSUIDefault def; LLGLDisable no_blend(GL_BLEND); LLGLEnable cull(GL_CULL_FACE); diff --git a/indra/newview/llfloaterimagepreview.h b/indra/newview/llfloaterimagepreview.h index e55ea7f45..c2186450a 100644 --- a/indra/newview/llfloaterimagepreview.h +++ b/indra/newview/llfloaterimagepreview.h @@ -3,10 +3,9 @@ * @brief LLFloaterImagePreview class definition * * $LicenseInfo:firstyear=2004&license=viewergpl$ - * + * Second Life Viewer Source Code * Copyright (c) 2004-2009, Linden Research, Inc. * - * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab * to you under the terms of the GNU General Public License, version 2.0 * ("GPL"), unless you have obtained a separate licensing agreement @@ -115,9 +114,8 @@ protected: class LLFloaterImagePreview : public LLFloaterNameDesc { public: - LLFloaterImagePreview(const std::string& filename); // - LLFloaterImagePreview(const std::string& filename, void* item); + LLFloaterImagePreview(const std::string& filename, void* item = NULL); // virtual ~LLFloaterImagePreview(); @@ -129,7 +127,6 @@ public: BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); static void onMouseCaptureLostImagePreview(LLMouseHandler*); - static void setUploadAmount(S32 amount) { sUploadAmount = amount; } void clearAllPreviewTextures(); @@ -146,8 +143,6 @@ protected: LLRect mPreviewRect; LLRectf mPreviewImageRect; LLPointer mImagep ; - - static S32 sUploadAmount; }; #endif // LL_LLFLOATERIMAGEPREVIEW_H diff --git a/indra/newview/llfloaternamedesc.cpp b/indra/newview/llfloaternamedesc.cpp index 9ac324468..3d0645b7c 100644 --- a/indra/newview/llfloaternamedesc.cpp +++ b/indra/newview/llfloaternamedesc.cpp @@ -3,10 +3,9 @@ * @brief LLFloaterNameDesc class implementation * * $LicenseInfo:firstyear=2002&license=viewergpl$ - * + * Second Life Viewer Source Code * Copyright (c) 2002-2009, Linden Research, Inc. * - * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab * to you under the terms of the GNU General Public License, version 2.0 * ("GPL"), unless you have obtained a separate licensing agreement @@ -70,31 +69,16 @@ const S32 PREF_BUTTON_HEIGHT = 16; //----------------------------------------------------------------------------- // LLFloaterNameDesc() //----------------------------------------------------------------------------- -LLFloaterNameDesc::LLFloaterNameDesc(const std::string& filename ) - : LLFloater(std::string("Name/Description Floater")) -{ +LLFloaterNameDesc::LLFloaterNameDesc(const LLSD& filename, void* item ) + : LLFloater(std::string("Name/Description Floater")), // - mItem = NULL; + mItem(item), // - mFilenameAndPath = filename; - mFilename = gDirUtilp->getBaseFileName(filename, false); - // SL-5521 Maintain capitalization of filename when making the inventory item. JC - //LLStringUtil::toLower(mFilename); - mIsAudio = FALSE; -} - -// -LLFloaterNameDesc::LLFloaterNameDesc(const std::string& filename, void* item ) - : LLFloater(std::string("Name/Description Floater")) + mIsAudio(FALSE) { - mItem = item; - mFilenameAndPath = filename; - mFilename = gDirUtilp->getBaseFileName(filename, false); - // SL-5521 Maintain capitalization of filename when making the inventory item. JC - //LLStringUtil::toLower(mFilename); - mIsAudio = FALSE; + mFilenameAndPath = filename.asString(); + mFilename = gDirUtilp->getBaseFileName(mFilenameAndPath, false); } -// //----------------------------------------------------------------------------- // postBuild() @@ -109,11 +93,6 @@ BOOL LLFloaterNameDesc::postBuild() LLStringUtil::stripNonprintable(asset_name); LLStringUtil::trim(asset_name); - std::string exten = gDirUtilp->getExtension(asset_name); - if (exten == "wav") - { - mIsAudio = TRUE; - } asset_name = gDirUtilp->getBaseFileName(asset_name, true); // no extsntion setTitle(mFilename); @@ -128,8 +107,8 @@ BOOL LLFloaterNameDesc::postBuild() r.setLeftTopAndSize( PREVIEW_HPAD, y, line_width, PREVIEW_LINE_HEIGHT ); - childSetCommitCallback("name_form", doCommit, this); - childSetValue("name_form", LLSD(asset_name)); + getChild("name_form")->setCommitCallback(boost::bind(&LLFloaterNameDesc::doCommit, this)); + getChild("name_form")->setValue(LLSD(asset_name)); LLLineEditor *NameEditor = getChild("name_form"); if (NameEditor) @@ -142,7 +121,7 @@ BOOL LLFloaterNameDesc::postBuild() y -= PREVIEW_LINE_HEIGHT; r.setLeftTopAndSize( PREVIEW_HPAD, y, line_width, PREVIEW_LINE_HEIGHT ); - childSetCommitCallback("description_form", doCommit, this); + getChild("description_form")->setCommitCallback(boost::bind(&LLFloaterNameDesc::doCommit, this)); LLLineEditor *DescEditor = getChild("description_form"); if (DescEditor) { @@ -153,14 +132,10 @@ BOOL LLFloaterNameDesc::postBuild() y -= llfloor(PREVIEW_LINE_HEIGHT * 1.2f); // Cancel button - childSetAction("cancel_btn", onBtnCancel, this); + getChild("cancel_btn")->setCommitCallback(boost::bind(&LLFloaterNameDesc::onBtnCancel, this)); + + getChild("ok_btn")->setLabelArg("[UPLOADFEE]", llformat("%s%d", gHippoGridManager->getConnectedGrid()->getCurrencySymbol().c_str(), LLGlobalEconomy::Singleton::getInstance()->getPriceUpload())); - // OK button - childSetLabelArg("ok_btn", "[UPLOADFEE]", gHippoGridManager->getConnectedGrid()->getUploadFee()); - if (exten == "wav") - { - childSetAction("ok_btn", onBtnOK, this); - } setDefaultBtn("ok_btn"); return TRUE; @@ -182,45 +157,99 @@ void LLFloaterNameDesc::onCommit() { } -// static //----------------------------------------------------------------------------- // onCommit() //----------------------------------------------------------------------------- -void LLFloaterNameDesc::doCommit( class LLUICtrl *, void* userdata ) +void LLFloaterNameDesc::doCommit() { - LLFloaterNameDesc* self = (LLFloaterNameDesc*) userdata; - self->onCommit(); + onCommit(); } -// static //----------------------------------------------------------------------------- // onBtnOK() //----------------------------------------------------------------------------- -void LLFloaterNameDesc::onBtnOK( void* userdata ) +void LLFloaterNameDesc::onBtnOK() { - LLFloaterNameDesc *fp =(LLFloaterNameDesc *)userdata; - - fp->childDisable("ok_btn"); // don't allow inadvertent extra uploads + getChildView("ok_btn")->setEnabled(FALSE); // don't allow inadvertent extra uploads LLAssetStorage::LLStoreAssetCallback callback = NULL; S32 expected_upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); // kinda hack - assumes that unsubclassed LLFloaterNameDesc is only used for uploading chargeable assets, which it is right now (it's only used unsubclassed for the sound upload dialog, and THAT should be a subclass). void *nruserdata = NULL; std::string display_name = LLStringUtil::null; - upload_new_resource(fp->mFilenameAndPath, // file - fp->childGetValue("name_form").asString(), - fp->childGetValue("description_form").asString(), + upload_new_resource(mFilenameAndPath, // file + getChild("name_form")->getValue().asString(), + getChild("description_form")->getValue().asString(), 0, LLFolderType::FT_NONE, LLInventoryType::IT_NONE, LLFloaterPerms::getNextOwnerPerms(), LLFloaterPerms::getGroupPerms(), LLFloaterPerms::getEveryonePerms(), display_name, callback, expected_upload_cost, nruserdata); - fp->close(false); + close(false); } -// static //----------------------------------------------------------------------------- // onBtnCancel() //----------------------------------------------------------------------------- -void LLFloaterNameDesc::onBtnCancel( void* userdata ) +void LLFloaterNameDesc::onBtnCancel() { - LLFloaterNameDesc *fp =(LLFloaterNameDesc *)userdata; - fp->close(false); + close(false); +} + + +//----------------------------------------------------------------------------- +// LLFloaterSoundPreview() +//----------------------------------------------------------------------------- + +LLFloaterSoundPreview::LLFloaterSoundPreview(const LLSD& filename, void* item ) + : LLFloaterNameDesc(filename, item) +{ + mIsAudio = TRUE; +} + +BOOL LLFloaterSoundPreview::postBuild() +{ + if (!LLFloaterNameDesc::postBuild()) + { + return FALSE; + } + getChild("ok_btn")->setCommitCallback(boost::bind(&LLFloaterNameDesc::onBtnOK, this)); + return TRUE; +} + + +//----------------------------------------------------------------------------- +// LLFloaterAnimPreview() +//----------------------------------------------------------------------------- + +LLFloaterAnimPreview::LLFloaterAnimPreview(const LLSD& filename, void* item ) + : LLFloaterNameDesc(filename, item) +{ +} + +BOOL LLFloaterAnimPreview::postBuild() +{ + if (!LLFloaterNameDesc::postBuild()) + { + return FALSE; + } + getChild("ok_btn")->setCommitCallback(boost::bind(&LLFloaterNameDesc::onBtnOK, this)); + return TRUE; +} + +//----------------------------------------------------------------------------- +// LLFloaterScriptPreview() +//----------------------------------------------------------------------------- + +LLFloaterScriptPreview::LLFloaterScriptPreview(const LLSD& filename, void* item ) + : LLFloaterNameDesc(filename, item) +{ + mIsText = TRUE; +} + +BOOL LLFloaterScriptPreview::postBuild() +{ + if (!LLFloaterNameDesc::postBuild()) + { + return FALSE; + } + getChild("ok_btn")->setCommitCallback(boost::bind(&LLFloaterNameDesc::onBtnOK, this)); + return TRUE; } diff --git a/indra/newview/llfloaternamedesc.h b/indra/newview/llfloaternamedesc.h index 4febf390b..ad7472d4f 100644 --- a/indra/newview/llfloaternamedesc.h +++ b/indra/newview/llfloaternamedesc.h @@ -3,10 +3,9 @@ * @brief LLFloaterNameDesc class definition * * $LicenseInfo:firstyear=2002&license=viewergpl$ - * + * Second Life Viewer Source Code * Copyright (c) 2002-2009, Linden Research, Inc. * - * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab * to you under the terms of the GNU General Public License, version 2.0 * ("GPL"), unless you have obtained a separate licensing agreement @@ -44,29 +43,49 @@ class LLRadioGroup; class LLFloaterNameDesc : public LLFloater { public: - LLFloaterNameDesc(const std::string& filename); // - LLFloaterNameDesc(const std::string& filename, void* item); + LLFloaterNameDesc(const LLSD& filename, void* item = NULL); // virtual ~LLFloaterNameDesc(); virtual BOOL postBuild(); - static void doCommit(class LLUICtrl *, void* userdata); + void onBtnOK(); + void onBtnCancel(); + void doCommit(); + protected: virtual void onCommit(); protected: BOOL mIsAudio; + bool mIsText; std::string mFilenameAndPath; std::string mFilename; - // void* mItem; // +}; - static void onBtnOK(void*); - static void onBtnCancel(void*); +class LLFloaterSoundPreview : public LLFloaterNameDesc +{ +public: + LLFloaterSoundPreview(const LLSD& filename, void* item = NULL ); + virtual BOOL postBuild(); +}; + +class LLFloaterAnimPreview : public LLFloaterNameDesc +{ +public: + LLFloaterAnimPreview(const LLSD& filename, void* item = NULL ); + virtual BOOL postBuild(); +}; + +class LLFloaterScriptPreview : public LLFloaterNameDesc +{ +public: + LLFloaterScriptPreview(const LLSD& filename, void* item = NULL ); + virtual BOOL postBuild(); }; #endif // LL_LLFLOATERNAMEDESC_H diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 7492ea725..46cebc7b5 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -37,7 +37,6 @@ #include "llagent.h" #include "llagentcamera.h" #include "statemachine/aifilepicker.h" -#include "llfloateranimpreview.h" #include "llfloaterbvhpreview.h" #include "llfloaterimagepreview.h" #include "llfloatermodelpreview.h" @@ -217,7 +216,7 @@ bool AIFileUpload::is_valid(std::string const& filename, ELoadFilter type) // No extension LLSD args; args["FILE"] = short_name; - LLNotifications::instance().add("NoFileExtension", args); + LLNotificationsUtil::add("NoFileExtension", args); return false; } else @@ -260,7 +259,7 @@ bool AIFileUpload::is_valid(std::string const& filename, ELoadFilter type) LLSD args; args["EXTENSION"] = ext; args["VALIDS"] = valid_extensions; - LLNotifications::instance().add("InvalidFileExtension", args); + LLNotificationsUtil::add("InvalidFileExtension", args); return false; } }//end else (non-null extension) @@ -279,7 +278,7 @@ bool AIFileUpload::is_valid(std::string const& filename, ELoadFilter type) llinfos << error_msg << ": " << filename << llendl; LLSD args; args["FILE"] = filename; - LLNotifications::instance().add( error_msg, args ); + LLNotificationsUtil::add( error_msg, args ); return false; } }//end if a wave/sound file @@ -331,9 +330,7 @@ class LLFileUploadSound : public view_listener_t, public AIFileUpload // Inherited from AIFileUpload. /*virtual*/ void handle_event(std::string const& filename) { - LLFloaterNameDesc* floaterp = new LLFloaterNameDesc(filename); - LLUICtrlFactory::getInstance()->buildFloater(floaterp, "floater_sound_preview.xml"); - floaterp->childSetLabelArg("ok_btn", "[AMOUNT]", llformat("%d", LLGlobalEconomy::Singleton::getInstance()->getPriceUpload() )); + LLUICtrlFactory::getInstance()->buildFloater(new LLFloaterSoundPreview(LLSD(filename)), "floater_sound_preview.xml"); } }; @@ -349,20 +346,34 @@ class LLFileUploadAnim : public view_listener_t, public AIFileUpload // Inherited from AIFileUpload. /*virtual*/ void handle_event(std::string const& filename) { - int len = filename.size(); - if (len >= 5 && filename.substr(len - 5, 5) == ".anim") + if (filename.rfind(".anim") != std::string::npos) { - LLFloaterAnimPreview* floaterp = new LLFloaterAnimPreview(filename); - LLUICtrlFactory::getInstance()->buildFloater(floaterp, "floater_animation_anim_preview.xml"); - floaterp->childSetLabelArg("ok_btn", "[AMOUNT]", llformat("%s%d", gHippoGridManager->getConnectedGrid()->getCurrencySymbol().c_str(), LLGlobalEconomy::Singleton::getInstance()->getPriceUpload())); + LLUICtrlFactory::getInstance()->buildFloater(new LLFloaterAnimPreview(LLSD(filename)), "floater_animation_anim_preview.xml"); } else { - LLUICtrlFactory::getInstance()->buildFloater(new LLFloaterBvhPreview(filename), "floater_animation_bvh_preview.xml"); + LLUICtrlFactory::getInstance()->buildFloater(new LLFloaterBvhPreview(LLSD(filename)), "floater_animation_bvh_preview.xml"); } } }; +/* Singu TODO? LL made a class to upload scripts, but never actually hooked everything up, it'd be nice for us to offer such a thing. +class LLFileUploadScript : public view_listener_t, public AIFileUpload +{ + bool handleEvent(LLPointer event, const LLSD& userdata) + { + start_filepicker(FFLOAD_SCRIPT, "script"); + return true; + } + + protected: + // Inherited from AIFileUpload. + virtual void handle_event(std::string const& filename) + { + LLUICtrlFactory::getInstance()->buildFloater(new LLFloaterScriptPreview(LLSD(filename)), "floater_script_preview.xml"); + } +};*/ + class LLFileUploadBulk : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) @@ -386,13 +397,13 @@ class LLFileUploadBulk : public view_listener_t const char* notification_type = expected_upload_cost ? "BulkTemporaryUpload" : "BulkTemporaryUploadFree"; LLSD args; args["UPLOADCOST"] = gHippoGridManager->getConnectedGrid()->getUploadFee(); - LLNotifications::instance().add(notification_type, args, LLSD(), onConfirmBulkUploadTemp); + LLNotificationsUtil::add(notification_type, args, LLSD(), onConfirmBulkUploadTemp); return true; } static bool onConfirmBulkUploadTemp(const LLSD& notification, const LLSD& response ) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); bool enabled; if (option == 0) // yes enabled = true; @@ -446,7 +457,7 @@ class LLFileUploadBulk : public view_listener_t void upload_error(const std::string& error_message, const std::string& label, const std::string& filename, const LLSD& args) { llwarns << error_message << llendl; - LLNotifications::instance().add(label, args); + LLNotificationsUtil::add(label, args); if(LLFile::remove(filename) == -1) { lldebugs << "unable to remove temp file" << llendl; @@ -1361,6 +1372,7 @@ void init_menu_file() (new LLFileUploadImage())->registerListener(gMenuHolder, "File.UploadImage"); (new LLFileUploadSound())->registerListener(gMenuHolder, "File.UploadSound"); (new LLFileUploadAnim())->registerListener(gMenuHolder, "File.UploadAnim"); + //(new LLFileUploadScript())->registerListener(gMenuHolder, "File.UploadScript"); // Singu TODO? (new LLFileUploadModel())->registerListener(gMenuHolder, "File.UploadModel"); (new LLFileUploadBulk())->registerListener(gMenuHolder, "File.UploadBulk"); (new LLFileCloseWindow())->registerListener(gMenuHolder, "File.CloseWindow"); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 65882160b..5f74bb054 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -55,12 +55,10 @@ #include "llagentcamera.h" #include "llcallingcard.h" #include "llfirstuse.h" -#include "llfloaterbvhpreview.h" #include "llfloaterbump.h" #include "llfloaterbuycurrency.h" #include "llfloaterbuyland.h" #include "llfloaterchat.h" -#include "llfloaterimagepreview.h" #include "llfloaterland.h" #include "llfloaterregioninfo.h" #include "llfloaterlandholdings.h" @@ -6522,9 +6520,6 @@ void process_economy_data(LLMessageSystem *msg, void** /*user_data*/) LL_INFOS_ONCE("Messaging") << "EconomyData message arrived; upload cost is L$" << upload_cost << LL_ENDL; - LLFloaterImagePreview::setUploadAmount(upload_cost); - LLFloaterBvhPreview::setUploadAmount(upload_cost); - std::string fee = gHippoGridManager->getConnectedGrid()->getUploadFee(); gMenuHolder->childSetLabelArg("Upload Image", "[UPLOADFEE]", fee); gMenuHolder->childSetLabelArg("Upload Sound", "[UPLOADFEE]", fee); diff --git a/indra/newview/skins/default/xui/en-us/floater_animation_anim_preview.xml b/indra/newview/skins/default/xui/en-us/floater_animation_anim_preview.xml index 785a80334..ff1f59c89 100644 --- a/indra/newview/skins/default/xui/en-us/floater_animation_anim_preview.xml +++ b/indra/newview/skins/default/xui/en-us/floater_animation_anim_preview.xml @@ -58,7 +58,7 @@