diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2010-06-15 16:57:25 -0400 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2010-06-15 16:57:25 -0400 |
commit | 050199e031b9959de09669619ea0970ede118a98 (patch) | |
tree | 963b571c9d44b920c460fb646d2cd77f07b6182d | |
parent | 3ce5e0e99d20f1863be3529600aeec304753bfff (diff) | |
parent | 2b7188d6149ed01d3c078eed6da58155490c9f49 (diff) |
merge
-rw-r--r-- | indra/llcharacter/llkeyframewalkmotion.cpp | 268 | ||||
-rw-r--r-- | indra/llcharacter/llkeyframewalkmotion.h | 8 | ||||
-rw-r--r-- | indra/newview/llagentcamera.cpp | 16 | ||||
-rw-r--r-- | indra/newview/llagentcamera.h | 5 | ||||
-rw-r--r-- | indra/newview/llfolderview.cpp | 3 | ||||
-rw-r--r-- | indra/newview/llfolderview.h | 3 | ||||
-rw-r--r-- | indra/newview/llfolderviewitem.cpp | 7 | ||||
-rw-r--r-- | indra/newview/llinventorybridge.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llinventorypanel.cpp | 5 | ||||
-rw-r--r-- | indra/newview/llinventorypanel.h | 7 | ||||
-rw-r--r-- | indra/newview/lloutfitslist.cpp | 15 | ||||
-rw-r--r-- | indra/newview/lloutfitslist.h | 1 | ||||
-rw-r--r-- | indra/newview/llviewerfoldertype.cpp | 20 | ||||
-rw-r--r-- | indra/newview/llwearableitemslist.cpp | 24 | ||||
-rw-r--r-- | indra/newview/llwearableitemslist.h | 16 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_outfits_inventory.xml | 23 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_scrolling_param.xml | 4 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/widgets/flat_list_view.xml | 2 |
18 files changed, 181 insertions, 250 deletions
diff --git a/indra/llcharacter/llkeyframewalkmotion.cpp b/indra/llcharacter/llkeyframewalkmotion.cpp index f814618fc1..0587e5642c 100644 --- a/indra/llcharacter/llkeyframewalkmotion.cpp +++ b/indra/llcharacter/llkeyframewalkmotion.cpp @@ -44,32 +44,31 @@ //----------------------------------------------------------------------------- // Macros //----------------------------------------------------------------------------- -const F32 MAX_WALK_PLAYBACK_SPEED = 8.f; // max m/s for which we adjust walk cycle speed - -const F32 MIN_WALK_SPEED = 0.1f; // minimum speed at which we use velocity for down foot detection -const F32 MAX_TIME_DELTA = 2.f; //max two seconds a frame for calculating interpolation -F32 SPEED_ADJUST_MAX = 2.5f; // maximum adjustment of walk animation playback speed -F32 SPEED_ADJUST_MAX_SEC = 3.f; // maximum adjustment to walk animation playback speed for a second -F32 ANIM_SPEED_MAX = 10.0f; // absolute upper limit on animation speed -F32 ANIM_SPEED_MIN = 0.0f; // absolute lower limit on animation speed -const F32 DRIFT_COMP_MAX_TOTAL = 0.07f;//0.55f; // maximum drift compensation overall, in any direction -const F32 DRIFT_COMP_MAX_SPEED = 4.f; // speed at which drift compensation total maxes out +const F32 MAX_WALK_PLAYBACK_SPEED = 8.f; // max m/s for which we adjust walk cycle speed + +const F32 MIN_WALK_SPEED = 0.1f; // minimum speed at which we use velocity for down foot detection +const F32 TIME_EPSILON = 0.001f; // minumum frame time +const F32 MAX_TIME_DELTA = 2.f; // max two seconds a frame for calculating interpolation +F32 SPEED_ADJUST_MAX_SEC = 2.f; // maximum adjustment to walk animation playback speed for a second +F32 ANIM_SPEED_MAX = 1.5f; // absolute upper limit on animation speed +const F32 DRIFT_COMP_MAX_TOTAL = 0.1f; // maximum drift compensation overall, in any direction +const F32 DRIFT_COMP_MAX_SPEED = 4.f; // speed at which drift compensation total maxes out const F32 MAX_ROLL = 0.6f; +const F32 PELVIS_COMPENSATION_WIEGHT = 0.7f; // proportion of foot drift that is compensated by moving the avatar directly +const F32 SPEED_ADJUST_TIME_CONSTANT = 0.1f; // time constant for speed adjustment interpolation //----------------------------------------------------------------------------- // LLKeyframeWalkMotion() // Class Constructor //----------------------------------------------------------------------------- LLKeyframeWalkMotion::LLKeyframeWalkMotion(const LLUUID &id) - : LLKeyframeMotion(id), - +: LLKeyframeMotion(id), mCharacter(NULL), mCyclePhase(0.0f), mRealTimeLast(0.0f), mAdjTimeLast(0.0f), mDownFoot(0) -{ -} +{} //----------------------------------------------------------------------------- @@ -77,8 +76,7 @@ LLKeyframeWalkMotion::LLKeyframeWalkMotion(const LLUUID &id) // Class Destructor //----------------------------------------------------------------------------- LLKeyframeWalkMotion::~LLKeyframeWalkMotion() -{ -} +{} //----------------------------------------------------------------------------- @@ -149,15 +147,12 @@ BOOL LLKeyframeWalkMotion::onUpdate(F32 time, U8* joint_mask) LLWalkAdjustMotion::LLWalkAdjustMotion(const LLUUID &id) : LLMotion(id), mLastTime(0.f), - mAvgCorrection(0.f), - mSpeedAdjust(0.f), mAnimSpeed(0.f), - mAvgSpeed(0.f), + mAdjustedSpeed(0.f), mRelativeDir(0.f), mAnkleOffset(0.f) { mName = "walk_adjust"; - mPelvisState = new LLJointState; } @@ -189,15 +184,16 @@ LLMotion::LLMotionInitStatus LLWalkAdjustMotion::onInitialize(LLCharacter *chara //----------------------------------------------------------------------------- BOOL LLWalkAdjustMotion::onActivate() { - mAvgCorrection = 0.f; - mSpeedAdjust = 0.f; mAnimSpeed = 0.f; - mAvgSpeed = 0.f; + mAdjustedSpeed = 0.f; mRelativeDir = 1.f; mPelvisState->setPosition(LLVector3::zero); // store ankle positions for next frame - mLastLeftAnklePos = mCharacter->getPosGlobalFromAgent(mLeftAnkleJoint->getWorldPosition()); - mLastRightAnklePos = mCharacter->getPosGlobalFromAgent(mRightAnkleJoint->getWorldPosition()); + mLastLeftFootGlobalPos = mCharacter->getPosGlobalFromAgent(mLeftAnkleJoint->getWorldPosition()); + mLastLeftFootGlobalPos.mdV[VZ] = 0.0; + + mLastRightFootGlobalPos = mCharacter->getPosGlobalFromAgent(mRightAnkleJoint->getWorldPosition()); + mLastRightFootGlobalPos.mdV[VZ] = 0.0; F32 leftAnkleOffset = (mLeftAnkleJoint->getWorldPosition() - mCharacter->getCharacterPosition()).magVec(); F32 rightAnkleOffset = (mRightAnkleJoint->getWorldPosition() - mCharacter->getCharacterPosition()).magVec(); @@ -211,164 +207,120 @@ BOOL LLWalkAdjustMotion::onActivate() //----------------------------------------------------------------------------- BOOL LLWalkAdjustMotion::onUpdate(F32 time, U8* joint_mask) { - LLVector3 footCorrection; - LLVector3 vel = mCharacter->getCharacterVelocity() * mCharacter->getTimeDilation(); - F32 deltaTime = llclamp(time - mLastTime, 0.f, MAX_TIME_DELTA); + // delta_time is guaranteed to be non zero + F32 delta_time = llclamp(time - mLastTime, TIME_EPSILON, MAX_TIME_DELTA); mLastTime = time; - LLQuaternion inv_rotation = ~mPelvisJoint->getWorldRotation(); + // find the avatar motion vector in the XY plane + LLVector3 avatar_velocity = mCharacter->getCharacterVelocity() * mCharacter->getTimeDilation(); + avatar_velocity.mV[VZ] = 0.f; - // get speed and normalize velocity vector - LLVector3 ang_vel = mCharacter->getCharacterAngularVelocity() * mCharacter->getTimeDilation(); - F32 speed = llmin(vel.normVec(), MAX_WALK_PLAYBACK_SPEED); - mAvgSpeed = lerp(mAvgSpeed, speed, LLCriticalDamp::getInterpolant(0.2f)); + F32 speed = llclamp(avatar_velocity.magVec(), 0.f, MAX_WALK_PLAYBACK_SPEED); - // calculate facing vector in pelvis-local space - // (either straight forward or back, depending on velocity) - LLVector3 localVel = vel * inv_rotation; - if (localVel.mV[VX] > 0.f) - { - mRelativeDir = 1.f; - } - else if (localVel.mV[VX] < 0.f) - { - mRelativeDir = -1.f; - } + // grab avatar->world transforms + LLQuaternion avatar_to_world_rot = mCharacter->getRootJoint()->getWorldRotation(); - // calculate world-space foot drift - LLVector3 leftFootDelta; - LLVector3 leftFootWorldPosition = mLeftAnkleJoint->getWorldPosition(); - LLVector3d leftFootGlobalPosition = mCharacter->getPosGlobalFromAgent(leftFootWorldPosition); - leftFootDelta.setVec(mLastLeftAnklePos - leftFootGlobalPosition); - mLastLeftAnklePos = leftFootGlobalPosition; + LLQuaternion world_to_avatar_rot(avatar_to_world_rot); + world_to_avatar_rot.conjugate(); - LLVector3 rightFootDelta; - LLVector3 rightFootWorldPosition = mRightAnkleJoint->getWorldPosition(); - LLVector3d rightFootGlobalPosition = mCharacter->getPosGlobalFromAgent(rightFootWorldPosition); - rightFootDelta.setVec(mLastRightAnklePos - rightFootGlobalPosition); - mLastRightAnklePos = rightFootGlobalPosition; + LLVector3 foot_slip_vector; // find foot drift along velocity vector - if (mAvgSpeed > 0.1) - { - // walking/running - F32 leftFootDriftAmt = leftFootDelta * vel; - F32 rightFootDriftAmt = rightFootDelta * vel; - - if (rightFootDriftAmt > leftFootDriftAmt) - { - footCorrection = rightFootDelta; - } else - { - footCorrection = leftFootDelta; - } - } - else - { - mAvgSpeed = ang_vel.magVec() * mAnkleOffset; - mRelativeDir = 1.f; - - // standing/turning - // find the lower foot - if (leftFootWorldPosition.mV[VZ] < rightFootWorldPosition.mV[VZ]) - { - // pivot on left foot - footCorrection = leftFootDelta; - } + if (speed > MIN_WALK_SPEED) + { // walking/running + + // calculate world-space foot drift + // use global coordinates to seamlessly handle region crossings + LLVector3d leftFootGlobalPosition = mCharacter->getPosGlobalFromAgent(mLeftAnkleJoint->getWorldPosition()); + leftFootGlobalPosition.mdV[VZ] = 0.0; + LLVector3 leftFootDelta(leftFootGlobalPosition - mLastLeftFootGlobalPos); + mLastLeftFootGlobalPos = leftFootGlobalPosition; + + LLVector3d rightFootGlobalPosition = mCharacter->getPosGlobalFromAgent(mRightAnkleJoint->getWorldPosition()); + rightFootGlobalPosition.mdV[VZ] = 0.0; + LLVector3 rightFootDelta(rightFootGlobalPosition - mLastRightFootGlobalPos); + mLastRightFootGlobalPos = rightFootGlobalPosition; + + // get foot drift along avatar direction of motion + F32 left_foot_slip_amt = leftFootDelta * avatar_velocity; + F32 right_foot_slip_amt = rightFootDelta * avatar_velocity; + + // if right foot is pushing back faster than left foot... + if (right_foot_slip_amt < left_foot_slip_amt) + { //...use it to calculate optimal animation speed + foot_slip_vector = rightFootDelta; + } else - { - // pivot on right foot - footCorrection = rightFootDelta; + { // otherwise use the left foot + foot_slip_vector = leftFootDelta; } - } - // rotate into avatar coordinates - footCorrection = footCorrection * inv_rotation; + // calculate ideal pelvis offset so that foot is glued to ground and damp towards it + // this will soak up transient slippage + // + // FIXME: this interacts poorly with speed adjustment + // mPelvisOffset compensates for foot drift by moving the avatar pelvis in the opposite + // direction of the drift, up to a certain limited distance + // but this will cause the animation playback rate calculation below to + // kick in too slowly and sometimes start playing the animation in reverse. - // calculate ideal pelvis offset so that foot is glued to ground and damp towards it - // the amount of foot slippage this frame + the offset applied last frame - mPelvisOffset = mPelvisState->getPosition() + lerp(LLVector3::zero, footCorrection, LLCriticalDamp::getInterpolant(0.2f)); + //mPelvisOffset -= PELVIS_COMPENSATION_WIEGHT * (foot_slip_vector * world_to_avatar_rot);//lerp(LLVector3::zero, -1.f * (foot_slip_vector * world_to_avatar_rot), LLCriticalDamp::getInterpolant(0.1f)); - // pelvis drift (along walk direction) - mAvgCorrection = lerp(mAvgCorrection, footCorrection.mV[VX] * mRelativeDir, LLCriticalDamp::getInterpolant(0.1f)); + ////F32 drift_comp_max = DRIFT_COMP_MAX_TOTAL * (llclamp(speed, 0.f, DRIFT_COMP_MAX_SPEED) / DRIFT_COMP_MAX_SPEED); + //F32 drift_comp_max = DRIFT_COMP_MAX_TOTAL; - // calculate average velocity of foot slippage - F32 footSlipVelocity = (deltaTime != 0.f) ? (-mAvgCorrection / deltaTime) : 0.f; + //// clamp pelvis offset to a 90 degree arc behind the nominal position + //// NB: this is an ADDITIVE amount that is accumulated every frame, so clamping it alone won't do the trick + //// must clamp with absolute position of pelvis in mind + //LLVector3 currentPelvisPos = mPelvisState->getJoint()->getPosition(); + //mPelvisOffset.mV[VX] = llclamp( mPelvisOffset.mV[VX], -drift_comp_max, drift_comp_max ); + //mPelvisOffset.mV[VY] = llclamp( mPelvisOffset.mV[VY], -drift_comp_max, drift_comp_max ); + //mPelvisOffset.mV[VZ] = 0.f; + // + //mLastRightFootGlobalPos += LLVector3d(mPelvisOffset * avatar_to_world_rot); + //mLastLeftFootGlobalPos += LLVector3d(mPelvisOffset * avatar_to_world_rot); - F32 newSpeedAdjust = 0.f; - - // modulate speed by dot products of facing and velocity - // so that if we are moving sideways, we slow down the animation - // and if we're moving backward, we walk backward + //foot_slip_vector -= mPelvisOffset; - F32 directional_factor = localVel.mV[VX] * mRelativeDir; + LLVector3 avatar_movement_dir = avatar_velocity; + avatar_movement_dir.normalize(); - if (speed > 0.1f) - { - // calculate ratio of desired foot velocity to detected foot velocity - newSpeedAdjust = llclamp(footSlipVelocity - mAvgSpeed * (1.f - directional_factor), - -SPEED_ADJUST_MAX, SPEED_ADJUST_MAX); - newSpeedAdjust = lerp(mSpeedAdjust, newSpeedAdjust, LLCriticalDamp::getInterpolant(0.2f)); + // planted foot speed is avatar velocity - foot slip amount along avatar movement direction + F32 foot_speed = speed - ((foot_slip_vector * avatar_movement_dir) / delta_time); - F32 speedDelta = newSpeedAdjust - mSpeedAdjust; - speedDelta = llclamp(speedDelta, -SPEED_ADJUST_MAX_SEC * deltaTime, SPEED_ADJUST_MAX_SEC * deltaTime); + // multiply animation playback rate so that foot speed matches avatar speed + F32 desired_speed_multiplier = llclamp(speed / foot_speed, 0.f, ANIM_SPEED_MAX); - mSpeedAdjust = mSpeedAdjust + speedDelta; - } - else - { - mSpeedAdjust = lerp(mSpeedAdjust, 0.f, LLCriticalDamp::getInterpolant(0.2f)); - } + // blend towards new speed adjustment value + F32 new_speed_adjust = lerp(mAdjustedSpeed, desired_speed_multiplier, LLCriticalDamp::getInterpolant(SPEED_ADJUST_TIME_CONSTANT)); - mAnimSpeed = (mAvgSpeed + mSpeedAdjust) * mRelativeDir; - if (mAnimSpeed>0) - { - mAnimSpeed = llclamp(mAnimSpeed, ANIM_SPEED_MIN, ANIM_SPEED_MAX); + // limit that rate at which the speed adjustment changes + F32 speedDelta = llclamp(new_speed_adjust - mAdjustedSpeed, -SPEED_ADJUST_MAX_SEC * delta_time, SPEED_ADJUST_MAX_SEC * delta_time); + mAdjustedSpeed += speedDelta; + + // modulate speed by dot products of facing and velocity + // so that if we are moving sideways, we slow down the animation + // and if we're moving backward, we walk backward + // do this at the end to be more responsive to direction changes instead of in the above speed calculations + F32 directional_factor = (avatar_movement_dir * world_to_avatar_rot).mV[VX]; + + mAnimSpeed = mAdjustedSpeed * directional_factor; } else - { - mAnimSpeed = llclamp(mAnimSpeed, -ANIM_SPEED_MAX, -ANIM_SPEED_MIN); - } -// char debug_text[64]; -// sprintf(debug_text, "Foot slip vel: %.2f", footSlipVelocity); -// mCharacter->addDebugText(debug_text); -// sprintf(debug_text, "Speed: %.2f", mAvgSpeed); -// mCharacter->addDebugText(debug_text); -// sprintf(debug_text, "Speed Adjust: %.2f", mSpeedAdjust); -// mCharacter->addDebugText(debug_text); -// sprintf(debug_text, "Animation Playback Speed: %.2f", mAnimSpeed); -// mCharacter->addDebugText(debug_text); - mCharacter->setAnimationData("Walk Speed", &mAnimSpeed); - if (mCharacter->getMotionController().mIsSelf) - { -// F32 elapsed = mCharacter->getMotionController().getFrameTimer().getElapsedTimeF32(); -// llinfos << "PLOT elapsed: " << elapsed -// << " footSlipVelocity: " << footSlipVelocity -// << " mAvgCorrection: " << mAvgCorrection -// << " mAvgSpeed: " << mAvgSpeed -// << " mAnimSpeed: " << mAnimSpeed -// << " ANIM_SPEED_MAX: " << ANIM_SPEED_MAX -// << " ANIM_SPEED_MIN: " << ANIM_SPEED_MIN -// << llendl; - } - - // clamp pelvis offset to a 90 degree arc behind the nominal position - F32 drift_comp_max = llclamp(speed, 0.f, DRIFT_COMP_MAX_SPEED) / DRIFT_COMP_MAX_SPEED; - drift_comp_max *= DRIFT_COMP_MAX_TOTAL; + { // standing/turning - LLVector3 currentPelvisPos = mPelvisState->getJoint()->getPosition(); + // damp out speed adjustment to 0 + mAnimSpeed = lerp(mAnimSpeed, 1.f, LLCriticalDamp::getInterpolant(0.2f)); + //mPelvisOffset = lerp(mPelvisOffset, LLVector3::zero, LLCriticalDamp::getInterpolant(0.2f)); + } - // NB: this is an ADDITIVE amount that is accumulated every frame, so clamping it alone won't do the trick - // must clamp with absolute position of pelvis in mind - mPelvisOffset.mV[VX] = llclamp( mPelvisOffset.mV[VX], -drift_comp_max - currentPelvisPos.mV[VX], drift_comp_max - currentPelvisPos.mV[VX] ); - mPelvisOffset.mV[VY] = llclamp( mPelvisOffset.mV[VY], -drift_comp_max - currentPelvisPos.mV[VY], drift_comp_max - currentPelvisPos.mV[VY]); - mPelvisOffset.mV[VZ] = 0.f; + // broadcast walk speed change + mCharacter->setAnimationData("Walk Speed", &mAnimSpeed); // set position + // need to update *some* joint to keep this animation active mPelvisState->setPosition(mPelvisOffset); - mCharacter->setAnimationData("Pelvis Offset", &mPelvisOffset); - return TRUE; } @@ -438,14 +390,8 @@ BOOL LLFlyAdjustMotion::onUpdate(F32 time, U8* joint_mask) // roll is critically damped interpolation between current roll and angular velocity-derived target roll mRoll = lerp(mRoll, target_roll, LLCriticalDamp::getInterpolant(0.1f)); -// llinfos << mRoll << llendl; - LLQuaternion roll(mRoll, LLVector3(0.f, 0.f, 1.f)); mPelvisState->setRotation(roll); -// F32 lerp_amt = LLCriticalDamp::getInterpolant(0.2f); -// -// LLVector3 pelvis_correction = mPelvisState->getPosition() - lerp(LLVector3::zero, mPelvisState->getJoint()->getPosition() + mPelvisState->getPosition(), lerp_amt); -// mPelvisState->setPosition(pelvis_correction); return TRUE; } diff --git a/indra/llcharacter/llkeyframewalkmotion.h b/indra/llcharacter/llkeyframewalkmotion.h index 90dd4dbcac..b507e9423a 100644 --- a/indra/llcharacter/llkeyframewalkmotion.h +++ b/indra/llcharacter/llkeyframewalkmotion.h @@ -126,13 +126,11 @@ public: LLJoint* mRightAnkleJoint; LLPointer<LLJointState> mPelvisState; LLJoint* mPelvisJoint; - LLVector3d mLastLeftAnklePos; - LLVector3d mLastRightAnklePos; + LLVector3d mLastLeftFootGlobalPos; + LLVector3d mLastRightFootGlobalPos; F32 mLastTime; - F32 mAvgCorrection; - F32 mSpeedAdjust; + F32 mAdjustedSpeed; F32 mAnimSpeed; - F32 mAvgSpeed; F32 mRelativeDir; LLVector3 mPelvisOffset; F32 mAnkleOffset; diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index 977f1c9fa8..3fc5e88633 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -207,13 +207,13 @@ void LLAgentCamera::init() mCameraPreset = (ECameraPreset) gSavedSettings.getU32("CameraPreset"); - mCameraOffsetInitial[CAMERA_PRESET_REAR_VIEW] = gSavedSettings.getVector3("CameraOffsetRearView"); - mCameraOffsetInitial[CAMERA_PRESET_FRONT_VIEW] = gSavedSettings.getVector3("CameraOffsetFrontView"); - mCameraOffsetInitial[CAMERA_PRESET_GROUP_VIEW] = gSavedSettings.getVector3("CameraOffsetGroupView"); + mCameraOffsetInitial[CAMERA_PRESET_REAR_VIEW] = gSavedSettings.getControl("CameraOffsetRearView"); + mCameraOffsetInitial[CAMERA_PRESET_FRONT_VIEW] = gSavedSettings.getControl("CameraOffsetFrontView"); + mCameraOffsetInitial[CAMERA_PRESET_GROUP_VIEW] = gSavedSettings.getControl("CameraOffsetGroupView"); - mFocusOffsetInitial[CAMERA_PRESET_REAR_VIEW] = gSavedSettings.getVector3d("FocusOffsetRearView"); - mFocusOffsetInitial[CAMERA_PRESET_FRONT_VIEW] = gSavedSettings.getVector3d("FocusOffsetFrontView"); - mFocusOffsetInitial[CAMERA_PRESET_GROUP_VIEW] = gSavedSettings.getVector3d("FocusOffsetGroupView"); + mFocusOffsetInitial[CAMERA_PRESET_REAR_VIEW] = gSavedSettings.getControl("FocusOffsetRearView"); + mFocusOffsetInitial[CAMERA_PRESET_FRONT_VIEW] = gSavedSettings.getControl("FocusOffsetFrontView"); + mFocusOffsetInitial[CAMERA_PRESET_GROUP_VIEW] = gSavedSettings.getControl("FocusOffsetGroupView"); mCameraCollidePlane.clearVec(); mCurrentCameraDistance = getCameraOffsetInitial().magVec() * gSavedSettings.getF32("CameraOffsetScale"); @@ -1643,7 +1643,7 @@ LLVector3d LLAgentCamera::calcThirdPersonFocusOffset() agent_rot *= ((LLViewerObject*)(gAgentAvatarp->getParent()))->getRenderRotation(); } - focus_offset = mFocusOffsetInitial[mCameraPreset] * agent_rot; + focus_offset = convert_from_llsd<LLVector3d>(mFocusOffsetInitial[mCameraPreset]->get(), TYPE_VEC3D, ""); return focus_offset; } @@ -1978,7 +1978,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) LLVector3 LLAgentCamera::getCameraOffsetInitial() { - return mCameraOffsetInitial[mCameraPreset]; + return convert_from_llsd<LLVector3>(mCameraOffsetInitial[mCameraPreset]->get(), TYPE_VEC3, ""); } diff --git a/indra/newview/llagentcamera.h b/indra/newview/llagentcamera.h index 5cbb1de6f4..7afb5c0ed9 100644 --- a/indra/newview/llagentcamera.h +++ b/indra/newview/llagentcamera.h @@ -39,6 +39,7 @@ class LLPickInfo; class LLVOAvatarSelf; +class LLControlVariable; //-------------------------------------------------------------------- // Types @@ -121,10 +122,10 @@ private: ECameraPreset mCameraPreset; /** Initial camera offsets */ - std::map<ECameraPreset, LLVector3> mCameraOffsetInitial; + std::map<ECameraPreset, LLPointer<LLControlVariable> > mCameraOffsetInitial; /** Initial focus offsets */ - std::map<ECameraPreset, LLVector3d> mFocusOffsetInitial; + std::map<ECameraPreset, LLPointer<LLControlVariable> > mFocusOffsetInitial; //-------------------------------------------------------------------- // Position diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 74034cfbf7..f241d18a21 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -185,6 +185,7 @@ LLFolderView::LLFolderView(const Params& p) mRenameItem( NULL ), mNeedsScroll( FALSE ), mEnableScroll( true ), + mUseLabelSuffix(p.use_label_suffix), mPinningSelectedItem(FALSE), mNeedsAutoSelect( FALSE ), mAutoSelectOverride(FALSE), @@ -961,7 +962,7 @@ void LLFolderView::draw() } mStatusTextBox->setValue(mStatusText); mStatusTextBox->setVisible( TRUE ); - + // firstly reshape message textbox with current size. This is necessary to // LLTextBox::getTextPixelHeight works properly const LLRect local_rect = getLocalRect(); diff --git a/indra/newview/llfolderview.h b/indra/newview/llfolderview.h index 0dfdbd364b..55eb543f5f 100644 --- a/indra/newview/llfolderview.h +++ b/indra/newview/llfolderview.h @@ -96,6 +96,7 @@ public: Mandatory<LLPanel*> parent_panel; Optional<LLUUID> task_id; Optional<std::string> title; + Optional<bool> use_label_suffix; }; LLFolderView(const Params&); virtual ~LLFolderView( void ); @@ -273,6 +274,7 @@ public: virtual S32 notify(const LLSD& info) ; void setEnableScroll(bool enable_scroll) { mEnableScroll = enable_scroll; } + bool useLabelSuffix() { return mUseLabelSuffix; } private: void updateRenamerPosition(); @@ -309,6 +311,7 @@ protected: BOOL mNeedsAutoSelect; BOOL mAutoSelectOverride; BOOL mNeedsAutoRename; + bool mUseLabelSuffix; BOOL mDebugFilters; U32 mSortOrder; diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 0c437cf035..50b35bfc69 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -289,8 +289,11 @@ void LLFolderViewItem::refreshFromListener() mCreationDate = mListener->getCreationDate(); dirtyFilter(); } - mLabelStyle = mListener->getLabelStyle(); - mLabelSuffix = mListener->getLabelSuffix(); + if (mRoot->useLabelSuffix()) + { + mLabelStyle = mListener->getLabelStyle(); + mLabelSuffix = mListener->getLabelSuffix(); + } } } diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 7ce96a6ac1..413f329ce9 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2581,9 +2581,9 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) mItems.push_back(std::string("New Clothes")); mItems.push_back(std::string("New Body Parts")); - // Changing folder types is just a debug feature; this is fairly unsupported +#if SUPPORT_ENSEMBLES + // Changing folder types is an unfinished unsupported feature // and can lead to unexpected behavior if enabled. -#if !LL_RELEASE_FOR_DOWNLOAD mItems.push_back(std::string("Change Type")); const LLViewerInventoryCategory *cat = getCategory(); if (cat && LLFolderType::lookupIsProtectedType(cat->getPreferredType())) diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 83c57d5bb2..5e88140848 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -110,7 +110,7 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) : } } -BOOL LLInventoryPanel::postBuild() +void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) { LLMemType mt(LLMemType::MTYPE_INVENTORY_POST_BUILD); @@ -128,6 +128,7 @@ BOOL LLInventoryPanel::postBuild() p.rect = folder_rect; p.parent_panel = this; p.tool_tip = p.name; + p.use_label_suffix = params.use_label_suffix; mFolderRoot = LLUICtrlFactory::create<LLFolderView>(p); mFolderRoot->setAllowMultiSelect(mAllowMultiSelect); } @@ -174,8 +175,6 @@ BOOL LLInventoryPanel::postBuild() setSortOrder(gSavedSettings.getU32(DEFAULT_SORT_ORDER)); } mFolderRoot->setSortOrder(getFilter()->getSortOrder()); - - return TRUE; } LLInventoryPanel::~LLInventoryPanel() diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 52e9ef799e..84603e8b4f 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -87,6 +87,7 @@ public: Optional<bool> show_item_link_overlays; Optional<Filter> filter; Optional<std::string> start_folder; + Optional<bool> use_label_suffix; Params() : sort_order_setting("sort_order_setting"), @@ -94,7 +95,8 @@ public: allow_multi_select("allow_multi_select", true), show_item_link_overlays("show_item_link_overlays", false), filter("filter"), - start_folder("start_folder") + start_folder("start_folder"), + use_label_suffix("use_label_suffix", true) {} }; @@ -103,6 +105,7 @@ public: //-------------------------------------------------------------------- protected: LLInventoryPanel(const Params&); + void initFromParams(const Params&); friend class LLUICtrlFactory; public: virtual ~LLInventoryPanel(); @@ -110,8 +113,6 @@ public: public: LLInventoryModel* getModel() { return mInventory; } - BOOL postBuild(); - // LLView methods void draw(); BOOL handleHover(S32 x, S32 y, MASK mask); diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index 03df2d2b20..de074d6aaf 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -278,9 +278,6 @@ void LLOutfitsList::refreshList(const LLUUID& category_id) tab->setRightMouseDownCallback(boost::bind(&LLOutfitsList::onAccordionTabRightClick, this, _1, _2, _3, cat_id)); - tab->setDoubleClickCallback(boost::bind(&LLOutfitsList::onAccordionTabDoubleClick, this, - _1, _2, _3, cat_id)); - // Setting tab focus callback to monitor currently selected outfit. tab->setFocusReceivedCallback(boost::bind(&LLOutfitsList::changeOutfitSelection, this, list, cat_id)); @@ -632,18 +629,6 @@ void LLOutfitsList::onAccordionTabRightClick(LLUICtrl* ctrl, S32 x, S32 y, const } } -void LLOutfitsList::onAccordionTabDoubleClick(LLUICtrl* ctrl, S32 x, S32 y, const LLUUID& cat_id) -{ - LLAccordionCtrlTab* tab = dynamic_cast<LLAccordionCtrlTab*>(ctrl); - if(is_tab_header_clicked(tab, y) && cat_id.notNull()) - { - LLViewerInventoryCategory* cat = gInventory.getCategory(cat_id); - if (!cat) return; - - LLAppearanceMgr::instance().wearInventoryCategory( cat, FALSE, FALSE ); - } -} - void LLOutfitsList::onWearableItemsListRightClick(LLUICtrl* ctrl, S32 x, S32 y) { LLWearableItemsList* list = dynamic_cast<LLWearableItemsList*>(ctrl); diff --git a/indra/newview/lloutfitslist.h b/indra/newview/lloutfitslist.h index 478eaa50b3..5605044f41 100644 --- a/indra/newview/lloutfitslist.h +++ b/indra/newview/lloutfitslist.h @@ -131,7 +131,6 @@ private: void applyFilter(const std::string& new_filter_substring); void onAccordionTabRightClick(LLUICtrl* ctrl, S32 x, S32 y, const LLUUID& cat_id); - void onAccordionTabDoubleClick(LLUICtrl* ctrl, S32 x, S32 y, const LLUUID& cat_id); void onWearableItemsListRightClick(LLUICtrl* ctrl, S32 x, S32 y); void onCOFChanged(); diff --git a/indra/newview/llviewerfoldertype.cpp b/indra/newview/llviewerfoldertype.cpp index 56b5d7467c..3105a6ec43 100644 --- a/indra/newview/llviewerfoldertype.cpp +++ b/indra/newview/llviewerfoldertype.cpp @@ -110,8 +110,6 @@ protected: LLViewerFolderDictionary::LLViewerFolderDictionary() { - initEnsemblesFromFile(); - // NEW CATEGORY NAME FOLDER OPEN FOLDER CLOSED QUIET? // |-------------------------|-----------------------|----------------------|-----------| addEntry(LLFolderType::FT_TEXTURE, new ViewerFolderEntry("Textures", "Inv_SysOpen", "Inv_SysClosed", FALSE)); @@ -137,6 +135,15 @@ LLViewerFolderDictionary::LLViewerFolderDictionary() addEntry(LLFolderType::FT_INBOX, new ViewerFolderEntry("Inbox", "Inv_SysOpen", "Inv_SysClosed", FALSE)); addEntry(LLFolderType::FT_NONE, new ViewerFolderEntry("New Folder", "Inv_FolderOpen", "Inv_FolderClosed", FALSE, "default")); + +#if SUPPORT_ENSEMBLES + initEnsemblesFromFile(); +#else + for (U32 type = (U32)LLFolderType::FT_ENSEMBLE_START; type <= (U32)LLFolderType::FT_ENSEMBLE_END; ++type) + { + addEntry((LLFolderType::EType)type, new ViewerFolderEntry("New Folder", "Inv_FolderOpen", "Inv_FolderClosed", FALSE)); + } +#endif } bool LLViewerFolderDictionary::initEnsemblesFromFile() @@ -231,6 +238,15 @@ const std::string &LLViewerFolderType::lookupIconName(LLFolderType::EType folder else return entry->mIconNameClosed; } + + // Error condition. Return something so that we don't show a grey box in inventory view. + const ViewerFolderEntry *default_entry = LLViewerFolderDictionary::getInstance()->lookup(LLFolderType::FT_NONE); + if (default_entry) + { + return default_entry->mIconNameClosed; + } + + // Should not get here unless there's something corrupted with the FT_NONE entry. return badLookup(); } diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp index f86838194e..5e9c4dcec8 100644 --- a/indra/newview/llwearableitemslist.cpp +++ b/indra/newview/llwearableitemslist.cpp @@ -106,24 +106,9 @@ LLPanelWearableOutfitItem* LLPanelWearableOutfitItem::create(LLViewerInventoryIt return list_item; } -BOOL LLPanelWearableOutfitItem::handleDoubleClick(S32 x, S32 y, MASK mask) +LLPanelWearableOutfitItem::LLPanelWearableOutfitItem(LLViewerInventoryItem* item) +: LLPanelInventoryListItemBase(item) { - LLViewerInventoryItem* item = getItem(); - if (item) - { - LLUUID id = item->getUUID(); - - if (get_is_item_worn(id)) - { - LLAppearanceMgr::getInstance()->removeItemFromAvatar(id); - } - else - { - LLAppearanceMgr::getInstance()->wearItemOnAvatar(id, true, false); - } - } - - return LLUICtrl::handleDoubleClick(x, y, mask); } // virtual @@ -139,11 +124,6 @@ void LLPanelWearableOutfitItem::updateItem(const std::string& name) LLPanelInventoryListItemBase::updateItem(search_label); } -LLPanelWearableOutfitItem::LLPanelWearableOutfitItem(LLViewerInventoryItem* item) -: LLPanelInventoryListItemBase(item) -{ -} - ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llwearableitemslist.h b/indra/newview/llwearableitemslist.h index 2f95c733aa..fe859075c4 100644 --- a/indra/newview/llwearableitemslist.h +++ b/indra/newview/llwearableitemslist.h @@ -56,13 +56,13 @@ class LLPanelWearableListItem : public LLPanelInventoryListItemBase public: /** - * Shows buttons when mouse is over - */ + * Shows buttons when mouse is over + */ /*virtual*/ void onMouseEnter(S32 x, S32 y, MASK mask); /** - * Hides buttons when mouse is out - */ + * Hides buttons when mouse is out + */ /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask); protected: @@ -84,18 +84,12 @@ public: static LLPanelWearableOutfitItem* create(LLViewerInventoryItem* item); /** - * Puts item on if it is not worn by agent - * otherwise takes it off on double click. - */ - /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask); - - /** * Updates item name and (worn) suffix. */ /*virtual*/ void updateItem(const std::string& name); -protected: +protected: LLPanelWearableOutfitItem(LLViewerInventoryItem* item); }; diff --git a/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml b/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml index 37eb5eaa98..c1e5ae50e6 100644 --- a/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml +++ b/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml @@ -48,6 +48,7 @@ mouse_opaque="true" name="cof_tab" start_folder="Current Outfit" + use_label_suffix="false" width="315" /> </tab_container> <panel @@ -83,18 +84,18 @@ width="241" /> - <dnd_button - follows="bottom|right" - height="25" - image_hover_unselected="Toolbar_Right_Over" - image_overlay="TrashItem_Off" - image_selected="Toolbar_Right_Selected" - image_unselected="Toolbar_Right_Off" - layout="topleft" - left_pad="1" - name="trash_btn" + <dnd_button + follows="bottom|right" + height="25" + image_hover_unselected="Toolbar_Right_Over" + image_overlay="TrashItem_Off" + image_selected="Toolbar_Right_Selected" + image_unselected="Toolbar_Right_Off" + layout="topleft" + left_pad="1" + name="trash_btn" tool_tip="Delete selected outfit" - width="31"/> + width="31"/> <button follows="bottom|left" height="23" diff --git a/indra/newview/skins/default/xui/en/panel_scrolling_param.xml b/indra/newview/skins/default/xui/en/panel_scrolling_param.xml index 19eb4bb0d6..78d64620a5 100644 --- a/indra/newview/skins/default/xui/en/panel_scrolling_param.xml +++ b/indra/newview/skins/default/xui/en/panel_scrolling_param.xml @@ -12,6 +12,8 @@ layout="topleft" left="12" name="min param text" + text_color="EmphasisColor" + font_shadow="hard" top="120" width="120" /> <text @@ -20,6 +22,8 @@ layout="topleft" left="155" name="max param text" + text_color="EmphasisColor" + font_shadow="hard" top_delta="0" width="120" /> <text diff --git a/indra/newview/skins/default/xui/en/widgets/flat_list_view.xml b/indra/newview/skins/default/xui/en/widgets/flat_list_view.xml index a71b293f31..e05ddf9815 100644 --- a/indra/newview/skins/default/xui/en/widgets/flat_list_view.xml +++ b/indra/newview/skins/default/xui/en/widgets/flat_list_view.xml @@ -11,6 +11,6 @@ name="no_items_msg" v_pad="10" h_pad="10" - value="There are no any items in the list" + value="No matches found" wrap="true" /> </flat_list_view>
\ No newline at end of file |