From f304eea6a9964ee4fe6ebbb54047abb33dc6fd0e Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 28 Feb 2014 12:21:29 -0800 Subject: MAINT-2059 FIX Corner scaling doesn't highlight distance text fixed case where trying to shrink the object below zero size would mess up grid rulers --- indra/newview/llmanipscale.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'indra') diff --git a/indra/newview/llmanipscale.cpp b/indra/newview/llmanipscale.cpp index cca8b905f3..81c254c4dc 100755 --- a/indra/newview/llmanipscale.cpp +++ b/indra/newview/llmanipscale.cpp @@ -1615,10 +1615,10 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) { LLGLDepthTest gls_depth(GL_FALSE); - F32 dist_grid_axis = (drag_point - mScaleCenter) * mScaleDir; + F32 dist_grid_axis = llmax(0.f, (drag_point - mScaleCenter) * mScaleDir); // find distance to nearest smallest grid unit - F32 grid_multiple1 = llfloor(llmax(0.f, dist_grid_axis) / (mScaleSnapUnit1 / max_subdivisions)); - F32 grid_multiple2 = llfloor(llmax(0.f, dist_grid_axis) / (mScaleSnapUnit2 / max_subdivisions)); + F32 grid_multiple1 = llfloor(dist_grid_axis / (mScaleSnapUnit1 / max_subdivisions)); + F32 grid_multiple2 = llfloor(dist_grid_axis / (mScaleSnapUnit2 / max_subdivisions)); F32 grid_offset1 = fmodf(dist_grid_axis, mScaleSnapUnit1 / max_subdivisions); F32 grid_offset2 = fmodf(dist_grid_axis, mScaleSnapUnit2 / max_subdivisions); @@ -1641,7 +1641,6 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) { // draw snap guide line gGL.begin(LLRender::LINES); - //LLVector3 snap_line_center = mScaleCenter + (mScaleSnappedValue * mScaleDir); LLVector3 snap_line_center = bbox.localToAgent(unitVectorToLocalBBoxExtent( partToUnitVector( mManipPart ), bbox )); LLVector3 snap_line_start = snap_line_center + (mSnapGuideDir1 * mSnapRegimeOffset); @@ -1768,8 +1767,6 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) { F32 tick_scale = 1.f; F32 alpha = grid_alpha * (1.f - (0.5f * ((F32)llabs(i) / (F32)num_ticks_per_side1))); - F32 distance = (drag_point - mScaleCenter) * mScaleDir; - (void) distance; LLVector3 tick_pos = mScaleCenter + (mScaleDir * (grid_multiple1 + i) * (mScaleSnapUnit1 / max_subdivisions)); for (F32 division_level = max_subdivisions; division_level >= sGridMinSubdivisionLevel; division_level /= 2.f) -- cgit v1.2.3 From 07c90b5df393f7e1abf54517f4b75fd16f3cf4d8 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 28 Feb 2014 20:32:45 -0800 Subject: MAINT-2059 FIX Corner scaling doesn't highlight distance text better highlighting of opposite axis when corner scaling --- indra/newview/llmanip.cpp | 55 +++--- indra/newview/llmanip.h | 2 +- indra/newview/llmanipscale.cpp | 389 ++++++++++++++++++------------------- indra/newview/llmanipscale.h | 7 +- indra/newview/llmaniptranslate.cpp | 11 +- 5 files changed, 230 insertions(+), 234 deletions(-) (limited to 'indra') diff --git a/indra/newview/llmanip.cpp b/indra/newview/llmanip.cpp index a7d6cb5eac..76008cbec2 100755 --- a/indra/newview/llmanip.cpp +++ b/indra/newview/llmanip.cpp @@ -62,7 +62,7 @@ F32 LLManip::sHelpTextFadeTime = 2.f; S32 LLManip::sNumTimesHelpTextShown = 0; S32 LLManip::sMaxTimesShowHelpText = 5; F32 LLManip::sGridMaxSubdivisionLevel = 32.f; -F32 LLManip::sGridMinSubdivisionLevel = 1.f; +F32 LLManip::sGridMinSubdivisionLevel = 1.f / 32.f; LLVector2 LLManip::sTickLabelSpacing(60.f, 25.f); @@ -176,7 +176,7 @@ BOOL LLManip::getManipAxis(LLViewerObject* object, EManipPart manip, LLVector3 & return TRUE; } -F32 LLManip::getSubdivisionLevel(const LLVector3 &reference_point, const LLVector3 &translate_axis, F32 grid_scale, S32 min_pixel_spacing) +F32 LLManip::getSubdivisionLevel(const LLVector3 &reference_point, const LLVector3 &translate_axis, F32 grid_scale, S32 min_pixel_spacing, F32 min_subdivisions, F32 max_subdivisions) { //update current snap subdivision level LLVector3 cam_to_reference; @@ -192,7 +192,8 @@ F32 LLManip::getSubdivisionLevel(const LLVector3 &reference_point, const LLVecto F32 projected_translation_axis_length = (translate_axis % cam_to_reference).magVec(); F32 subdivisions = llmax(projected_translation_axis_length * grid_scale / (current_range / LLViewerCamera::getInstance()->getPixelMeterRatio() * min_pixel_spacing), 0.f); - subdivisions = llclamp((F32)pow(2.f, llfloor(log(subdivisions) / log(2.f))), 1.f / 32.f, 32.f); + // figure out nearest power of 2 that subdivides grid_scale with result > min_pixel_spacing + subdivisions = llclamp((F32)pow(2.f, llfloor(log(subdivisions) / log(2.f))), min_subdivisions, max_subdivisions); return subdivisions; } @@ -548,37 +549,31 @@ void LLManip::renderTickValue(const LLVector3& pos, F32 value, const std::string BOOL hud_selection = mObjectSelection->getSelectType() == SELECT_TYPE_HUD; gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.pushMatrix(); - LLVector3 render_pos = pos; - if (hud_selection) { - F32 zoom_amt = gAgentCamera.mHUDCurZoom; - F32 inv_zoom_amt = 1.f / zoom_amt; - // scale text back up to counter-act zoom level - render_pos = pos * zoom_amt; - gGL.scalef(inv_zoom_amt, inv_zoom_amt, inv_zoom_amt); - } - - LLColor4 shadow_color = LLColor4::black; - shadow_color.mV[VALPHA] = color.mV[VALPHA] * 0.5f; + LLVector3 render_pos = pos; + if (hud_selection) + { + F32 zoom_amt = gAgentCamera.mHUDCurZoom; + F32 inv_zoom_amt = 1.f / zoom_amt; + // scale text back up to counter-act zoom level + render_pos = pos * zoom_amt; + gGL.scalef(inv_zoom_amt, inv_zoom_amt, inv_zoom_amt); + } - if (fractional_portion != 0) - { - fraction_string = llformat("%c%02d%s", LLResMgr::getInstance()->getDecimalPoint(), fractional_portion, suffix.c_str()); + LLColor4 shadow_color = LLColor4::black; + shadow_color.mV[VALPHA] = color.mV[VALPHA] * 0.5f; - gViewerWindow->setup3DViewport(1, -1); - hud_render_utf8text(val_string, render_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -1.f * big_fontp->getWidthF32(val_string), 3.f, shadow_color, hud_selection); - hud_render_utf8text(fraction_string, render_pos, *small_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, 1.f, 3.f, shadow_color, hud_selection); + if (fractional_portion != 0) + { + fraction_string = llformat("%c%02d%s", LLResMgr::getInstance()->getDecimalPoint(), fractional_portion, suffix.c_str()); - gViewerWindow->setup3DViewport(); - hud_render_utf8text(val_string, render_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -1.f * big_fontp->getWidthF32(val_string), 3.f, color, hud_selection); - hud_render_utf8text(fraction_string, render_pos, *small_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, 1.f, 3.f, color, hud_selection); - } - else - { - gViewerWindow->setup3DViewport(1, -1); - hud_render_utf8text(val_string, render_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -0.5f * big_fontp->getWidthF32(val_string), 3.f, shadow_color, hud_selection); - gViewerWindow->setup3DViewport(); - hud_render_utf8text(val_string, render_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, -0.5f * big_fontp->getWidthF32(val_string), 3.f, color, hud_selection); + hud_render_utf8text(val_string, render_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::DROP_SHADOW, -1.f * big_fontp->getWidthF32(val_string), 3.f, color, hud_selection); + hud_render_utf8text(fraction_string, render_pos, *small_fontp, LLFontGL::NORMAL, LLFontGL::DROP_SHADOW, 1.f, 3.f, color, hud_selection); + } + else + { + hud_render_utf8text(val_string, render_pos, *big_fontp, LLFontGL::NORMAL, LLFontGL::DROP_SHADOW, -0.5f * big_fontp->getWidthF32(val_string), 3.f, color, hud_selection); + } } gGL.popMatrix(); } diff --git a/indra/newview/llmanip.h b/indra/newview/llmanip.h index 6263e4244f..1fb05e047a 100755 --- a/indra/newview/llmanip.h +++ b/indra/newview/llmanip.h @@ -137,7 +137,7 @@ protected: LLVector3 getPivotPoint(); void getManipNormal(LLViewerObject* object, EManipPart manip, LLVector3 &normal); BOOL getManipAxis(LLViewerObject* object, EManipPart manip, LLVector3 &axis); - F32 getSubdivisionLevel(const LLVector3 &reference_point, const LLVector3 &translate_axis, F32 grid_scale, S32 min_pixel_spacing = MIN_DIVISION_PIXEL_WIDTH); + F32 getSubdivisionLevel(const LLVector3 &reference_point, const LLVector3 &translate_axis, F32 grid_scale, S32 min_pixel_spacing = MIN_DIVISION_PIXEL_WIDTH, F32 min_subdivisions = sGridMinSubdivisionLevel, F32 max_subdivisions = sGridMaxSubdivisionLevel); void renderTickValue(const LLVector3& pos, F32 value, const std::string& suffix, const LLColor4 &color); void renderTickText(const LLVector3& pos, const std::string& suffix, const LLColor4 &color); void updateGridSettings(); diff --git a/indra/newview/llmanipscale.cpp b/indra/newview/llmanipscale.cpp index 81c254c4dc..113a639635 100755 --- a/indra/newview/llmanipscale.cpp +++ b/indra/newview/llmanipscale.cpp @@ -185,12 +185,15 @@ LLManipScale::LLManipScale( LLToolComposite* composite ) mLastUpdateFlags( 0 ), mScaleSnapUnit1(1.f), mScaleSnapUnit2(1.f), + mGridScale1(1.f), + mGridScale2(1.f), mSnapRegimeOffset(0.f), mTickPixelSpacing1(0.f), mTickPixelSpacing2(0.f), mSnapGuideLength(0.f), mInSnapRegime(FALSE), - mScaleSnappedValue(0.f) + mScaleSnappedValue1(0.f), + mScaleSnappedValue2(0.f) { for (S32 i = 0; i < NUM_MANIPULATORS; i++) { @@ -291,19 +294,16 @@ void LLManipScale::render() { LLGLEnable poly_offset(GL_POLYGON_OFFSET_FILL); glPolygonOffset( -2.f, -2.f); + { - // JC - Band-aid until edge stretch working similar to side stretch - // in non-uniform. - // renderEdges( bbox ); - - renderCorners( bbox ); - renderFaces( bbox ); + renderCorners( bbox ); + renderFaces( bbox ); - if (mManipPart != LL_NO_PART) - { - renderGuidelinesPart( bbox ); + if (mManipPart != LL_NO_PART) + { + //renderGuidelinesPart( bbox ); + } } - glPolygonOffset( 0.f, 0.f); } } @@ -311,6 +311,7 @@ void LLManipScale::render() if (mManipPart != LL_NO_PART) { + renderGuideline( bbox ); renderSnapGuides(bbox); } gGL.popMatrix(); @@ -348,7 +349,9 @@ BOOL LLManipScale::handleMouseDownOnPart( S32 x, S32 y, MASK mask ) LLBBox bbox = LLSelectMgr::getInstance()->getBBoxOfSelection(); LLVector3 box_center_agent = bbox.getCenterAgent(); - LLVector3 box_corner_agent = bbox.localToAgent( unitVectorToLocalBBoxExtent( partToUnitVector( mManipPart ), bbox ) ); + LLVector3 unit_vector = partToUnitVector( mManipPart ); + LLVector3 extent_vector = unitVectorToLocalBBoxExtent( unit_vector, bbox ); + LLVector3 box_corner_agent = bbox.localToAgent( extent_vector ); updateSnapGuides(bbox); @@ -876,8 +879,8 @@ void LLManipScale::dragCorner( S32 x, S32 y ) LLBBox bbox = LLSelectMgr::getInstance()->getBBoxOfSelection(); F32 scale_factor = 1.f; - F32 max_scale = partToMaxScale(mManipPart, bbox); - F32 min_scale = partToMinScale(mManipPart, bbox); + //F32 max_scale = partToMaxScale(mManipPart, bbox); + //F32 min_scale = partToMinScale(mManipPart, bbox); BOOL uniform = LLManipScale::getUniform(); // check for snapping @@ -892,54 +895,6 @@ void LLManipScale::dragCorner( S32 x, S32 y ) LLVector3 projected_drag_pos1 = inverse_projected_vec(mScaleDir, orthogonal_component(mouse_on_plane1, mSnapGuideDir1)); LLVector3 projected_drag_pos2 = inverse_projected_vec(mScaleDir, orthogonal_component(mouse_on_plane2, mSnapGuideDir2)); - BOOL snap_enabled = gSavedSettings.getBOOL("SnapEnabled"); - if (snap_enabled && (mouse_on_plane1 - projected_drag_pos1) * mSnapGuideDir1 > mSnapRegimeOffset) - { - F32 drag_dist = projected_drag_pos1.length(); - - F32 cur_subdivisions = llclamp(getSubdivisionLevel(mScaleCenter + projected_drag_pos1, mScaleDir, mScaleSnapUnit1, mTickPixelSpacing1), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel); - F32 snap_dist = mScaleSnapUnit1 / (2.f * cur_subdivisions); - F32 relative_snap_dist = fmodf(drag_dist + snap_dist, mScaleSnapUnit1 / cur_subdivisions); - - mScaleSnappedValue = llclamp((drag_dist - (relative_snap_dist - snap_dist)), min_scale, max_scale); - scale_factor = mScaleSnappedValue / dist_vec(drag_start_point_agent, drag_start_center_agent); - mScaleSnappedValue /= mScaleSnapUnit1 * 2.f; - mInSnapRegime = TRUE; - - if (!uniform) - { - scale_factor *= 0.5f; - } - } - else if (snap_enabled && (mouse_on_plane2 - projected_drag_pos2) * mSnapGuideDir2 > mSnapRegimeOffset ) - { - F32 drag_dist = projected_drag_pos2.length(); - - F32 cur_subdivisions = llclamp(getSubdivisionLevel(mScaleCenter + projected_drag_pos2, mScaleDir, mScaleSnapUnit2, mTickPixelSpacing2), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel); - F32 snap_dist = mScaleSnapUnit2 / (2.f * cur_subdivisions); - F32 relative_snap_dist = fmodf(drag_dist + snap_dist, mScaleSnapUnit2 / cur_subdivisions); - - mScaleSnappedValue = llclamp((drag_dist - (relative_snap_dist - snap_dist)), min_scale, max_scale); - scale_factor = mScaleSnappedValue / dist_vec(drag_start_point_agent, drag_start_center_agent); - mScaleSnappedValue /= mScaleSnapUnit2 * 2.f; - mInSnapRegime = TRUE; - - if (!uniform) - { - scale_factor *= 0.5f; - } - } - else - { - mInSnapRegime = FALSE; - scale_factor = t; - if (!uniform) - { - scale_factor = 0.5f + (scale_factor * 0.5f); - } - } - - F32 max_scale_factor = get_default_max_prim_scale() / MIN_PRIM_SCALE; F32 min_scale_factor = MIN_PRIM_SCALE / get_default_max_prim_scale(); @@ -964,7 +919,65 @@ void LLManipScale::dragCorner( S32 x, S32 y ) } } - scale_factor = llclamp( scale_factor, min_scale_factor, max_scale_factor ); + BOOL snap_enabled = gSavedSettings.getBOOL("SnapEnabled"); + if (snap_enabled && (mouse_on_plane1 - projected_drag_pos1) * mSnapGuideDir1 > mSnapRegimeOffset) + { + mInSnapRegime = TRUE; + + F32 drag_dist = projected_drag_pos1 * mScaleDir; + + F32 cur_subdivisions = getSubdivisionLevel(mScaleCenter + projected_drag_pos1, + mScaleDir, + mScaleSnapUnit1, + mTickPixelSpacing1, + 1.f, //always snap to at least the base grid unit + LLManip::sGridMaxSubdivisionLevel); + mScaleSnappedValue1 = mGridScale1 / cur_subdivisions * llround(drag_dist * (cur_subdivisions / mScaleSnapUnit1)); + + scale_factor = mScaleSnappedValue1 / ((drag_start_point_agent - drag_start_center_agent) * mSnapDir1); + scale_factor = llclamp( scale_factor, min_scale_factor, max_scale_factor ); + + mScaleSnappedValue2 = scale_factor * ((drag_start_point_agent - drag_start_center_agent) * mSnapDir2); + + scale_factor *= 0.5f; + } + else if (snap_enabled && (mouse_on_plane2 - projected_drag_pos2) * mSnapGuideDir2 > mSnapRegimeOffset ) + { + mInSnapRegime = TRUE; + + F32 drag_dist = projected_drag_pos2 * mScaleDir; + + F32 cur_subdivisions = getSubdivisionLevel(mScaleCenter + projected_drag_pos2, + mScaleDir, + mScaleSnapUnit2, + mTickPixelSpacing2, + 1.f, //always snap to at least the base grid unit + LLManip::sGridMaxSubdivisionLevel); + mScaleSnappedValue2 = mGridScale2 / cur_subdivisions * llround(drag_dist * (cur_subdivisions / mScaleSnapUnit2)); + + scale_factor = mScaleSnappedValue2 / ((drag_start_point_agent - drag_start_center_agent) * mSnapDir2); + scale_factor = llclamp( scale_factor, min_scale_factor, max_scale_factor ); + + mScaleSnappedValue1 = scale_factor * ((drag_start_point_agent - drag_start_center_agent) * mSnapDir1); + + scale_factor *= 0.5f; + } + else + { + mInSnapRegime = FALSE; + scale_factor = llclamp( t, min_scale_factor, max_scale_factor ); + + if (!uniform) + { + scale_factor = 0.5f + (scale_factor * 0.5f); + } + } + + if (LLSelectMgr::getInstance()->getGridMode() != GRID_MODE_WORLD) + { + mScaleSnappedValue1 /= mGridScale1 * 2.f; + mScaleSnappedValue2 /= mGridScale2 * 2.f; + } LLVector3d drag_global = uniform ? mDragStartCenterGlobal : mDragFarHitGlobal; @@ -1112,14 +1125,14 @@ void LLManipScale::dragFace( S32 x, S32 y ) if (dist_along_scale_line > max_drag_dist) { - mScaleSnappedValue = max_drag_dist; + mScaleSnappedValue1 = max_drag_dist; LLVector3 clamp_point = mScaleCenter + max_drag_dist * mScaleDir; drag_delta.setVec(clamp_point - drag_start_point_agent); } else if (dist_along_scale_line < min_drag_dist) { - mScaleSnappedValue = min_drag_dist; + mScaleSnappedValue1 = min_drag_dist; LLVector3 clamp_point = mScaleCenter + min_drag_dist * mScaleDir; drag_delta.setVec(clamp_point - drag_start_point_agent); @@ -1127,7 +1140,7 @@ void LLManipScale::dragFace( S32 x, S32 y ) else { F32 drag_dist = scale_center_to_mouse * mScaleDir; - F32 cur_subdivisions = llclamp(getSubdivisionLevel(mScaleCenter + mScaleDir * drag_dist, mScaleDir, mScaleSnapUnit1, mTickPixelSpacing1), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel); + F32 cur_subdivisions = getSubdivisionLevel(mScaleCenter + mScaleDir * drag_dist, mScaleDir, mScaleSnapUnit1, mTickPixelSpacing1, 1.f, LLManip::sGridMaxSubdivisionLevel); F32 snap_dist = mScaleSnapUnit1 / (2.f * cur_subdivisions); F32 relative_snap_dist = fmodf(drag_dist + snap_dist, mScaleSnapUnit1 / cur_subdivisions); relative_snap_dist -= snap_dist; @@ -1141,7 +1154,7 @@ void LLManipScale::dragFace( S32 x, S32 y ) drag_dist - max_drag_dist, drag_dist - min_drag_dist); - mScaleSnappedValue = drag_dist - relative_snap_dist; + mScaleSnappedValue1 = drag_dist - relative_snap_dist; if (llabs(relative_snap_dist) < snap_dist) { @@ -1154,6 +1167,10 @@ void LLManipScale::dragFace( S32 x, S32 y ) drag_delta -= drag_correction; } } + if (uniform) + { + mScaleSnappedValue1 *= 2.f; + } } else { @@ -1312,29 +1329,30 @@ void LLManipScale::stretchFace( const LLVector3& drag_start_agent, const LLVecto } -void LLManipScale::renderGuidelinesPart( const LLBBox& bbox ) +void LLManipScale::renderGuideline( const LLBBox& bbox ) { - LLVector3 guideline_start = bbox.getCenterLocal(); - - LLVector3 guideline_end = unitVectorToLocalBBoxExtent( partToUnitVector( mManipPart ), bbox ); + F32 max_point_on_scale_line = partToMaxScale(mManipPart, bbox); - if (!getUniform()) + S32 pass; + for (pass = 0; pass < 3; pass++) { - guideline_start = unitVectorToLocalBBoxExtent( -partToUnitVector( mManipPart ), bbox ); - } + LLColor4 tick_color = setupSnapGuideRenderPass(pass); + LLGLDepthTest gls_depth(pass != 1); - guideline_end -= guideline_start; - guideline_end.normVec(); - guideline_end *= LLWorld::getInstance()->getRegionWidthInMeters(); - guideline_end += guideline_start; + glLineWidth(2.5f); - { - LLGLDepthTest gls_depth(GL_TRUE); - gl_stippled_line_3d( guideline_start, guideline_end, LLColor4(1.f, 1.f, 1.f, 0.5f) ); - } - { - LLGLDepthTest gls_depth(GL_FALSE); - gl_stippled_line_3d( guideline_start, guideline_end, LLColor4(1.f, 1.f, 1.f, 0.25f) ); + gGL.begin(LLRender::LINES); + { + LLVector3 line_start = mScaleCenter; + LLVector3 line_end = line_start + (mScaleDir * max_point_on_scale_line); + + gGL.color4fv(tick_color.mV); + gGL.vertex3fv(line_start.mV); + gGL.vertex3fv(line_end.mV); + } + gGL.end(); + + LLRender2D::setLineWidth(1.f); } } @@ -1399,8 +1417,11 @@ void LLManipScale::updateSnapGuides(const LLBBox& bbox) } LLVector3 scale_snap = grid_scale; - mScaleSnapUnit1 = scale_snap.scaleVec(partToUnitVector( mManipPart )).magVec(); + LLVector3 scale_dir = partToUnitVector( mManipPart ); + mScaleSnapUnit1 = scale_snap.scaleVec(scale_dir).magVec(); mScaleSnapUnit2 = mScaleSnapUnit1; + mGridScale1 = mScaleSnapUnit1; + mGridScale2 = mScaleSnapUnit1; mSnapGuideDir1 *= mSnapGuideDir1 * LLViewerCamera::getInstance()->getUpAxis() > 0.f ? 1.f : -1.f; mSnapGuideDir2 = mSnapGuideDir1 * -1.f; mSnapDir1 = mScaleDir; @@ -1515,30 +1536,30 @@ void LLManipScale::updateSnapGuides(const LLBBox& bbox) case VX: // x axis face being scaled, use y and z for snap guides mSnapGuideDir1 = LLVector3::y_axis.scaledVec(axis_flip); - mScaleSnapUnit1 = grid_scale.mV[VZ]; + mGridScale1 = grid_scale.mV[VZ]; mSnapGuideDir2 = LLVector3::z_axis.scaledVec(axis_flip); - mScaleSnapUnit2 = grid_scale.mV[VY]; + mGridScale2 = grid_scale.mV[VY]; break; case VY: // y axis facing being scaled, use x and z for snap guides mSnapGuideDir1 = LLVector3::x_axis.scaledVec(axis_flip); - mScaleSnapUnit1 = grid_scale.mV[VZ]; + mGridScale1 = grid_scale.mV[VZ]; mSnapGuideDir2 = LLVector3::z_axis.scaledVec(axis_flip); - mScaleSnapUnit2 = grid_scale.mV[VX]; + mGridScale2 = grid_scale.mV[VX]; break; case VZ: // z axis facing being scaled, use x and y for snap guides mSnapGuideDir1 = LLVector3::x_axis.scaledVec(axis_flip); - mScaleSnapUnit1 = grid_scale.mV[VY]; + mGridScale1 = grid_scale.mV[VY]; mSnapGuideDir2 = LLVector3::y_axis.scaledVec(axis_flip); - mScaleSnapUnit2 = grid_scale.mV[VX]; + mGridScale2 = grid_scale.mV[VX]; break; default: mSnapGuideDir1.zeroVec(); - mScaleSnapUnit1 = 0.f; + mGridScale1 = 0.f; mSnapGuideDir2.zeroVec(); - mScaleSnapUnit2 = 0.f; + mGridScale2 = 0.f; break; } @@ -1554,11 +1575,18 @@ void LLManipScale::updateSnapGuides(const LLBBox& bbox) mScalePlaneNormal2 = mSnapGuideDir2 % mScaleDir; mScalePlaneNormal2.normVec(); - mScaleSnapUnit1 = mScaleSnapUnit1 / (mSnapDir1 * mScaleDir); - mScaleSnapUnit2 = mScaleSnapUnit2 / (mSnapDir2 * mScaleDir); + mScaleSnapUnit1 = mGridScale1 / (mSnapDir1 * mScaleDir); + mScaleSnapUnit2 = mGridScale2 / (mSnapDir2 * mScaleDir); - mTickPixelSpacing1 = llround((F32)MIN_DIVISION_PIXEL_WIDTH / (mScaleDir % mSnapGuideDir1).length()); - mTickPixelSpacing2 = llround((F32)MIN_DIVISION_PIXEL_WIDTH / (mScaleDir % mSnapGuideDir2).length()); + LLVector3 scale_dir_screen = orthogonal_component(mScaleDir, cam_at_axis); + scale_dir_screen.normalize(); + LLVector3 snap_guide_dir_1_screen = orthogonal_component(mSnapGuideDir1, cam_at_axis); + snap_guide_dir_1_screen.normalize(); + LLVector3 snap_guide_dir_2_screen = orthogonal_component(mSnapGuideDir2, cam_at_axis); + snap_guide_dir_2_screen.normalize(); + + mTickPixelSpacing1 = llround((F32)MIN_DIVISION_PIXEL_WIDTH / (scale_dir_screen % snap_guide_dir_1_screen).length()); + mTickPixelSpacing2 = llround((F32)MIN_DIVISION_PIXEL_WIDTH / (scale_dir_screen % snap_guide_dir_2_screen).length()); if (uniform) { @@ -1574,68 +1602,42 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) return; } - F32 max_subdivisions = sGridMaxSubdivisionLevel; + F32 max_point_on_scale_line = partToMaxScale(mManipPart, bbox); F32 grid_alpha = gSavedSettings.getF32("GridOpacity"); - F32 max_point_on_scale_line = partToMaxScale(mManipPart, bbox); LLVector3 drag_point = gAgent.getPosAgentFromGlobal(mDragPointGlobal); updateGridSettings(); + // render tick ruler baselines S32 pass; for (pass = 0; pass < 3; pass++) { LLColor4 tick_color = setupSnapGuideRenderPass(pass); + LLGLDepthTest gls_depth(pass != 1); gGL.begin(LLRender::LINES); - LLVector3 line_mid = mScaleCenter + (mScaleSnappedValue * mScaleDir) + (mSnapGuideDir1 * mSnapRegimeOffset); - LLVector3 line_start = line_mid - (mScaleDir * (llmin(mScaleSnappedValue, mSnapGuideLength * 0.5f))); - LLVector3 line_end = line_mid + (mScaleDir * llmin(max_point_on_scale_line - mScaleSnappedValue, mSnapGuideLength * 0.5f)); + { + LLVector3 line_start = mScaleCenter + (mSnapGuideDir1 * mSnapRegimeOffset); + LLVector3 line_end = line_start + (mScaleDir * max_point_on_scale_line); - gGL.color4f(tick_color.mV[VRED], tick_color.mV[VGREEN], tick_color.mV[VBLUE], tick_color.mV[VALPHA] * 0.1f); - gGL.vertex3fv(line_start.mV); - gGL.color4fv(tick_color.mV); - gGL.vertex3fv(line_mid.mV); - gGL.vertex3fv(line_mid.mV); - gGL.color4f(tick_color.mV[VRED], tick_color.mV[VGREEN], tick_color.mV[VBLUE], tick_color.mV[VALPHA] * 0.1f); - gGL.vertex3fv(line_end.mV); - - line_mid = mScaleCenter + (mScaleSnappedValue * mScaleDir) + (mSnapGuideDir2 * mSnapRegimeOffset); - line_start = line_mid - (mScaleDir * (llmin(mScaleSnappedValue, mSnapGuideLength * 0.5f))); - line_end = line_mid + (mScaleDir * llmin(max_point_on_scale_line - mScaleSnappedValue, mSnapGuideLength * 0.5f)); - gGL.vertex3fv(line_start.mV); - gGL.color4fv(tick_color.mV); - gGL.vertex3fv(line_mid.mV); - gGL.vertex3fv(line_mid.mV); - gGL.color4f(tick_color.mV[VRED], tick_color.mV[VGREEN], tick_color.mV[VBLUE], tick_color.mV[VALPHA] * 0.1f); - gGL.vertex3fv(line_end.mV); + gGL.color4fv(tick_color.mV); + gGL.vertex3fv(line_start.mV); + gGL.vertex3fv(line_end.mV); + + line_start = mScaleCenter + (mSnapGuideDir2 * mSnapRegimeOffset); + line_end = line_start + (mScaleDir * max_point_on_scale_line); + gGL.vertex3fv(line_start.mV); + gGL.vertex3fv(line_end.mV); + } gGL.end(); } { LLGLDepthTest gls_depth(GL_FALSE); - F32 dist_grid_axis = llmax(0.f, (drag_point - mScaleCenter) * mScaleDir); - // find distance to nearest smallest grid unit - F32 grid_multiple1 = llfloor(dist_grid_axis / (mScaleSnapUnit1 / max_subdivisions)); - F32 grid_multiple2 = llfloor(dist_grid_axis / (mScaleSnapUnit2 / max_subdivisions)); - F32 grid_offset1 = fmodf(dist_grid_axis, mScaleSnapUnit1 / max_subdivisions); - F32 grid_offset2 = fmodf(dist_grid_axis, mScaleSnapUnit2 / max_subdivisions); - - // how many smallest grid units are we away from largest grid scale? - S32 sub_div_offset_1 = llround(fmod(dist_grid_axis - grid_offset1, mScaleSnapUnit1 / sGridMinSubdivisionLevel) / (mScaleSnapUnit1 / max_subdivisions)); - S32 sub_div_offset_2 = llround(fmod(dist_grid_axis - grid_offset2, mScaleSnapUnit2 / sGridMinSubdivisionLevel) / (mScaleSnapUnit2 / max_subdivisions)); - - S32 num_ticks_per_side1 = llmax(1, lltrunc(0.5f * mSnapGuideLength / (mScaleSnapUnit1 / max_subdivisions))); - S32 num_ticks_per_side2 = llmax(1, lltrunc(0.5f * mSnapGuideLength / (mScaleSnapUnit2 / max_subdivisions))); - F32 dist_scale_units_1 = dist_grid_axis / (mScaleSnapUnit1 / max_subdivisions); - F32 dist_scale_units_2 = dist_grid_axis / (mScaleSnapUnit2 / max_subdivisions); - S32 ticks_from_scale_center_1 = lltrunc(dist_scale_units_1); - S32 ticks_from_scale_center_2 = lltrunc(dist_scale_units_2); - S32 max_ticks1 = llceil(max_point_on_scale_line / (mScaleSnapUnit1 / max_subdivisions) - dist_scale_units_1); - S32 max_ticks2 = llceil(max_point_on_scale_line / (mScaleSnapUnit2 / max_subdivisions) - dist_scale_units_2); - S32 start_tick = 0; - S32 stop_tick = 0; + S32 num_ticks_per_side1 = llmax(1, lltrunc(max_point_on_scale_line / (mScaleSnapUnit1 / sGridMaxSubdivisionLevel))); + S32 num_ticks_per_side2 = llmax(1, lltrunc(max_point_on_scale_line / (mScaleSnapUnit2 / sGridMaxSubdivisionLevel))); if (mInSnapRegime) { @@ -1653,6 +1655,17 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) gGL.vertex3fv(snap_line_end.mV); gGL.end(); + F32 arrow_size; + if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD) + { + arrow_size = 0.1f; + } + else + { + arrow_size = 0.01f * dist_vec(snap_line_center, LLViewerCamera::getInstance()->getOrigin()); + } + + // draw snap guide arrow gGL.begin(LLRender::TRIANGLES); { @@ -1664,15 +1677,15 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) arrow_dir = snap_line_start - snap_line_center; arrow_dir.normVec(); - gGL.vertex3fv((snap_line_start + arrow_dir * mSnapRegimeOffset * 0.1f).mV); - gGL.vertex3fv((snap_line_start + arrow_span * mSnapRegimeOffset * 0.1f).mV); - gGL.vertex3fv((snap_line_start - arrow_span * mSnapRegimeOffset * 0.1f).mV); + gGL.vertex3fv((snap_line_start + arrow_dir * arrow_size).mV); + gGL.vertex3fv((snap_line_start + arrow_span * arrow_size).mV); + gGL.vertex3fv((snap_line_start - arrow_span * arrow_size).mV); arrow_dir = snap_line_end - snap_line_center; arrow_dir.normVec(); - gGL.vertex3fv((snap_line_end + arrow_dir * mSnapRegimeOffset * 0.1f).mV); - gGL.vertex3fv((snap_line_end + arrow_span * mSnapRegimeOffset * 0.1f).mV); - gGL.vertex3fv((snap_line_end - arrow_span * mSnapRegimeOffset * 0.1f).mV); + gGL.vertex3fv((snap_line_end + arrow_dir * arrow_size).mV); + gGL.vertex3fv((snap_line_end + arrow_span * arrow_size).mV); + gGL.vertex3fv((snap_line_end - arrow_span * arrow_size).mV); } gGL.end(); } @@ -1685,35 +1698,32 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) for (pass = 0; pass < 3; pass++) { LLColor4 tick_color = setupSnapGuideRenderPass(pass); - - start_tick = -(llmin(ticks_from_scale_center_1, num_ticks_per_side1)); - stop_tick = llmin(max_ticks1, num_ticks_per_side1); + LLGLDepthTest gls_depth(pass != 1); gGL.begin(LLRender::LINES); // draw first row of ticks - for (S32 i = start_tick; i <= stop_tick; i++) + for (S32 i = 0; i <= num_ticks_per_side1; i++) { - F32 alpha = (1.f - (1.f * ((F32)llabs(i) / (F32)num_ticks_per_side1))); - LLVector3 tick_pos = mScaleCenter + (mScaleDir * (grid_multiple1 + i) * (mScaleSnapUnit1 / max_subdivisions)); + LLVector3 tick_pos = mScaleCenter + (mScaleDir * i * (mScaleSnapUnit1 / sGridMaxSubdivisionLevel)); - F32 cur_subdivisions = llclamp(getSubdivisionLevel(tick_pos, mScaleDir, mScaleSnapUnit1, mTickPixelSpacing1), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel); + F32 cur_subdivisions = getSubdivisionLevel(tick_pos, mScaleDir, mScaleSnapUnit1, mTickPixelSpacing1); - if (fmodf((F32)(i + sub_div_offset_1), (max_subdivisions / cur_subdivisions)) != 0.f) + if (i != num_ticks_per_side1 && fmodf((F32)i, (sGridMaxSubdivisionLevel / cur_subdivisions)) != 0.f) { continue; } F32 tick_scale = 1.f; - for (F32 division_level = max_subdivisions; division_level >= sGridMinSubdivisionLevel; division_level /= 2.f) + for (F32 division_level = sGridMaxSubdivisionLevel; division_level >= sGridMinSubdivisionLevel; division_level /= 2.f) { - if (fmodf((F32)(i + sub_div_offset_1), division_level) == 0.f) + if (fmodf((F32)i, division_level) == 0.f) { break; } tick_scale *= 0.7f; } - gGL.color4f(tick_color.mV[VRED], tick_color.mV[VGREEN], tick_color.mV[VBLUE], tick_color.mV[VALPHA] * alpha); + gGL.color4fv(tick_color.mV); LLVector3 tick_start = tick_pos + (mSnapGuideDir1 * mSnapRegimeOffset); LLVector3 tick_end = tick_start + (mSnapGuideDir1 * mSnapRegimeOffset * tick_scale); gGL.vertex3fv(tick_start.mV); @@ -1721,32 +1731,28 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) } // draw opposite row of ticks - start_tick = -(llmin(ticks_from_scale_center_2, num_ticks_per_side2)); - stop_tick = llmin(max_ticks2, num_ticks_per_side2); - - for (S32 i = start_tick; i <= stop_tick; i++) + for (S32 i = 0; i <= num_ticks_per_side2; i++) { - F32 alpha = (1.f - (1.f * ((F32)llabs(i) / (F32)num_ticks_per_side2))); - LLVector3 tick_pos = mScaleCenter + (mScaleDir * (grid_multiple2 + i) * (mScaleSnapUnit2 / max_subdivisions)); + LLVector3 tick_pos = mScaleCenter + (mScaleDir * i * (mScaleSnapUnit2 / sGridMaxSubdivisionLevel)); - F32 cur_subdivisions = llclamp(getSubdivisionLevel(tick_pos, mScaleDir, mScaleSnapUnit2, mTickPixelSpacing2), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel); + F32 cur_subdivisions = getSubdivisionLevel(tick_pos, mScaleDir, mScaleSnapUnit2, mTickPixelSpacing2); - if (fmodf((F32)(i + sub_div_offset_2), (max_subdivisions / cur_subdivisions)) != 0.f) + if (i != num_ticks_per_side1 && fmodf((F32)i, (sGridMaxSubdivisionLevel / cur_subdivisions)) != 0.f) { continue; } F32 tick_scale = 1.f; - for (F32 division_level = max_subdivisions; division_level >= sGridMinSubdivisionLevel; division_level /= 2.f) + for (F32 division_level = sGridMaxSubdivisionLevel; division_level >= sGridMinSubdivisionLevel; division_level /= 2.f) { - if (fmodf((F32)(i + sub_div_offset_2), division_level) == 0.f) + if (fmodf((F32)i, division_level) == 0.f) { break; } tick_scale *= 0.7f; } - gGL.color4f(tick_color.mV[VRED], tick_color.mV[VGREEN], tick_color.mV[VBLUE], tick_color.mV[VALPHA] * alpha); + gGL.color4fv(tick_color.mV); LLVector3 tick_start = tick_pos + (mSnapGuideDir2 * mSnapRegimeOffset); LLVector3 tick_end = tick_start + (mSnapGuideDir2 * mSnapRegimeOffset * tick_scale); gGL.vertex3fv(tick_start.mV); @@ -1756,29 +1762,23 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) } // render tick labels - start_tick = -(llmin(ticks_from_scale_center_1, num_ticks_per_side1)); - stop_tick = llmin(max_ticks1, num_ticks_per_side1); - F32 grid_resolution = mObjectSelection->getSelectType() == SELECT_TYPE_HUD ? 0.25f : llmax(gSavedSettings.getF32("GridResolution"), 0.001f); - S32 label_sub_div_offset_1 = llround(fmod(dist_grid_axis - grid_offset1, mScaleSnapUnit1 * 32.f) / (mScaleSnapUnit1 / max_subdivisions)); - S32 label_sub_div_offset_2 = llround(fmod(dist_grid_axis - grid_offset2, mScaleSnapUnit2 * 32.f) / (mScaleSnapUnit2 / max_subdivisions)); - for (S32 i = start_tick; i <= stop_tick; i++) + for (S32 i = 0; i <= num_ticks_per_side1; i++) { F32 tick_scale = 1.f; - F32 alpha = grid_alpha * (1.f - (0.5f * ((F32)llabs(i) / (F32)num_ticks_per_side1))); - LLVector3 tick_pos = mScaleCenter + (mScaleDir * (grid_multiple1 + i) * (mScaleSnapUnit1 / max_subdivisions)); + LLVector3 tick_pos = mScaleCenter + (mScaleDir * i * (mScaleSnapUnit1 / sGridMaxSubdivisionLevel)); - for (F32 division_level = max_subdivisions; division_level >= sGridMinSubdivisionLevel; division_level /= 2.f) + for (F32 division_level = sGridMaxSubdivisionLevel; division_level >= sGridMinSubdivisionLevel; division_level /= 2.f) { - if (fmodf((F32)(i + label_sub_div_offset_1), division_level) == 0.f) + if (fmodf((F32)i, division_level) == 0.f) { break; } tick_scale *= 0.7f; } - if (fmodf((F32)(i + label_sub_div_offset_1), (max_subdivisions / llmin(sGridMaxSubdivisionLevel, getSubdivisionLevel(tick_pos, mScaleDir, mScaleSnapUnit1, tick_label_spacing)))) == 0.f) + if (i == num_ticks_per_side1 || fmodf((F32)i, (sGridMaxSubdivisionLevel / getSubdivisionLevel(tick_pos, mScaleDir, mScaleSnapUnit1, tick_label_spacing))) == 0.f) { LLVector3 text_origin = tick_pos + (mSnapGuideDir1 * mSnapRegimeOffset * (1.f + tick_scale)); @@ -1787,45 +1787,42 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) F32 tick_value; if (grid_mode == GRID_MODE_WORLD) { - tick_value = (grid_multiple1 + i) / (max_subdivisions / grid_resolution); + tick_value = i / (sGridMaxSubdivisionLevel / grid_resolution); } else { - tick_value = (grid_multiple1 + i) / (2.f * max_subdivisions); + tick_value = i / (2.f * sGridMaxSubdivisionLevel); } F32 text_highlight = 0.8f; - if (is_approx_equal(tick_value, mScaleSnappedValue) && mInSnapRegime) + if (is_approx_equal(tick_value, mScaleSnappedValue1) && mInSnapRegime) { text_highlight = 1.f; } - renderTickValue(text_origin, tick_value, grid_mode == GRID_MODE_WORLD ? std::string("m") : std::string("x"), LLColor4(text_highlight, text_highlight, text_highlight, alpha)); + renderTickValue(text_origin, tick_value, grid_mode == GRID_MODE_WORLD ? "m" : "x", LLColor4(text_highlight, text_highlight, text_highlight, grid_alpha)); } } // label ticks on opposite side if (mScaleSnapUnit2 != mScaleSnapUnit1) { - start_tick = -(llmin(ticks_from_scale_center_2, num_ticks_per_side2)); - stop_tick = llmin(max_ticks2, num_ticks_per_side2); - for (S32 i = start_tick; i <= stop_tick; i++) + for (S32 i = 0; i <= num_ticks_per_side2; i++) { F32 tick_scale = 1.f; - F32 alpha = grid_alpha * (1.f - (0.5f * ((F32)llabs(i) / (F32)num_ticks_per_side2))); - LLVector3 tick_pos = mScaleCenter + (mScaleDir * (grid_multiple2 + i) * (mScaleSnapUnit2 / max_subdivisions)); + LLVector3 tick_pos = mScaleCenter + (mScaleDir * i * (mScaleSnapUnit2 / sGridMaxSubdivisionLevel)); - for (F32 division_level = max_subdivisions; division_level >= sGridMinSubdivisionLevel; division_level /= 2.f) + for (F32 division_level = sGridMaxSubdivisionLevel; division_level >= sGridMinSubdivisionLevel; division_level /= 2.f) { - if (fmodf((F32)(i + label_sub_div_offset_2), division_level) == 0.f) + if (fmodf(i, division_level) == 0.f) { break; } tick_scale *= 0.7f; } - if (fmodf((F32)(i + label_sub_div_offset_2), (max_subdivisions / llmin(max_subdivisions, getSubdivisionLevel(tick_pos, mScaleDir, mScaleSnapUnit2, tick_label_spacing)))) == 0.f) + if (i == num_ticks_per_side2 || fmodf((F32)i, (sGridMaxSubdivisionLevel / getSubdivisionLevel(tick_pos, mScaleDir, mScaleSnapUnit2, tick_label_spacing))) == 0.f) { LLVector3 text_origin = tick_pos + (mSnapGuideDir2 * mSnapRegimeOffset * (1.f + tick_scale)); @@ -1834,21 +1831,21 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) F32 tick_value; if (grid_mode == GRID_MODE_WORLD) { - tick_value = (grid_multiple2 + i) / (max_subdivisions / grid_resolution); + tick_value = i / (sGridMaxSubdivisionLevel / grid_resolution); } else { - tick_value = (grid_multiple2 + i) / (2.f * max_subdivisions); + tick_value = i / (2.f * sGridMaxSubdivisionLevel); } F32 text_highlight = 0.8f; - if (is_approx_equal(tick_value, mScaleSnappedValue) && mInSnapRegime) + if (is_approx_equal(tick_value, mScaleSnappedValue2) && mInSnapRegime) { text_highlight = 1.f; } - renderTickValue(text_origin, tick_value, grid_mode == GRID_MODE_WORLD ? std::string("m") : std::string("x"), LLColor4(text_highlight, text_highlight, text_highlight, alpha)); + renderTickValue(text_origin, tick_value, grid_mode == GRID_MODE_WORLD ? "m" : "x", LLColor4(text_highlight, text_highlight, text_highlight, grid_alpha)); } } } diff --git a/indra/newview/llmanipscale.h b/indra/newview/llmanipscale.h index 079fda76ce..916213ea0d 100755 --- a/indra/newview/llmanipscale.h +++ b/indra/newview/llmanipscale.h @@ -92,7 +92,7 @@ private: void renderEdges( const LLBBox& local_bbox ); void renderBoxHandle( F32 x, F32 y, F32 z ); void renderAxisHandle( U32 part, const LLVector3& start, const LLVector3& end ); - void renderGuidelinesPart( const LLBBox& local_bbox ); + void renderGuideline( const LLBBox& local_bbox ); void renderSnapGuides( const LLBBox& local_bbox ); void revert(); @@ -149,6 +149,8 @@ private: LLVector4 mManipulatorVertices[14]; F32 mScaleSnapUnit1; // size of snap multiples for axis 1 F32 mScaleSnapUnit2; // size of snap multiples for axis 2 + F32 mGridScale1; + F32 mGridScale2; LLVector3 mScalePlaneNormal1; // normal of plane in which scale occurs that most faces camera LLVector3 mScalePlaneNormal2; // normal of plane in which scale occurs that most faces camera LLVector3 mSnapGuideDir1; @@ -161,7 +163,8 @@ private: F32 mSnapGuideLength; LLVector3 mScaleCenter; LLVector3 mScaleDir; - F32 mScaleSnappedValue; + F32 mScaleSnappedValue1, + mScaleSnappedValue2; BOOL mInSnapRegime; F32 mManipulatorScales[NUM_MANIPULATORS]; F32 mBoxHandleSize[NUM_MANIPULATORS]; // The size of the handles at the corners of the bounding box diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp index 4830a4b875..12c8ac4fb4 100755 --- a/indra/newview/llmaniptranslate.cpp +++ b/indra/newview/llmaniptranslate.cpp @@ -375,7 +375,7 @@ BOOL LLManipTranslate::handleMouseDownOnPart( S32 x, S32 y, MASK mask ) //LLVector3 select_center_agent = gAgent.getPosAgentFromGlobal(LLSelectMgr::getInstance()->getSelectionCenterGlobal()); // TomY: The above should (?) be identical to the below LLVector3 select_center_agent = getPivotPoint(); - mSubdivisions = llclamp(getSubdivisionLevel(select_center_agent, axis_exists ? axis : LLVector3::z_axis, getMinGridScale()), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel); + mSubdivisions = getSubdivisionLevel(select_center_agent, axis_exists ? axis : LLVector3::z_axis, getMinGridScale()); // if we clicked on a planar manipulator, recenter mouse cursor if (mManipPart >= LL_YZ_PLANE && mManipPart <= LL_XY_PLANE) @@ -517,7 +517,7 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask) LLSelectMgr::getInstance()->updateSelectionCenter(); LLVector3d current_pos_global = gAgent.getPosGlobalFromAgent(getPivotPoint()); - mSubdivisions = llclamp(getSubdivisionLevel(getPivotPoint(), axis_f, getMinGridScale()), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel); + mSubdivisions = getSubdivisionLevel(getPivotPoint(), axis_f, getMinGridScale()); // Project the cursor onto that plane LLVector3d relative_move; @@ -607,7 +607,7 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask) max_grid_scale = mGridScale.mV[VZ]; } - F32 num_subdivisions = llclamp(getSubdivisionLevel(getPivotPoint(), camera_projected_dir, max_grid_scale), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel); + F32 num_subdivisions = getSubdivisionLevel(getPivotPoint(), camera_projected_dir, max_grid_scale); F32 grid_scale_a; F32 grid_scale_b; @@ -1255,6 +1255,7 @@ void LLManipTranslate::renderSnapGuides() for (S32 pass = 0; pass < 3; pass++) { LLColor4 line_color = setupSnapGuideRenderPass(pass); + LLGLDepthTest gls_depth(pass != 1); gGL.begin(LLRender::LINES); { @@ -1286,7 +1287,7 @@ void LLManipTranslate::renderSnapGuides() { tick_start = selection_center + (translate_axis * (smallest_grid_unit_scale * (F32)i - offset_nearest_grid_unit)); - F32 cur_subdivisions = llclamp(getSubdivisionLevel(tick_start, translate_axis, getMinGridScale()), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel); + F32 cur_subdivisions = getSubdivisionLevel(tick_start, translate_axis, getMinGridScale()); if (fmodf((F32)(i + sub_div_offset), (max_subdivisions / cur_subdivisions)) != 0.f) { @@ -1384,7 +1385,7 @@ void LLManipTranslate::renderSnapGuides() tick_scale *= 0.7f; } - if (fmodf((F32)(i + sub_div_offset), (max_subdivisions / llmin(sGridMaxSubdivisionLevel, getSubdivisionLevel(tick_pos, translate_axis, getMinGridScale(), tick_label_spacing)))) == 0.f) + if (fmodf((F32)(i + sub_div_offset), (max_subdivisions / getSubdivisionLevel(tick_pos, translate_axis, getMinGridScale(), tick_label_spacing))) == 0.f) { F32 snap_offset_meters; -- cgit v1.2.3 From 0630ac4d87cef2319b94aedb3c5c75b679691427 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 28 Feb 2014 22:35:12 -0800 Subject: MAINT-2059 FIX Corner scaling doesn't highlight distance text code cleanup --- indra/newview/llmanipscale.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llmanipscale.cpp b/indra/newview/llmanipscale.cpp index 113a639635..cc28f52b0b 100755 --- a/indra/newview/llmanipscale.cpp +++ b/indra/newview/llmanipscale.cpp @@ -1658,7 +1658,7 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) F32 arrow_size; if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD) { - arrow_size = 0.1f; + arrow_size = 0.02f; } else { -- cgit v1.2.3 From 9670f19cc3fa71d86c72362e7ac1f95dd0387809 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Thu, 20 Mar 2014 11:37:20 +0200 Subject: MAINT-1190 FIXED Update visual param list when changing sex. --- indra/newview/llpaneleditwearable.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index 0621cc8fad..d7cf206775 100755 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -950,7 +950,7 @@ void LLPanelEditWearable::onCommitSexChange() gAgentAvatarp->updateSexDependentLayerSets( FALSE ); gAgentAvatarp->updateVisualParams(); - + showWearable(mWearablePtr, TRUE, TRUE); updateScrollingPanelUI(); } -- cgit v1.2.3 From 4fdf1c34b43f73c576576a6487c16e99e2ed75fc Mon Sep 17 00:00:00 2001 From: andreylproductengine Date: Thu, 13 Mar 2014 01:44:41 +0200 Subject: MAINT-3812 FIXED "Remove from outfit" is unavailable for folders containing only gestures --- indra/newview/llappearancemgr.cpp | 12 ++++++++++++ indra/newview/llinventoryfunctions.cpp | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index da1609297e..415cefb5a9 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1431,6 +1431,18 @@ void LLAppearanceMgr::takeOffOutfit(const LLUUID& cat_id) uuids_to_remove.push_back(item->getUUID()); } removeItemsFromAvatar(uuids_to_remove); + + // now deactivating all gestures in that folder + LLInventoryModel::item_array_t gest_items; + getDescendentsOfAssetType(cat_id, gest_items, LLAssetType::AT_GESTURE, false); + for (S32 i = 0; i < gest_items.count(); ++i) + { + LLViewerInventoryItem *gest_item = gest_items.get(i); + if (LLGestureMgr::instance().isGestureActive(gest_item->getLinkedUUID())) + { + LLGestureMgr::instance().deactivateGesture(gest_item->getLinkedUUID()); + } + } } // Create a copy of src_id + contents as a subfolder of dst_id. diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index f1a4889f5a..aa50795eb5 100755 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -877,7 +877,7 @@ bool LLFindWearablesEx::operator()(LLInventoryCategory* cat, LLInventoryItem* it if (!vitem) return false; // Skip non-wearables. - if (!vitem->isWearableType() && vitem->getType() != LLAssetType::AT_OBJECT) + if (!vitem->isWearableType() && vitem->getType() != LLAssetType::AT_OBJECT && vitem->getType() != LLAssetType::AT_GESTURE) { return false; } -- cgit v1.2.3 From 6bbb86811e02f508323460e875eabe836e4fe40c Mon Sep 17 00:00:00 2001 From: andreylproductengine Date: Fri, 21 Mar 2014 04:55:55 +0200 Subject: MAINT-3842 FIXED Using "Close Window" (Ctrl + W) shortcut while in Appearance mode doesn't visually revert any changes... --- indra/newview/llfloatersidepanelcontainer.cpp | 4 ++-- indra/newview/llfloatersidepanelcontainer.h | 2 +- indra/newview/llpaneleditwearable.cpp | 6 ++---- 3 files changed, 5 insertions(+), 7 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloatersidepanelcontainer.cpp b/indra/newview/llfloatersidepanelcontainer.cpp index c5248719e9..aee20ff706 100755 --- a/indra/newview/llfloatersidepanelcontainer.cpp +++ b/indra/newview/llfloatersidepanelcontainer.cpp @@ -57,7 +57,7 @@ void LLFloaterSidePanelContainer::onOpen(const LLSD& key) getChild(sMainPanelName)->onOpen(key); } -void LLFloaterSidePanelContainer::onClickCloseBtn(bool) +void LLFloaterSidePanelContainer::closeFloater(bool app_quitting) { LLPanelOutfitEdit* panel_outfit_edit = dynamic_cast(LLFloaterSidePanelContainer::getPanel("appearance", "panel_outfit_edit")); @@ -75,7 +75,7 @@ void LLFloaterSidePanelContainer::onClickCloseBtn(bool) } } - LLFloater::onClickCloseBtn(); + LLFloater::closeFloater(app_quitting); } LLPanel* LLFloaterSidePanelContainer::openChildPanel(const std::string& panel_name, const LLSD& params) diff --git a/indra/newview/llfloatersidepanelcontainer.h b/indra/newview/llfloatersidepanelcontainer.h index 65ec8f604e..cb5956e4ef 100755 --- a/indra/newview/llfloatersidepanelcontainer.h +++ b/indra/newview/llfloatersidepanelcontainer.h @@ -51,7 +51,7 @@ public: /*virtual*/ void onOpen(const LLSD& key); - /*virtual*/ void onClickCloseBtn(bool app_quitting = false); + /*virtual*/ void closeFloater(bool app_quitting = false); LLPanel* openChildPanel(const std::string& panel_name, const LLSD& params); diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index d7cf206775..7b50b3c7af 100755 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -859,10 +859,8 @@ void LLPanelEditWearable::draw() void LLPanelEditWearable::onClose() { - if ( isDirty() ) - { - revertChanges(); - } + // any unsaved changes should be reverted at this point + revertChanges(); } void LLPanelEditWearable::setVisible(BOOL visible) -- cgit v1.2.3 From 7698e169f55c41f99b3a35b9a54f55984faf2473 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Mon, 24 Mar 2014 11:20:59 +0200 Subject: MAINT-3186 FIXED Disable menu items if group or ad-hoc chat is in multiselection --- indra/newview/llfloaterimcontainer.cpp | 20 ++++++++++++++++++++ .../skins/default/xui/en/menu_conversation.xml | 1 + 2 files changed, 21 insertions(+) (limited to 'indra') diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index bb4b9d2d40..5e59460b30 100755 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -1271,6 +1271,22 @@ bool LLFloaterIMContainer::enableContextMenuItem(const LLSD& userdata) uuid_vec_t uuids; getParticipantUUIDs(uuids); + + //If there is group or ad-hoc chat in multiselection, everything needs to be disabled + if(uuids.size() > 1) + { + const std::set selectedItems = mConversationsRoot->getSelectionList(); + LLConversationItem * conversationItem; + for(std::set::const_iterator it = selectedItems.begin(); it != selectedItems.end(); ++it) + { + conversationItem = static_cast((*it)->getViewModelItem()); + if((conversationItem->getType() == LLConversationItem::CONV_SESSION_GROUP) || (conversationItem->getType() == LLConversationItem::CONV_SESSION_AD_HOC)) + { + return false; + } + } + } + if ("conversation_log" == item) { return gSavedPerAccountSettings.getS32("KeepConversationLogTranscripts") > 0; @@ -1375,6 +1391,10 @@ bool LLFloaterIMContainer::enableContextMenuItem(const std::string& item, uuid_v else if ("can_call" == item) { return LLAvatarActions::canCall(); + } + else if ("can_open_voice_conversation" == item) + { + return is_single_select && LLAvatarActions::canCall(); } else if ("can_zoom_in" == item) { diff --git a/indra/newview/skins/default/xui/en/menu_conversation.xml b/indra/newview/skins/default/xui/en/menu_conversation.xml index 31b1d091ee..f5a493c064 100755 --- a/indra/newview/skins/default/xui/en/menu_conversation.xml +++ b/indra/newview/skins/default/xui/en/menu_conversation.xml @@ -17,6 +17,7 @@ layout="topleft" name="open_voice_conversation"> + Date: Fri, 21 Mar 2014 22:20:59 +0200 Subject: MAINT-1805 FIXED "Back" button doesn't teleport user to correct location after performing several teleports to a different locations Agent position gets reseted frequently while not all varibles are uptadet, as result it is not reliable for inter-region teleportation. Changed to value from message. --- indra/newview/llviewerparcelmgr.cpp | 12 +++++++++++- indra/newview/llviewerparcelmgr.h | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index e361fad9de..04f02872f3 100755 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -118,6 +118,7 @@ LLViewerParcelMgr::LLViewerParcelMgr() mHoverRequestResult(0), mHoverWestSouth(), mHoverEastNorth(), + mTeleportInProgressPosition(), mRenderCollision(FALSE), mRenderSelection(TRUE), mCollisionBanned(0), @@ -1586,7 +1587,15 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use if (instance->mTeleportInProgress) { instance->mTeleportInProgress = FALSE; - instance->mTeleportFinishedSignal(gAgent.getPositionGlobal(), false); + if(instance->mTeleportInProgressPosition.isNull()) + { + //initial update + instance->mTeleportFinishedSignal(gAgent.getPositionGlobal(), false); + } + else + { + instance->mTeleportFinishedSignal(instance->mTeleportInProgressPosition, false); + } } } } @@ -2495,6 +2504,7 @@ void LLViewerParcelMgr::onTeleportFinished(bool local, const LLVector3d& new_pos // Non-local teleport (inter-region or between different parcels of the same region). // The agent parcel data has not been updated yet. // Let's wait for the update and then emit the signal. + mTeleportInProgressPosition = new_pos; mTeleportInProgress = TRUE; } } diff --git a/indra/newview/llviewerparcelmgr.h b/indra/newview/llviewerparcelmgr.h index 9da49bb3f3..ee8d4778d9 100755 --- a/indra/newview/llviewerparcelmgr.h +++ b/indra/newview/llviewerparcelmgr.h @@ -336,6 +336,7 @@ private: LLDynamicArray mObservers; BOOL mTeleportInProgress; + LLVector3d mTeleportInProgressPosition; teleport_finished_signal_t mTeleportFinishedSignal; teleport_failed_signal_t mTeleportFailedSignal; -- cgit v1.2.3 From 3d80a0858d97012bf24cfb26e4053369c41b068e Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 24 Mar 2014 14:04:40 -0500 Subject: MAINT-3211 Fix for texture animations not working properly on rigged attachments when worn from inventory. --- .../app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl | 2 +- indra/newview/lldrawpoolavatar.cpp | 11 +++++++++++ indra/newview/llface.cpp | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl index a74290bfcd..2487110624 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl @@ -40,7 +40,7 @@ mat4 getObjectSkinnedTransform(); void main() { vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; - + mat4 mat = getObjectSkinnedTransform(); mat = modelview_matrix * mat; diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 24f467f954..716243b381 100755 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -1517,6 +1517,17 @@ void LLDrawPoolAvatar::getRiggedGeometry(LLFace* face, LLPointer face->setPoolType(LLDrawPool::POOL_AVATAR); } + //let getGeometryVolume know if a texture matrix is in play + if (face->mTextureMatrix) + { + face->setState(LLFace::TEXTURE_ANIM); + } + else + { + face->clearState(LLFace::TEXTURE_ANIM); + } + + //llinfos << "Rebuilt face " << face->getTEOffset() << " of " << face->getDrawable() << " at " << gFrameTimeSeconds << llendl; face->getGeometryVolume(*volume, face->getTEOffset(), mat_vert, mat_normal, offset, true); diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index ae62be0ad0..d69c185a2b 100755 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -1638,7 +1638,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, do_xform = false; } - if (getVirtualSize() >= MIN_TEX_ANIM_SIZE) + if (getVirtualSize() >= MIN_TEX_ANIM_SIZE || isState(LLFace::RIGGED)) { //don't override texture transform during tc bake tex_mode = 0; } -- cgit v1.2.3 From bb0515db318ee4e528da75160e982b38dd9b4b5f Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Tue, 25 Mar 2014 11:37:19 +0200 Subject: MAINT-3852 FIXED Use script name in "Save as" dialog. --- indra/newview/llpreviewscript.cpp | 3 ++- indra/newview/llpreviewscript.h | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index 18bbf110f7..7ea62bb332 100755 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -1191,7 +1191,7 @@ void LLScriptEdCore::onBtnSaveToFile( void* userdata ) if( self->mSaveCallback ) { LLFilePicker& file_picker = LLFilePicker::instance(); - if( file_picker.getSaveFile( LLFilePicker::FFSAVE_SCRIPT ) ) + if( file_picker.getSaveFile( LLFilePicker::FFSAVE_SCRIPT, self->mScriptName ) ) { std::string filename = file_picker.getFirstFile(); std::string scriptText=self->mEditor->getText(); @@ -1978,6 +1978,7 @@ void LLLiveLSLEditor::loadScriptText(LLVFS *vfs, const LLUUID &uuid, LLAssetType mScriptEd->setScriptText(LLStringExplicit(&buffer[0]), TRUE); mScriptEd->mEditor->makePristine(); + mScriptEd->setScriptName(getItem()->getName()); } diff --git a/indra/newview/llpreviewscript.h b/indra/newview/llpreviewscript.h index 9fb0a4fb63..97187e055a 100755 --- a/indra/newview/llpreviewscript.h +++ b/indra/newview/llpreviewscript.h @@ -110,6 +110,8 @@ public: virtual bool hasAccelerators() const { return true; } + void setScriptName(const std::string& name){mScriptName = name;}; + private: void onBtnHelp(); void onBtnDynamicHelp(); @@ -132,6 +134,7 @@ protected: private: std::string mSampleText; + std::string mScriptName; LLTextEditor* mEditor; void (*mLoadCallback)(void* userdata); void (*mSaveCallback)(void* userdata, BOOL close_after_save); -- cgit v1.2.3 From ffbf11e4430041d1df17e21e70d40348467a8d9d Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Wed, 26 Mar 2014 11:08:36 +0200 Subject: MAINT-2018 FIXED Viewer crashes when copying and pasting an empty outfit folder --- indra/newview/llinventorybridge.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 101b16b027..75a4c22d33 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3241,7 +3241,7 @@ void LLFolderBridge::pasteFromClipboard() { if (move_is_into_current_outfit || move_is_into_outfit) { - if (can_move_to_outfit(item, move_is_into_current_outfit)) + if (item && can_move_to_outfit(item, move_is_into_current_outfit)) { dropToOutfit(item, move_is_into_current_outfit); } -- cgit v1.2.3 From 73ef75498692e7b7cecb4960f4e308061917d86e Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Wed, 26 Mar 2014 11:10:26 +0200 Subject: MAINT-2376 FIXED Centre the map on friend's location --- indra/newview/llavataractions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 70cc48f12b..3fa50360cb 100755 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -373,7 +373,7 @@ void LLAvatarActions::showOnMap(const LLUUID& id) } gFloaterWorldMap->trackAvatar(id, av_name.getDisplayName()); - LLFloaterReg::showInstance("world_map"); + LLFloaterReg::showInstance("world_map", "center"); } // static -- cgit v1.2.3 From e0fb4b598266e8aaf6bbc73bae5e5390e361cfb2 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 26 Mar 2014 16:06:16 +0200 Subject: MAINT-1851 FIXED Viewer crashes while attempting to close "Snapshot" dialog after pressing on "Snapshot" icon several times at the left toolbar --- indra/newview/skins/default/xui/en/floater_snapshot.xml | 1 + 1 file changed, 1 insertion(+) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/floater_snapshot.xml b/indra/newview/skins/default/xui/en/floater_snapshot.xml index 853c209bca..c0089a30d8 100755 --- a/indra/newview/skins/default/xui/en/floater_snapshot.xml +++ b/indra/newview/skins/default/xui/en/floater_snapshot.xml @@ -7,6 +7,7 @@ height="500" layout="topleft" name="Snapshot" + single_instance="true" help_topic="snapshot" save_rect="true" save_visibility="false" -- cgit v1.2.3 From 4994d9d97d23afad234950f45a4ce99a276c5b5c Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Fri, 28 Mar 2014 18:22:03 +0200 Subject: MAINT-3878 FIXED Don't hide folder if it has descendants. --- indra/newview/llinventoryfilter.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 15463e0d33..b0d0cb217b 100755 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -177,6 +177,7 @@ bool LLInventoryFilter::checkAgainstFilterType(const LLFolderViewModelItemInvent // Pass if this item's type is of the correct filter type if (filterTypes & FILTERTYPE_OBJECT) { + // If it has no type, pass it, unless it's a link. if (object_type == LLInventoryType::IT_NONE) { @@ -244,13 +245,25 @@ bool LLInventoryFilter::checkAgainstFilterType(const LLFolderViewModelItemInvent bool is_hidden_if_empty = LLViewerFolderType::lookupIsHiddenIfEmpty(listener->getPreferredType()); if (is_hidden_if_empty) { - // Force the fetching of those folders so they are hidden iff they really are empty... + // Force the fetching of those folders so they are hidden if they really are empty... gInventory.fetchDescendentsOf(object_id); - return FALSE; + + LLInventoryModel::cat_array_t* cat_array = NULL; + LLInventoryModel::item_array_t* item_array = NULL; + gInventory.getDirectDescendentsOf(object_id,cat_array,item_array); + S32 descendents_actual = 0; + if(cat_array && item_array) + { + descendents_actual = cat_array->count() + item_array->count(); + } + if (descendents_actual == 0) + { + return FALSE; + } } } } - + return TRUE; } -- cgit v1.2.3 From dcb9b7fb05a045ca954e601cb315f58be1bea85b Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Mon, 31 Mar 2014 10:54:59 +0300 Subject: MAINT-535 FIXED The teleport SLAPP is changed to UNTRUSTED_THROTTLE. Confirmation dialog for teleporting via slapp is added. --- indra/newview/llurldispatcher.cpp | 43 ++++++++++++++++++++-- .../newview/skins/default/xui/en/notifications.xml | 13 +++++++ 2 files changed, 52 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/newview/llurldispatcher.cpp b/indra/newview/llurldispatcher.cpp index 0c34db39b5..ca593c80bc 100755 --- a/indra/newview/llurldispatcher.cpp +++ b/indra/newview/llurldispatcher.cpp @@ -34,6 +34,7 @@ #include "llfloaterreg.h" #include "llfloatersidepanelcontainer.h" #include "llfloaterworldmap.h" +#include "llnotifications.h" #include "llpanellogin.h" #include "llregionhandle.h" #include "llslurl.h" @@ -253,13 +254,15 @@ void LLURLDispatcherImpl::regionHandleCallback(U64 region_handle, const LLSLURL& //--------------------------------------------------------------------------- // Teleportation links are handled here because they are tightly coupled // to SLURL parsing and sim-fragment parsing + class LLTeleportHandler : public LLCommandHandler { public: // Teleport requests *must* come from a trusted browser // inside the app, otherwise a malicious web page could // cause a constant teleport loop. JC - LLTeleportHandler() : LLCommandHandler("teleport", UNTRUSTED_BLOCK) { } + LLTeleportHandler() : LLCommandHandler("teleport", UNTRUSTED_THROTTLE) { } + bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web) @@ -276,18 +279,50 @@ public: tokens[3].asReal()); } + LLSD args; + args["LOCATION"] = tokens[0]; + // Region names may be %20 escaped. - std::string region_name = LLURI::unescape(tokens[0]); + LLSD payload; + payload["region_name"] = region_name; + payload["callback_url"] = LLSLURL(region_name, coords).getSLURLString(); + + LLNotificationsUtil::add("TeleportViaSLAPP", args, payload); + return true; + } + + static void teleport_via_slapp(std::string region_name, std::string callback_url) + { + LLWorldMapMessage::getInstance()->sendNamedRegionRequest(region_name, LLURLDispatcherImpl::regionHandleCallback, - LLSLURL(region_name, coords).getSLURLString(), + callback_url, true); // teleport - return true; } + + static bool teleport_via_slapp_callback(const LLSD& notification, const LLSD& response) + { + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + + std::string region_name = notification["payload"]["region_name"].asString(); + std::string callback_url = notification["payload"]["callback_url"].asString(); + + if (option == 0) + { + teleport_via_slapp(region_name, callback_url); + return true; + } + + return false; + } + }; LLTeleportHandler gTeleportHandler; +static LLNotificationFunctorRegistration open_landmark_callback_reg("TeleportViaSLAPP", LLTeleportHandler::teleport_via_slapp_callback); + + //--------------------------------------------------------------------------- diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index ce34c3f7a1..07531e0d56 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -4137,6 +4137,19 @@ Are you sure you want to teleport to <nolink>[LOCATION]</nolink>? notext="Cancel" yestext="Teleport"/> + + +Are you sure you want to teleport to <nolink>[LOCATION]</nolink>? + confirm + + Date: Fri, 28 Mar 2014 19:09:38 +0200 Subject: MAINT-3871 FIXED Recent issues with dragging the World Map. --- indra/newview/llworldmapview.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra') diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index 786e4f2de6..9c1fecefad 100755 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -1694,6 +1694,8 @@ BOOL LLWorldMapView::handleHover( S32 x, S32 y, MASK mask ) sPanY += delta_y; sTargetPanX = sPanX; sTargetPanY = sPanY; + + gViewerWindow->moveCursorToCenter(); } // doesn't matter, cursor should be hidden -- cgit v1.2.3 From f7b66fadf65365797025ec56773cad8cf9c8900f Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 28 Mar 2014 17:54:07 +0200 Subject: MAINT-1606 FIXED Warning message 'The object is not for sale' appears while user try to buy the shared object --- indra/newview/lltoolpie.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index a09a2739e8..8a341e2c95 100755 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -438,8 +438,12 @@ ECursorType LLToolPie::cursorFromObject(LLViewerObject* object) break; case CLICK_ACTION_BUY: if ( mClickActionBuyEnabled ) - { - cursor = UI_CURSOR_TOOLBUY; + { + LLSelectNode* node = LLSelectMgr::getInstance()->getHoverNode(); + if (!node || node->mSaleInfo.isForSale()) + { + cursor = UI_CURSOR_TOOLBUY; + } } break; case CLICK_ACTION_OPEN: @@ -543,6 +547,7 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask) mHoverPick = gViewerWindow->pickImmediate(x, y, FALSE); LLViewerObject *parent = NULL; LLViewerObject *object = mHoverPick.getObject(); + LLSelectMgr::getInstance()->setHoverObject(object, mHoverPick.mObjectFace); if (object) { parent = object->getRootEdit(); -- cgit v1.2.3 From 435c1950213be95f359a5d33e23e74cc2e8c76a0 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 31 Mar 2014 16:38:31 +0300 Subject: MAINT-1696 FIXED "Owner" name is not clickable in "Place Profile" dialog if region is group owned --- indra/newview/llpanelplaceprofile.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpanelplaceprofile.cpp b/indra/newview/llpanelplaceprofile.cpp index 3b8acdca90..b636b76b07 100755 --- a/indra/newview/llpanelplaceprofile.cpp +++ b/indra/newview/llpanelplaceprofile.cpp @@ -488,8 +488,9 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel, gCacheName->getGroup(parcel->getGroupID(), boost::bind(&LLPanelPlaceInfo::onNameCache, mRegionGroupText, _2)); - gCacheName->getGroup(parcel->getGroupID(), - boost::bind(&LLPanelPlaceInfo::onNameCache, mParcelOwner, _2)); + std::string owner = + LLSLURL("group", parcel->getGroupID(), "inspect").getSLURLString(); + mParcelOwner->setText(owner); } else { -- cgit v1.2.3 From e96fad30ac06f040099db2148a0f482641d1cbd4 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 1 Apr 2014 19:00:21 +0300 Subject: MAINT-1180 FIXED Cannot delete object description. --- indra/llui/lllineeditor.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra') diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index 5478e85e13..91d2f8f653 100755 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -253,6 +253,7 @@ void LLLineEditor::onCommit() setControlValue(getValue()); LLUICtrl::onCommit(); + resetDirty(); // Selection on commit needs to be turned off when evaluating maths // expressions, to allow indication of the error position -- cgit v1.2.3 From 873543bd88e1461ffadbc95ee215a1654e813261 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Wed, 2 Apr 2014 13:06:53 +0300 Subject: MAINT-2536 FIXED Ignore selectTool( gGrabTransientTool ) if mouse down is handled in mouselook and mouse up event is not handled in this mode. --- indra/newview/lltoolgrab.cpp | 18 ++++++++++++++---- indra/newview/lltoolgrab.h | 2 ++ 2 files changed, 16 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/newview/lltoolgrab.cpp b/indra/newview/lltoolgrab.cpp index 9907da0f0e..ff544f1e84 100755 --- a/indra/newview/lltoolgrab.cpp +++ b/indra/newview/lltoolgrab.cpp @@ -83,6 +83,7 @@ LLToolGrab::LLToolGrab( LLToolComposite* composite ) mLastFace(0), mSpinGrabbing( FALSE ), mSpinRotation(), + mClickedInMouselook( FALSE ), mHideBuildHighlight(FALSE) { } @@ -136,6 +137,7 @@ BOOL LLToolGrab::handleMouseDown(S32 x, S32 y, MASK mask) // can grab transparent objects (how touch event propagates, scripters rely on this) gViewerWindow->pickAsync(x, y, mask, pickCallback, TRUE); } + mClickedInMouselook = gAgentCamera.cameraMouselook(); return TRUE; } @@ -926,13 +928,21 @@ BOOL LLToolGrab::handleMouseUp(S32 x, S32 y, MASK mask) { setMouseCapture( FALSE ); } + mMode = GRAB_INACTIVE; - // HACK: Make some grabs temporary - if (gGrabTransientTool) + if(mClickedInMouselook && !gAgentCamera.cameraMouselook()) { - gBasicToolset->selectTool( gGrabTransientTool ); - gGrabTransientTool = NULL; + mClickedInMouselook = FALSE; + } + else + { + // HACK: Make some grabs temporary + if (gGrabTransientTool) + { + gBasicToolset->selectTool( gGrabTransientTool ); + gGrabTransientTool = NULL; + } } //gAgent.setObjectTracking(gSavedSettings.getBOOL("TrackFocusObject")); diff --git a/indra/newview/lltoolgrab.h b/indra/newview/lltoolgrab.h index 06a3b662c8..5107716aab 100755 --- a/indra/newview/lltoolgrab.h +++ b/indra/newview/lltoolgrab.h @@ -133,6 +133,8 @@ private: LLQuaternion mSpinRotation; BOOL mHideBuildHighlight; + + BOOL mClickedInMouselook; }; extern BOOL gGrabBtnVertical; -- cgit v1.2.3 From 1108a34d1dc063eddf2b0e4991b6391a12686be7 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Tue, 8 Apr 2014 12:37:41 +0300 Subject: MAINT-3907 FIXED Handle pressing of Alt/Shift/Control keys without any other key being pressed simultaneously. --- indra/llwindow/llopenglview-objc.mm | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index 017ea3769c..f7031341eb 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -398,9 +398,35 @@ attributedStringInfo getSegments(NSAttributedString *str) } } -- (void)flagsChanged:(NSEvent *)theEvent { +- (void)flagsChanged:(NSEvent *)theEvent +{ mModifiers = [theEvent modifierFlags]; callModifier([theEvent modifierFlags]); + + NSInteger mask = 0; + switch([theEvent keyCode]) + { + case 56: + mask = NSShiftKeyMask; + break; + case 58: + mask = NSAlternateKeyMask; + break; + case 59: + mask = NSControlKeyMask; + break; + default: + return; + } + + if (mModifiers & mask) + { + callKeyDown([theEvent keyCode], 0); + } + else + { + callKeyUp([theEvent keyCode], 0); + } } - (BOOL) acceptsFirstResponder -- cgit v1.2.3 From 508487bdee53daf385653561fc14193dd3fc69a3 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 7 Apr 2014 18:36:02 +0300 Subject: MAINT-459 FIXED Cannot delete prim displaying media Fixed interaction with unselected faces while media is selected. --- indra/newview/lltoolselect.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'indra') diff --git a/indra/newview/lltoolselect.cpp b/indra/newview/lltoolselect.cpp index 7c604a04bf..0e69cc51ac 100755 --- a/indra/newview/lltoolselect.cpp +++ b/indra/newview/lltoolselect.cpp @@ -35,6 +35,7 @@ #include "llmanip.h" #include "llmenugl.h" #include "llselectmgr.h" +#include "llviewermediafocus.h" #include "lltoolmgr.h" #include "llfloaterscriptdebug.h" #include "llviewercamera.h" @@ -109,6 +110,21 @@ LLObjectSelectionHandle LLToolSelect::handleObjectSelection(const LLPickInfo& pi { BOOL already_selected = object->isSelected(); + if (already_selected && + object->getNumTEs() > 0 && + !LLSelectMgr::getInstance()->getSelection()->contains(object,SELECT_ALL_TES)) + { + const LLTextureEntry* tep = object->getTE(pick.mObjectFace); + if (tep && !tep->isSelected() && !LLViewerMediaFocus::getInstance()->getFocusedObjectID().isNull()) + { + // we were interacting with media and clicked on non selected face, drop media focus + LLViewerMediaFocus::getInstance()->clearFocus(); + // selection was removed and zoom preserved by clearFocus(), continue with regular selection + already_selected = false; + extend_select = true; + } + } + if ( extend_select ) { if ( already_selected ) -- cgit v1.2.3 From 83bd0625f058e0ca64deb3eaa4ccd87c09c4624f Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Wed, 9 Apr 2014 10:50:18 +0300 Subject: MAINT-27 FIXED Prevent pasting non-ascii chars to avoid creating outfits with empty name. --- indra/newview/lltoastalertpanel.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra') diff --git a/indra/newview/lltoastalertpanel.cpp b/indra/newview/lltoastalertpanel.cpp index 6083210080..c6e4fdf25a 100755 --- a/indra/newview/lltoastalertpanel.cpp +++ b/indra/newview/lltoastalertpanel.cpp @@ -267,6 +267,11 @@ LLToastAlertPanel::LLToastAlertPanel( LLNotificationPtr notification, bool modal mLineEditor->setMaxTextChars(edit_text_max_chars); mLineEditor->setText(edit_text_contents); + if("SaveOutfitAs" == mNotification->getName()) + { + mLineEditor->setPrevalidate(&LLTextValidate::validateASCII); + } + // decrease limit of line editor of teleport offer dialog to avoid truncation of // location URL in invitation message, see EXT-6891 if ("OfferTeleport" == mNotification->getName()) -- cgit v1.2.3 From 8683c47615fefb6fe531ceca4bf428a0faf010c2 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Thu, 10 Apr 2014 12:36:12 +0300 Subject: MAINT-1695 FIXED Close floater after saving notecard. --- indra/newview/llpreviewnotecard.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra') diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp index 3a9360fd23..61525bd560 100755 --- a/indra/newview/llpreviewnotecard.cpp +++ b/indra/newview/llpreviewnotecard.cpp @@ -476,12 +476,17 @@ bool LLPreviewNotecard::saveIfNeeded(LLInventoryItem* copyitem) &onSaveComplete, (void*)info, FALSE); + return true; } else // !gAssetStorage { llwarns << "Not connected to an asset storage system." << llendl; return false; } + if(mCloseAfterSave) + { + closeFloater(); + } } } return true; -- cgit v1.2.3 From 75b93c15abc9ad9964fd5ef1e89335e50bdd6647 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 9 Apr 2014 16:21:56 +0300 Subject: MAINT-2245 FIXED Object's content doesn't display inside "Buy" dialog when prim is set for sale --- indra/newview/llviewerobject.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index c789719291..1900112822 100755 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -2563,8 +2563,8 @@ void LLViewerObject::dirtyInventory() mInventory->clear(); // will deref and delete entries delete mInventory; mInventory = NULL; - mInventoryDirty = TRUE; } + mInventoryDirty = TRUE; } void LLViewerObject::registerInventoryListener(LLVOInventoryListener* listener, void* user_data) @@ -2601,12 +2601,15 @@ void LLViewerObject::clearInventoryListeners() void LLViewerObject::requestInventory() { - mInventoryDirty = FALSE; + if(mInventoryDirty && mInventory && !mInventoryCallbacks.empty()) + { + mInventory->clear(); // will deref and delete entries + delete mInventory; + mInventory = NULL; + mInventoryDirty = FALSE; //since we are going to request it now + } if(mInventory) { - //mInventory->clear() // will deref and delete it - //delete mInventory; - //mInventory = NULL; doInventoryCallback(); } // throw away duplicate requests -- cgit v1.2.3 From 0b0ca7961bfb4fb808c9653a68c46eb2353ba2a8 Mon Sep 17 00:00:00 2001 From: andreylproductengine Date: Thu, 10 Apr 2014 07:05:34 +0300 Subject: MAINT-3846 FIXED I can only invite members to a group to the role of everyone... --- indra/newview/llpanelgroupinvite.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpanelgroupinvite.cpp b/indra/newview/llpanelgroupinvite.cpp index a9a3c686a6..bb4bfb2f96 100755 --- a/indra/newview/llpanelgroupinvite.cpp +++ b/indra/newview/llpanelgroupinvite.cpp @@ -260,7 +260,7 @@ void LLPanelGroupInvite::impl::addRoleNames(LLGroupMgrGroupData* gdatap) //else if they have the limited add to roles power //we add every role the user is in //else we just add to everyone - bool is_owner = member_data->isInRole(gdatap->mOwnerRole); + bool is_owner = member_data->isOwner(); bool can_assign_any = gAgent.hasPowerInGroup(mGroupID, GP_ROLE_ASSIGN_MEMBER); bool can_assign_limited = gAgent.hasPowerInGroup(mGroupID, @@ -579,7 +579,7 @@ void LLPanelGroupInvite::updateLists() { waiting = true; } - if (gdatap->isRoleDataComplete() && gdatap->isMemberDataComplete()) + if (gdatap->isRoleDataComplete() && gdatap->isMemberDataComplete() && gdatap->isRoleMemberDataComplete()) { if ( mImplementation->mRoleNames ) { @@ -607,6 +607,7 @@ void LLPanelGroupInvite::updateLists() { LLGroupMgr::getInstance()->sendGroupPropertiesRequest(mImplementation->mGroupID); LLGroupMgr::getInstance()->sendGroupRoleDataRequest(mImplementation->mGroupID); + LLGroupMgr::getInstance()->sendGroupRoleMembersRequest(mImplementation->mGroupID); LLGroupMgr::getInstance()->sendCapGroupMembersRequest(mImplementation->mGroupID); } mPendingUpdate = TRUE; -- cgit v1.2.3 From 4cf5d945d4e892c1c5383e49910759c24ecbf591 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Mon, 14 Apr 2014 11:13:22 +0300 Subject: MAINT-3564 FIXED Replace dot before comparing user name. --- indra/newview/llpanellogin.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra') diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 911ecaad9d..d6183c5ab3 100755 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -262,6 +262,7 @@ void LLPanelLogin::addFavoritesToStartLocation() // Load favorites into the combo. std::string user_defined_name = getChild("username_combo")->getSimple(); + std::replace(user_defined_name.begin(), user_defined_name.end(), '.', ' '); std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites.xml"); LLSD fav_llsd; llifstream file; -- cgit v1.2.3 From 4eeff34c6514160b3abefce35cee5f0e4e8cf1de Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Tue, 15 Apr 2014 10:54:15 +0300 Subject: MAINT-3931 FIXED Don't display any other check marks if Region Settings is selected. --- indra/newview/llviewermenu.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index ab9551ad17..e8759ee4ca 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -8242,9 +8242,9 @@ class LLWorldEnableEnvSettings : public view_listener_t bool result = false; std::string tod = userdata.asString(); - if (tod == "region") + if (LLEnvManagerNew::instance().getUseRegionSettings()) { - return LLEnvManagerNew::instance().getUseRegionSettings(); + return (tod == "region"); } if (LLEnvManagerNew::instance().getUseFixedSky()) -- cgit v1.2.3 From fd2a114d4ba0edb3bdfb73fff1e455be3ec079ed Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 14 Apr 2014 18:57:29 +0300 Subject: MAINT-1642 FIXED Viewer crashes on double-click on RegionCapabilityRequestError in Notifications Console --- indra/newview/llfloaternotificationsconsole.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llfloaternotificationsconsole.cpp b/indra/newview/llfloaternotificationsconsole.cpp index 4f35c325a8..e33f528c3b 100755 --- a/indra/newview/llfloaternotificationsconsole.cpp +++ b/indra/newview/llfloaternotificationsconsole.cpp @@ -41,6 +41,7 @@ class LLNotificationChannelPanel : public LLLayoutPanel { public: LLNotificationChannelPanel(const Params& p); + ~LLNotificationChannelPanel(); BOOL postBuild(); private: @@ -57,6 +58,20 @@ LLNotificationChannelPanel::LLNotificationChannelPanel(const LLNotificationChann buildFromFile( "panel_notifications_channel.xml"); } +LLNotificationChannelPanel::~LLNotificationChannelPanel() +{ + // Userdata for all records is a LLNotification* we need to clean up + std::vector data_list = getChild("notifications_list")->getAllData(); + std::vector::iterator data_itor; + for (data_itor = data_list.begin(); data_itor != data_list.end(); ++data_itor) + { + LLScrollListItem* item = *data_itor; + LLNotification* notification = (LLNotification*)item->getUserdata(); + delete notification; + notification = NULL; + } +} + BOOL LLNotificationChannelPanel::postBuild() { LLButton* header_button = getChild("header"); @@ -124,7 +139,7 @@ bool LLNotificationChannelPanel::update(const LLSD& payload) row["columns"][2]["type"] = "date"; LLScrollListItem* sli = getChild("notifications_list")->addElement(row); - sli->setUserdata(&(*notification)); + sli->setUserdata(new LLNotification(notification->asLLSD())); } return false; -- cgit v1.2.3 From 1a1ac2f9b84553ecd00430a82a8e73e373e9c885 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Tue, 22 Apr 2014 13:34:02 +0300 Subject: MAINT-3951 FIXED Exclude avatar's uuid before starting conference. --- indra/newview/llpanelpeoplemenus.cpp | 15 ++++++++++++++- indra/newview/llpanelpeoplemenus.h | 1 + 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llpanelpeoplemenus.cpp b/indra/newview/llpanelpeoplemenus.cpp index 6979ae06e0..a5f59dbf4a 100755 --- a/indra/newview/llpanelpeoplemenus.cpp +++ b/indra/newview/llpanelpeoplemenus.cpp @@ -90,7 +90,7 @@ LLContextMenu* PeopleContextMenu::createMenu() // Set up for multi-selected People // registrar.add("Avatar.AddFriend", boost::bind(&LLAvatarActions::requestFriendshipDialog, mUUIDs)); // *TODO: unimplemented - registrar.add("Avatar.IM", boost::bind(&LLAvatarActions::startConference, mUUIDs, LLUUID::null)); + registrar.add("Avatar.IM", boost::bind(&PeopleContextMenu::startConference, this)); registrar.add("Avatar.Call", boost::bind(&LLAvatarActions::startAdhocCall, mUUIDs, LLUUID::null)); registrar.add("Avatar.OfferTeleport", boost::bind(&PeopleContextMenu::offerTeleport, this)); registrar.add("Avatar.RemoveFriend", boost::bind(&LLAvatarActions::removeFriendsDialog, mUUIDs)); @@ -272,6 +272,19 @@ void PeopleContextMenu::offerTeleport() LLAvatarActions::offerTeleport(mUUIDs); } +void PeopleContextMenu::startConference() +{ + uuid_vec_t uuids; + for (uuid_vec_t::const_iterator it = mUUIDs.begin(); it != mUUIDs.end(); ++it) + { + if(*it != gAgentID) + { + uuids.push_back(*it); + } + } + LLAvatarActions::startConference(uuids); +} + //== NearbyPeopleContextMenu =============================================================== void NearbyPeopleContextMenu::buildContextMenu(class LLMenuGL& menu, U32 flags) diff --git a/indra/newview/llpanelpeoplemenus.h b/indra/newview/llpanelpeoplemenus.h index 945382ebc5..9767bab89f 100755 --- a/indra/newview/llpanelpeoplemenus.h +++ b/indra/newview/llpanelpeoplemenus.h @@ -47,6 +47,7 @@ private: bool enableContextMenuItem(const LLSD& userdata); bool checkContextMenuItem(const LLSD& userdata); void offerTeleport(); + void startConference(); void requestTeleport(); }; -- cgit v1.2.3 From 0e4e551df513c90afedf03f0cb8054df8e040e0f Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Tue, 22 Apr 2014 13:45:25 +0300 Subject: MAINT-3917 FIXED Don't stop updating self avatar even with disabled avatar rendering. --- indra/newview/llvoavatar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index c47b6d2335..baf396a818 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2058,7 +2058,7 @@ void LLVOAvatar::idleUpdate(LLAgent &agent, const F64 &time) } if (!(gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_AVATAR)) - && !(gSavedSettings.getBOOL("DisableAllRenderTypes"))) + && !(gSavedSettings.getBOOL("DisableAllRenderTypes")) && !isSelf()) { return; } -- cgit v1.2.3 From 29e0c3b18fe7dc504a898c7f50a372731a4fa291 Mon Sep 17 00:00:00 2001 From: andreylproductengine Date: Tue, 15 Apr 2014 15:10:06 +0300 Subject: MAINT-3891 FIXED Clearing saved URLs from media URLs list causes mouse cursor to spin constantly until relog. --- indra/newview/llfloaterurlentry.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloaterurlentry.cpp b/indra/newview/llfloaterurlentry.cpp index e85d849c9a..b8136d4a85 100755 --- a/indra/newview/llfloaterurlentry.cpp +++ b/indra/newview/llfloaterurlentry.cpp @@ -205,6 +205,10 @@ void LLFloaterURLEntry::onBtnOK( void* userdata ) LLURLHistory::addURL("parcel", media_url); } + // show progress bar here? + getWindow()->incBusyCount(); + self->getChildView("loading_label")->setVisible( true); + // leading whitespace causes problems with the MIME-type detection so strip it LLStringUtil::trim( media_url ); @@ -234,10 +238,6 @@ void LLFloaterURLEntry::onBtnOK( void* userdata ) self->getChildView("ok_btn")->setEnabled(false); self->getChildView("cancel_btn")->setEnabled(false); self->getChildView("media_entry")->setEnabled(false); - - // show progress bar here? - getWindow()->incBusyCount(); - self->getChildView("loading_label")->setVisible( true); } // static -- cgit v1.2.3 From 331663458fbf0a434701b1bb1dd15901eb1c20fe Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 22 Apr 2014 19:27:25 +0300 Subject: MAINT-1344 FIXED Attempting to move a folder or item, to another folder in a different inventory window found via inventory search, fails. --- indra/newview/llinventorybridge.cpp | 25 +++++++++++++++++++------ indra/newview/llinventoryfilter.cpp | 5 +++++ indra/newview/llinventoryfilter.h | 1 + 3 files changed, 25 insertions(+), 6 deletions(-) (limited to 'indra') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 75a4c22d33..00ae3e6afc 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2263,6 +2263,9 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, && (LLToolDragAndDrop::SOURCE_AGENT == source); BOOL accept = FALSE; + U64 filter_types = filter->getFilterTypes(); + BOOL use_filter = filter_types && (filter_types&LLInventoryFilter::FILTERTYPE_DATE || (filter_types&LLInventoryFilter::FILTERTYPE_OBJECT)==0); + if (is_agent_inventory) { const LLUUID &trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH, false); @@ -2461,7 +2464,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, is_movable = active_folder_view != NULL; } - if (is_movable) + if (is_movable && use_filter) { // Check whether the folder being dragged from active inventory panel // passes the filter of the destination panel. @@ -2635,6 +2638,12 @@ BOOL move_inv_category_world_to_agent(const LLUUID& object_id, BOOL accept = FALSE; BOOL is_move = FALSE; + BOOL use_filter = FALSE; + if (filter) + { + U64 filter_types = filter->getFilterTypes(); + use_filter = filter_types && (filter_types&LLInventoryFilter::FILTERTYPE_DATE || (filter_types&LLInventoryFilter::FILTERTYPE_OBJECT)==0); + } // coming from a task. Need to figure out if the person can // move/copy this item. @@ -2667,7 +2676,7 @@ BOOL move_inv_category_world_to_agent(const LLUUID& object_id, accept = TRUE; } - if (filter && accept) + if (accept && use_filter) { accept = filter->check(item); } @@ -3993,6 +4002,10 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, LLToolDragAndDrop::ESource source = LLToolDragAndDrop::getInstance()->getSource(); BOOL accept = FALSE; + U64 filter_types = filter->getFilterTypes(); + // We shouldn't allow to drop non recent items into recent tab (or some similar transactions) + // while we are allowing to interact with regular filtered inventory + BOOL use_filter = filter_types && (filter_types&LLInventoryFilter::FILTERTYPE_DATE || (filter_types&LLInventoryFilter::FILTERTYPE_OBJECT)==0); LLViewerObject* object = NULL; if(LLToolDragAndDrop::SOURCE_AGENT == source) { @@ -4091,7 +4104,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, // Check whether the item being dragged from active inventory panel // passes the filter of the destination panel. - if (accept && active_panel) + if (accept && active_panel && use_filter) { LLFolderViewItem* fv_item = active_panel->getItemByID(inv_item->getUUID()); if (!fv_item) return false; @@ -4229,7 +4242,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, // Check whether the item being dragged from in world // passes the filter of the destination panel. - if (accept) + if (accept && use_filter) { accept = filter->check(inv_item); } @@ -4273,7 +4286,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, // Check whether the item being dragged from notecard // passes the filter of the destination panel. - if (accept) + if (accept && use_filter) { accept = filter->check(inv_item); } @@ -4313,7 +4326,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, // Check whether the item being dragged from the library // passes the filter of the destination panel. - if (accept && active_panel) + if (accept && active_panel && use_filter) { LLFolderViewItem* fv_item = active_panel->getItemByID(inv_item->getUUID()); if (!fv_item) return false; diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index c314886f16..b941552f21 100755 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -985,6 +985,11 @@ void LLInventoryFilter::fromParams(const Params& params) setDateRangeLastLogoff(params.since_logoff); } +U64 LLInventoryFilter::getFilterTypes() const +{ + return mFilterOps.mFilterTypes; +} + U64 LLInventoryFilter::getFilterObjectTypes() const { return mFilterOps.mFilterObjectTypes; diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h index ce516af0b9..094fda7707 100755 --- a/indra/newview/llinventoryfilter.h +++ b/indra/newview/llinventoryfilter.h @@ -151,6 +151,7 @@ public: // +-------------------------------------------------------------------+ // + Parameters // +-------------------------------------------------------------------+ + U64 getFilterTypes() const; U64 getFilterObjectTypes() const; U64 getFilterCategoryTypes() const; U64 getFilterWearableTypes() const; -- cgit v1.2.3 From b1cffda8f3ac9ce95525ae926272c0ecbbc5b24e Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 23 Apr 2014 19:47:19 +0300 Subject: MAINT-2361 FIXED One and the same user shown in Allowed and in Banned Residents lists --- indra/llinventory/llparcel.cpp | 4 ---- indra/newview/llfloaterland.cpp | 24 ++++++++++++++++++------ 2 files changed, 18 insertions(+), 10 deletions(-) (limited to 'indra') diff --git a/indra/llinventory/llparcel.cpp b/indra/llinventory/llparcel.cpp index 5eb5fb442d..d6bfec5bec 100755 --- a/indra/llinventory/llparcel.cpp +++ b/indra/llinventory/llparcel.cpp @@ -793,8 +793,6 @@ BOOL LLParcel::addToAccessList(const LLUUID& agent_id, S32 time) } } - removeFromBanList(agent_id); - LLAccessEntry new_entry; new_entry.mID = agent_id; new_entry.mTime = time; @@ -838,8 +836,6 @@ BOOL LLParcel::addToBanList(const LLUUID& agent_id, S32 time) } } - removeFromAccessList(agent_id); - LLAccessEntry new_entry; new_entry.mID = agent_id; new_entry.mTime = time; diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index d79eee6be3..6b549b06de 100755 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -2776,10 +2776,16 @@ void LLPanelLandAccess::callbackAvatarCBAccess(const uuid_vec_t& ids) { LLUUID id = ids[0]; LLParcel* parcel = mParcel->getParcel(); - if (parcel) + if (parcel && parcel->addToAccessList(id, 0)) { - parcel->addToAccessList(id, 0); - LLViewerParcelMgr::getInstance()->sendParcelAccessListUpdate(AL_ACCESS); + U32 lists_to_update = AL_ACCESS; + // agent was successfully added to access list + // but we also need to check ban list to ensure that agent will not be in two lists simultaneously + if(parcel->removeFromBanList(id)) + { + lists_to_update |= AL_BAN; + } + LLViewerParcelMgr::getInstance()->sendParcelAccessListUpdate(lists_to_update); refresh(); } } @@ -2828,10 +2834,16 @@ void LLPanelLandAccess::callbackAvatarCBBanned(const uuid_vec_t& ids) { LLUUID id = ids[0]; LLParcel* parcel = mParcel->getParcel(); - if (parcel) + if (parcel && parcel->addToBanList(id, 0)) { - parcel->addToBanList(id, 0); - LLViewerParcelMgr::getInstance()->sendParcelAccessListUpdate(AL_BAN); + U32 lists_to_update = AL_BAN; + // agent was successfully added to ban list + // but we also need to check access list to ensure that agent will not be in two lists simultaneously + if (parcel->removeFromAccessList(id)) + { + lists_to_update |= AL_ACCESS; + } + LLViewerParcelMgr::getInstance()->sendParcelAccessListUpdate(lists_to_update); refresh(); } } -- cgit v1.2.3 From cd7e7e96030c2dffccc31e1c1e29f5ee608992e5 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Mon, 28 Apr 2014 11:48:11 +0300 Subject: MAINT-3957 FIXED Group owner issue --- indra/newview/llpanelgrouproles.cpp | 24 ++++++++++++++---------- indra/newview/llpanelgrouproles.h | 3 +++ 2 files changed, 17 insertions(+), 10 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index c30c932c41..160a0ee417 100755 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -1768,7 +1768,7 @@ LLPanelGroupRolesSubTab::LLPanelGroupRolesSubTab() mMemberVisibleCheck(NULL), mDeleteRoleButton(NULL), mCreateRoleButton(NULL), - + mFirstOpen(TRUE), mHasRoleChange(FALSE) { } @@ -1870,6 +1870,7 @@ void LLPanelGroupRolesSubTab::deactivate() lldebugs << "LLPanelGroupRolesSubTab::deactivate()" << llendl; LLPanelGroupSubTab::deactivate(); + mFirstOpen = FALSE; } bool LLPanelGroupRolesSubTab::needsApply(std::string& mesg) @@ -1887,7 +1888,7 @@ bool LLPanelGroupRolesSubTab::apply(std::string& mesg) lldebugs << "LLPanelGroupRolesSubTab::apply()" << llendl; saveRoleChanges(true); - + mFirstOpen = FALSE; LLGroupMgr::getInstance()->sendGroupRoleChanges(mGroupID); notifyObservers(); @@ -2024,14 +2025,17 @@ void LLPanelGroupRolesSubTab::update(LLGroupChange gc) } } - if (!gdatap || !gdatap->isMemberDataComplete()) + if(!mFirstOpen) { - LLGroupMgr::getInstance()->sendCapGroupMembersRequest(mGroupID); - } - - if (!gdatap || !gdatap->isRoleMemberDataComplete()) - { - LLGroupMgr::getInstance()->sendGroupRoleMembersRequest(mGroupID); + if (!gdatap || !gdatap->isMemberDataComplete()) + { + LLGroupMgr::getInstance()->sendCapGroupMembersRequest(mGroupID); + } + + if (!gdatap || !gdatap->isRoleMemberDataComplete()) + { + LLGroupMgr::getInstance()->sendGroupRoleMembersRequest(mGroupID); + } } if ((GC_ROLE_MEMBER_DATA == gc || GC_MEMBER_DATA == gc) @@ -2662,7 +2666,7 @@ void LLPanelGroupRoles::setGroupID(const LLUUID& id) if(mSubTabContainer) mSubTabContainer->selectTab(1); - + group_roles_tab->mFirstOpen = TRUE; activate(); } diff --git a/indra/newview/llpanelgrouproles.h b/indra/newview/llpanelgrouproles.h index 0cf272f3ee..71b1db5079 100755 --- a/indra/newview/llpanelgrouproles.h +++ b/indra/newview/llpanelgrouproles.h @@ -259,6 +259,9 @@ public: void saveRoleChanges(bool select_saved_role); virtual void setGroupID(const LLUUID& id); + + BOOL mFirstOpen; + protected: void handleActionCheck(LLUICtrl* ctrl, bool force); LLSD createRoleItem(const LLUUID& role_id, std::string name, std::string title, S32 members); -- cgit v1.2.3 From c283a94c0addc47468291c5b01c74d14daf81210 Mon Sep 17 00:00:00 2001 From: andreylproductengine Date: Tue, 29 Apr 2014 06:36:23 +0300 Subject: MAINT-3969 FIXED Animation problems when teleporting while sitting on some objects --- indra/newview/llagent.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 0582916362..1cc9b6a510 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -3822,6 +3822,12 @@ bool LLAgent::teleportCore(bool is_local) return false; } + // force stand up and stop a sitting animation (if any), see MAINT-3969 + if (isAgentAvatarValid() && gAgentAvatarp->getParent() && gAgentAvatarp->isSitting()) + { + gAgentAvatarp->getOffObject(); + } + #if 0 // This should not exist. It has been added, removed, added, and now removed again. // This change needs to come from the simulator. Otherwise, the agent ends up out of -- cgit v1.2.3 From 61f126c289f741265ec7a407c946bf26979255b9 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 25 Apr 2014 17:26:20 +0300 Subject: MAINT-2884 FIXED Empty menu item is presented in Type drop-down list in Media tab. --- indra/newview/skins/default/xui/en/mime_types.xml | 21 +++++++++++++++++++++ .../skins/default/xui/en/mime_types_linux.xml | 21 +++++++++++++++++++++ .../newview/skins/default/xui/en/mime_types_mac.xml | 21 +++++++++++++++++++++ 3 files changed, 63 insertions(+) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/mime_types.xml b/indra/newview/skins/default/xui/en/mime_types.xml index a585069faa..f5f2223330 100755 --- a/indra/newview/skins/default/xui/en/mime_types.xml +++ b/indra/newview/skins/default/xui/en/mime_types.xml @@ -101,6 +101,27 @@ true + + + + none/none + + + icn_media_web.tga + + + No media here + + + + false + + + false + + - + + +Unable to upload texture. +[REASON] + fail + + Date: Wed, 7 May 2014 13:58:05 +0300 Subject: MAINT-3940 FIXED Scrollbar not visible after conversation floater is resized --- indra/newview/skins/default/xui/en/floater_im_session.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/floater_im_session.xml b/indra/newview/skins/default/xui/en/floater_im_session.xml index 7076de55e3..bc72092f5f 100755 --- a/indra/newview/skins/default/xui/en/floater_im_session.xml +++ b/indra/newview/skins/default/xui/en/floater_im_session.xml @@ -210,7 +210,7 @@ default_tab_group="3" tab_group="2" name="right_part_holder" - min_width="230"> + min_width="207"> Date: Tue, 6 May 2014 17:21:18 +0300 Subject: MAINT-3977 FIXED Object does not display newly added contents if it was edited that session and you teleported to another region and back and then added new contents. --- indra/newview/llfloatertools.cpp | 3 +++ indra/newview/llpanelcontents.cpp | 7 +++++++ indra/newview/llpanelcontents.h | 1 + indra/newview/llpanelobjectinventory.cpp | 11 ++++++++--- indra/newview/llpanelobjectinventory.h | 1 + 5 files changed, 20 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index 802544089c..bbb95e0cc4 100755 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -888,6 +888,9 @@ void LLFloaterTools::onClose(bool app_quitting) // hide the advanced object weights floater LLFloaterReg::hideInstance("object_weights"); + + // prepare content for next call + mPanelContents->clearContents(); } void click_popup_info(void*) diff --git a/indra/newview/llpanelcontents.cpp b/indra/newview/llpanelcontents.cpp index 1a427338e5..5be796ea7a 100755 --- a/indra/newview/llpanelcontents.cpp +++ b/indra/newview/llpanelcontents.cpp @@ -141,6 +141,13 @@ void LLPanelContents::refresh() } } +void LLPanelContents::clearContents() +{ + if (mPanelInventoryObject) + { + mPanelInventoryObject->clearInventoryTask(); + } +} // diff --git a/indra/newview/llpanelcontents.h b/indra/newview/llpanelcontents.h index 62ccb64a4c..cf2c3af2a9 100755 --- a/indra/newview/llpanelcontents.h +++ b/indra/newview/llpanelcontents.h @@ -49,6 +49,7 @@ public: virtual ~LLPanelContents(); void refresh(); + void clearContents(); static void onClickNewScript(void*); diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index 6c9616511f..95472874ec 100755 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -1862,14 +1862,19 @@ void LLPanelObjectInventory::refresh() } if(!has_inventory) { - mTaskUUID = LLUUID::null; - removeVOInventoryListener(); - clearContents(); + clearInventoryTask(); } mInventoryViewModel.setTaskID(mTaskUUID); //llinfos << "LLPanelObjectInventory::refresh() " << mTaskUUID << llendl; } +void LLPanelObjectInventory::clearInventoryTask() +{ + mTaskUUID = LLUUID::null; + removeVOInventoryListener(); + clearContents(); +} + void LLPanelObjectInventory::removeSelectedItem() { if(mFolders) diff --git a/indra/newview/llpanelobjectinventory.h b/indra/newview/llpanelobjectinventory.h index 9559f7e886..3de49242ac 100755 --- a/indra/newview/llpanelobjectinventory.h +++ b/indra/newview/llpanelobjectinventory.h @@ -62,6 +62,7 @@ public: void refresh(); const LLUUID& getTaskUUID() { return mTaskUUID;} + void clearInventoryTask(); void removeSelectedItem(); void startRenamingSelectedItem(); -- cgit v1.2.3 From 80a134ffcc68b277c10cc79dc9c7ca073148b41e Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 7 May 2014 19:12:41 +0300 Subject: MAINT-3977 fixing line endings in llpanelcontents.cpp --- indra/newview/llpanelcontents.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpanelcontents.cpp b/indra/newview/llpanelcontents.cpp index 5be796ea7a..13ab7d7f27 100755 --- a/indra/newview/llpanelcontents.cpp +++ b/indra/newview/llpanelcontents.cpp @@ -141,12 +141,12 @@ void LLPanelContents::refresh() } } -void LLPanelContents::clearContents() -{ - if (mPanelInventoryObject) - { - mPanelInventoryObject->clearInventoryTask(); - } +void LLPanelContents::clearContents() +{ + if (mPanelInventoryObject) + { + mPanelInventoryObject->clearInventoryTask(); + } } -- cgit v1.2.3 From 794523d81d1ae6d83848dc4e2e4076c51bd66598 Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Thu, 8 May 2014 19:20:20 +0300 Subject: MAINT-3981 FIXED [SECURITY] Notecard being passed around that crashes any V3 based viewer when opened --- indra/newview/llviewertexteditor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index 69f9bbdff8..81a1d26e5e 100755 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -179,7 +179,7 @@ public: /*virtual*/ bool getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const { - if (num_chars == 0) + if (num_chars == 0 || !mImage) { width = 0; height = 0; -- cgit v1.2.3 From 06f5690100f8cd8aef01383adf0090a17ec4e515 Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Fri, 9 May 2014 05:14:02 +0300 Subject: Backed out changeset: d351efc87829 --- indra/newview/llviewertexteditor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index 81a1d26e5e..69f9bbdff8 100755 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -179,7 +179,7 @@ public: /*virtual*/ bool getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const { - if (num_chars == 0 || !mImage) + if (num_chars == 0) { width = 0; height = 0; -- cgit v1.2.3 From bcf4e288731f79f2c61aaa958189083c1d89011d Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Fri, 9 May 2014 05:15:54 +0300 Subject: MAINT-3981 FIXED [SECURITY] Notecard being passed around that crashes any V3 based viewer when opened. Correct fix after testing. --- indra/newview/llviewertexteditor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index 69f9bbdff8..0c4f55d704 100755 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -542,8 +542,8 @@ LLUIImagePtr LLEmbeddedItems::getItemImage(llwchar ext_char) const case LLAssetType::AT_BODYPART: img_name = "Inv_Skin"; break; case LLAssetType::AT_ANIMATION: img_name = "Inv_Animation"; break; case LLAssetType::AT_GESTURE: img_name = "Inv_Gesture"; break; - case LLAssetType::AT_MESH: img_name = "Inv_Mesh"; break; - default: llassert(0); + case LLAssetType::AT_MESH: img_name = "Inv_Mesh"; break; + default: img_name = "Inv_Invalid"; break; // use the Inv_Invalid icon for undefined object types (see MAINT-3981) } return LLUI::getUIImage(img_name); -- cgit v1.2.3 From ccb91c6da4078ce5d977203f297b0197983a543e Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Mon, 12 May 2014 11:52:39 +0300 Subject: MAINT-3963 FIXED The behavior of speak button in the conversations HUB and toolbar button is consistent now. Use setUserPTTState(false) to switch off the mic. --- indra/newview/llfloaterimcontainer.cpp | 15 ++++++++++++--- indra/newview/llfloaterimcontainer.h | 3 ++- indra/newview/llvoicechannel.cpp | 6 +++--- 3 files changed, 17 insertions(+), 7 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index a0df37b309..a4b91e47bb 100755 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -229,7 +229,9 @@ BOOL LLFloaterIMContainer::postBuild() mStubCollapseBtn = getChild("stub_collapse_btn"); mStubCollapseBtn->setClickedCallback(boost::bind(&LLFloaterIMContainer::onStubCollapseButtonClicked, this)); mSpeakBtn = getChild("speak_btn"); - mSpeakBtn->setClickedCallback(boost::bind(&LLFloaterIMContainer::onSpeakButtonClicked, this)); + + mSpeakBtn->setMouseDownCallback(boost::bind(&LLFloaterIMContainer::onSpeakButtonPressed, this)); + mSpeakBtn->setMouseUpCallback(boost::bind(&LLFloaterIMContainer::onSpeakButtonReleased, this)); childSetAction("add_btn", boost::bind(&LLFloaterIMContainer::onAddButtonClicked, this)); @@ -352,11 +354,18 @@ void LLFloaterIMContainer::onStubCollapseButtonClicked() collapseMessagesPane(true); } -void LLFloaterIMContainer::onSpeakButtonClicked() +void LLFloaterIMContainer::onSpeakButtonPressed() +{ + LLVoiceClient::getInstance()->inputUserControlState(true); + updateSpeakBtnState(); +} + +void LLFloaterIMContainer::onSpeakButtonReleased() { - LLAgent::toggleMicrophone("speak"); + LLVoiceClient::getInstance()->inputUserControlState(false); updateSpeakBtnState(); } + void LLFloaterIMContainer::onExpandCollapseButtonClicked() { if (mConversationsPane->isCollapsed() && mMessagesPane->isCollapsed() diff --git a/indra/newview/llfloaterimcontainer.h b/indra/newview/llfloaterimcontainer.h index f6d973b9b3..a3e10dc236 100755 --- a/indra/newview/llfloaterimcontainer.h +++ b/indra/newview/llfloaterimcontainer.h @@ -135,7 +135,8 @@ private: void onExpandCollapseButtonClicked(); void onStubCollapseButtonClicked(); void processParticipantsStyleUpdate(); - void onSpeakButtonClicked(); + void onSpeakButtonPressed(); + void onSpeakButtonReleased(); /*virtual*/ void onClickCloseBtn(bool app_quitting = false); /*virtual*/ void closeHostedFloater(); diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp index 312842a70f..48d056b358 100755 --- a/indra/newview/llvoicechannel.cpp +++ b/indra/newview/llvoicechannel.cpp @@ -273,14 +273,14 @@ void LLVoiceChannel::deactivate() if (callStarted()) { setState(STATE_HUNG_UP); - + //Default mic is OFF when leaving voice calls - if (gSavedSettings.getBOOL("AutoDisengageMic") && + if (gSavedSettings.getBOOL("AutoDisengageMic") && sCurrentVoiceChannel == this && LLVoiceClient::getInstance()->getUserPTTState()) { gSavedSettings.setBOOL("PTTCurrentlyEnabled", true); - LLVoiceClient::getInstance()->inputUserControlState(true); + LLVoiceClient::getInstance()->setUserPTTState(false); } } LLVoiceClient::getInstance()->removeObserver(this); -- cgit v1.2.3 From d2efc4ef39b9e1994afa5c3e84a5785969c9e7e8 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Tue, 13 May 2014 11:27:06 +0300 Subject: MAINT-4013 FIXED Debug setting which allows leaving Mouselook mode via S or Down Arrow keys was added. By default it's disabled. --- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/llviewerkeyboard.cpp | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 4bbd48facf..c2555efbb5 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -14246,6 +14246,17 @@ Value 0 + LeaveMouselook + + Comment + Exit Mouselook mode via S or Down Arrow keys while sitting + Persist + 1 + Type + Boolean + Value + 0 + TextureLoggingThreshold Comment diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp index 160478788c..b0f4802e20 100755 --- a/indra/newview/llviewerkeyboard.cpp +++ b/indra/newview/llviewerkeyboard.cpp @@ -162,7 +162,7 @@ void agent_push_backward( EKeystate s ) { camera_move_backward(s); } - else if (!gAgent.backwardGrabbed() && gAgentAvatarp->isSitting()) + else if (!gAgent.backwardGrabbed() && gAgentAvatarp->isSitting() && gSavedSettings.getBOOL("LeaveMouselook")) { gAgentCamera.changeCameraToThirdPerson(); } -- cgit v1.2.3 From 7fb4b417ce2048305eab6f1dbf51276697a94ff1 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Tue, 13 May 2014 12:37:26 +0300 Subject: MAINT-3942 FIXED missing entry on statistics floater. --- indra/newview/skins/default/xui/en/floater_stats.xml | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/floater_stats.xml b/indra/newview/skins/default/xui/en/floater_stats.xml index bee570d5d0..c9a6e1c9c3 100755 --- a/indra/newview/skins/default/xui/en/floater_stats.xml +++ b/indra/newview/skins/default/xui/en/floater_stats.xml @@ -267,7 +267,9 @@ stat="simsimskippedsilhouettesteps" unit_label="/sec"/> Date: Mon, 12 May 2014 20:01:20 +0300 Subject: MAINT-1734 FIXED Avatar chooser panel is empty the session after an avatar is chosen. --- indra/newview/llfloateravatar.cpp | 8 ++++++++ indra/newview/llmediactrl.cpp | 10 ++++++++++ indra/newview/llmediactrl.h | 1 + 3 files changed, 19 insertions(+) (limited to 'indra') diff --git a/indra/newview/llfloateravatar.cpp b/indra/newview/llfloateravatar.cpp index bdc5b581a9..31adf5b61e 100755 --- a/indra/newview/llfloateravatar.cpp +++ b/indra/newview/llfloateravatar.cpp @@ -34,6 +34,7 @@ #include "llfloateravatar.h" #include "lluictrlfactory.h" +#include "llmediactrl.h" LLFloaterAvatar::LLFloaterAvatar(const LLSD& key) @@ -43,6 +44,13 @@ LLFloaterAvatar::LLFloaterAvatar(const LLSD& key) LLFloaterAvatar::~LLFloaterAvatar() { + LLMediaCtrl* avatar_picker = findChild("avatar_picker_contents"); + if (avatar_picker) + { + avatar_picker->navigateStop(); + avatar_picker->clearCache(); //images are reloading each time already + avatar_picker->unloadMediaSource(); + } } BOOL LLFloaterAvatar::postBuild() diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 323445afa6..5490605c1b 100755 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -502,6 +502,16 @@ void LLMediaCtrl::navigateForward() } } +//////////////////////////////////////////////////////////////////////////////// +// +void LLMediaCtrl::navigateStop() +{ + if (mMediaSource && mMediaSource->hasMedia()) + { + mMediaSource->getMediaPlugin()->browse_stop(); + } +} + //////////////////////////////////////////////////////////////////////////////// // bool LLMediaCtrl::canNavigateBack() diff --git a/indra/newview/llmediactrl.h b/indra/newview/llmediactrl.h index 5978a7a344..086b384a72 100755 --- a/indra/newview/llmediactrl.h +++ b/indra/newview/llmediactrl.h @@ -99,6 +99,7 @@ public: void navigateBack(); void navigateHome(); void navigateForward(); + void navigateStop(); void navigateToLocalPage( const std::string& subdir, const std::string& filename_in ); bool canNavigateBack(); bool canNavigateForward(); -- cgit v1.2.3 From 8b86130f25a780b7dc623c6f7ff7a9cb6cf22ea1 Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Wed, 7 May 2014 18:42:24 +0300 Subject: MAINT-3967 FIXED Up arrow key does not move the cursor up in chat field. --- indra/llui/lltextbase.cpp | 29 +++++++++++++++++++---- indra/llui/lltextbase.h | 1 + indra/llui/lltexteditor.cpp | 56 ++++++++++++++++++++++++++++++++++++++++++--- 3 files changed, 79 insertions(+), 7 deletions(-) (limited to 'indra') diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 62edbadb07..183d6481c3 100755 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -225,7 +225,8 @@ LLTextBase::LLTextBase(const LLTextBase::Params &p) mParseHighlights(p.parse_highlights), mBGVisible(p.bg_visible), mScroller(NULL), - mStyleDirty(true) + mStyleDirty(true), + mDrawRightmostCursor(false) { if(p.allow_scroll) { @@ -1510,6 +1511,11 @@ void LLTextBase::reflow() // find and erase line info structs starting at start_index and going to end of document if (!mLineInfoList.empty()) { + if (mDrawRightmostCursor) + { + start_index--; + } + // find first element whose end comes after start_index line_list_t::iterator iter = std::upper_bound(mLineInfoList.begin(), mLineInfoList.end(), start_index, line_end_compare()); line_start_index = iter->mDocIndexStart; @@ -1698,6 +1704,11 @@ S32 LLTextBase::getLineNumFromDocIndex( S32 doc_index, bool include_wordwrap) co } else { + if (mDrawRightmostCursor) + { + doc_index--; + } + line_list_t::const_iterator iter = std::upper_bound(mLineInfoList.begin(), mLineInfoList.end(), doc_index, line_end_compare()); if (include_wordwrap) { @@ -1726,6 +1737,11 @@ S32 LLTextBase::getLineOffsetFromDocIndex( S32 startpos, bool include_wordwrap) } else { + if (mDrawRightmostCursor) + { + startpos--; + } + line_list_t::const_iterator iter = std::upper_bound(mLineInfoList.begin(), mLineInfoList.end(), startpos, line_end_compare()); return startpos - iter->mDocIndexStart; } @@ -2445,7 +2461,7 @@ S32 LLTextBase::getDocIndexFromLocalCoord( S32 local_x, S32 local_y, BOOL round, } else if (hit_past_end_of_line && segmentp->getEnd() >= line_iter->mDocIndexEnd) { - if (getLineNumFromDocIndex(line_iter->mDocIndexEnd - 1) == line_iter->mLineNum) + if (getLineNumFromDocIndex(line_iter->mDocIndexEnd - 1) == line_iter->mLineNum && !mDrawRightmostCursor) { // if segment wraps to the next line we should step one char back // to compensate for the space char between words @@ -2478,8 +2494,13 @@ LLRect LLTextBase::getDocRectFromDocIndex(S32 pos) const // clamp pos to valid values pos = llclamp(pos, 0, mLineInfoList.back().mDocIndexEnd - 1); - // find line that contains cursor - line_list_t::const_iterator line_iter = std::upper_bound(mLineInfoList.begin(), mLineInfoList.end(), pos, line_end_compare()); + S32 corrected_pos = pos; + if (mDrawRightmostCursor && pos > 0) + { + corrected_pos--; + } + + line_list_t::const_iterator line_iter = std::upper_bound(mLineInfoList.begin(), mLineInfoList.end(), corrected_pos, line_end_compare()); doc_rect.mLeft = line_iter->mRect.mLeft; doc_rect.mBottom = line_iter->mRect.mBottom; diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index d1f66b6cfe..51ab81bf29 100755 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -606,6 +606,7 @@ protected: // cursor S32 mCursorPos; // I-beam is just after the mCursorPos-th character. + bool mDrawRightmostCursor; // When cursor is on the rightmost position on the line S32 mDesiredXPixel; // X pixel position where the user wants the cursor to be LLFrameTimer mCursorBlinkTimer; // timer that controls cursor blinking diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index fbd742f615..6bb13516bf 100755 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -1135,8 +1135,14 @@ void LLTextEditor::addChar(llwchar wc) setCursorPos(new_cursor_pos); } } -} + if (mCursorPos > 0) + { + LLRect current_cursor_rect = getDocRectFromDocIndex(mCursorPos); + LLRect prev_cursor_rect = getDocRectFromDocIndex(mCursorPos - 1); + mDrawRightmostCursor = current_cursor_rect.mBottom < prev_cursor_rect.mBottom; + } +} void LLTextEditor::addLineBreakChar(BOOL group_together) { @@ -1282,6 +1288,12 @@ BOOL LLTextEditor::handleNavigationKey(const KEY key, const MASK mask) break; case KEY_HOME: + if(mDrawRightmostCursor && mCursorPos > 0) + { + mCursorPos--; + mDrawRightmostCursor = false; + } + startOfLine(); break; @@ -1296,6 +1308,14 @@ BOOL LLTextEditor::handleNavigationKey(const KEY key, const MASK mask) case KEY_END: endOfLine(); + if (!mDrawRightmostCursor) + { + mDrawRightmostCursor = true; + if (mCursorPos + 1 < getLength()) + { + setCursorPos(mCursorPos + 1); + } + } break; case KEY_LEFT: @@ -1307,7 +1327,18 @@ BOOL LLTextEditor::handleNavigationKey(const KEY key, const MASK mask) { if( 0 < mCursorPos ) { - setCursorPos(mCursorPos - 1); + LLRect current_cursor_rect = getDocRectFromDocIndex(mCursorPos); + LLRect next_cursor_rect = getDocRectFromDocIndex(mCursorPos - 1); + + if (current_cursor_rect.mBottom < next_cursor_rect.mBottom) + { + mDrawRightmostCursor = true; + } + else + { + mDrawRightmostCursor = false; + setCursorPos(mCursorPos - 1); + } } else { @@ -1325,7 +1356,26 @@ BOOL LLTextEditor::handleNavigationKey(const KEY key, const MASK mask) { if( mCursorPos < getLength() ) { - setCursorPos(mCursorPos + 1); + LLRect current_cursor_rect = getDocRectFromDocIndex(mCursorPos); + LLRect next_cursor_rect = getDocRectFromDocIndex(mCursorPos + 1); + + if (current_cursor_rect.mBottom > next_cursor_rect.mBottom) + { + if (mDrawRightmostCursor) + { + mDrawRightmostCursor = false; + } + else + { + mDrawRightmostCursor = true; + setCursorPos(mCursorPos + 1); + } + } + else + { + mDrawRightmostCursor = false; + setCursorPos(mCursorPos + 1); + } } else { -- cgit v1.2.3 From 98ad974a8eb3a9d5074beb80c5ce7c27a52c8fd2 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Wed, 14 May 2014 13:22:30 +0300 Subject: MAINT-2873 FIXED Newline is added to the end of XUI tool tip. --- indra/newview/llviewerwindow.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 4fae5c8e8e..5f4ad3081f 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -3194,6 +3194,8 @@ void LLViewerWindow::updateUI() } append_xui_tooltip(tooltip_view, params); + params.styled_message.add().text("\n"); + screen_sticky_rect.intersectWith(tooltip_view->calcScreenRect()); params.sticky_rect = screen_sticky_rect; -- cgit v1.2.3 From b392a8b659a3cd219918b29b06000d43767a6c7a Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Thu, 15 May 2014 12:10:31 +0300 Subject: MAINT-4022 FIXED Use gSnapshotFloaterView to close snapshot floater, and then pass focus on to normal floater view. --- indra/newview/llviewermenufile.cpp | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 04697f3472..9880ebf2db 100755 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -476,8 +476,10 @@ class LLFileEnableCloseWindow : public view_listener_t { bool handleEvent(const LLSD& userdata) { - bool new_value = NULL != gFloaterView->getFrontmostClosableFloater(); - return new_value; + bool frontmost_fl_exists = (NULL != gFloaterView->getFrontmostClosableFloater()); + bool frontmost_snapshot_fl_exists = (NULL != gSnapshotFloaterView->getFrontmostClosableFloater()); + + return frontmost_fl_exists || frontmost_snapshot_fl_exists; } }; @@ -485,7 +487,21 @@ class LLFileCloseWindow : public view_listener_t { bool handleEvent(const LLSD& userdata) { - LLFloater::closeFrontmostFloater(); + bool frontmost_fl_exists = (NULL != gFloaterView->getFrontmostClosableFloater()); + LLFloater* snapshot_floater = gSnapshotFloaterView->getFrontmostClosableFloater(); + + if(snapshot_floater && (!frontmost_fl_exists || snapshot_floater->hasFocus())) + { + snapshot_floater->closeFloater(); + if (gFocusMgr.getKeyboardFocus() == NULL) + { + gFloaterView->focusFrontFloater(); + } + } + else + { + LLFloater::closeFrontmostFloater(); + } return true; } }; -- cgit v1.2.3 From 50a3aa837a1a5a755f49f96bc0d068d382f6d370 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Thu, 15 May 2014 16:25:13 +0300 Subject: MAINT-145 FIXED Can not use ctrl+shift+b to close my Grid Option XUI --- indra/newview/skins/default/xui/en/menu_viewer.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index ec20c25f14..b1c1b236f0 100755 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -1207,7 +1207,7 @@ name="Grid Options" shortcut="control|shift|B"> -- cgit v1.2.3 From 704246c30f79a45535c43893422d990db141f541 Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Thu, 15 May 2014 16:26:58 -0700 Subject: MAINT-3440 FIX Viewer freezes and not responding after trying to open 5 new media browsers tabs directed to yahoo.com link --- indra/newview/llfloaterwebcontent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp index b8ea022810..640954a15f 100755 --- a/indra/newview/llfloaterwebcontent.cpp +++ b/indra/newview/llfloaterwebcontent.cpp @@ -294,7 +294,7 @@ void LLFloaterWebContent::onOpen(const LLSD& key) void LLFloaterWebContent::onClose(bool app_quitting) { // If we close the web browsing window showing the facebook login, we need to signal to this object that the connection will not happen - LLFloater* fbc_web = LLFloaterReg::getInstance("fbc_web"); + LLFloater* fbc_web = LLFloaterReg::findInstance("fbc_web"); if (fbc_web == this) { if (!LLFacebookConnect::instance().isConnected()) -- cgit v1.2.3 From 1c82f376c2368f8f91627b3a45b2d6900d938ff4 Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Fri, 16 May 2014 19:58:05 +0300 Subject: MAINT-4032 FIXED Sounds played locally play from avatar position, not camera position. --- indra/newview/llpreviewsound.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpreviewsound.cpp b/indra/newview/llpreviewsound.cpp index 11b81a58fc..105c5e8cbe 100755 --- a/indra/newview/llpreviewsound.cpp +++ b/indra/newview/llpreviewsound.cpp @@ -95,7 +95,6 @@ void LLPreviewSound::auditionSound( void *userdata ) if(item && gAudiop) { - LLVector3d lpos_global = gAgent.getPositionGlobal(); - gAudiop->triggerSound(item->getAssetUUID(), gAgent.getID(), SOUND_GAIN, LLAudioEngine::AUDIO_TYPE_SFX, lpos_global); + gAudiop->triggerSound(item->getAssetUUID(), gAgent.getID(), SOUND_GAIN, LLAudioEngine::AUDIO_TYPE_SFX); } } -- cgit v1.2.3 From 16a5c9346d04f20c536e9034947873f1202eb32e Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Tue, 20 May 2014 11:34:24 +0300 Subject: MAINT-3064 FIXED Select next session in the list if selected session is nearby chat and it's not the only one. --- indra/newview/llviewermenu.cpp | 23 ++++++++++++++++++++++ indra/newview/skins/default/xui/en/menu_viewer.xml | 12 ++++++----- 2 files changed, 30 insertions(+), 5 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 1daa85176a..aef8bc21ec 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -64,6 +64,7 @@ #include "llfloaterinventory.h" #include "llfloaterimcontainer.h" #include "llfloaterland.h" +#include "llfloaterimnearbychat.h" #include "llfloaterpathfindingcharacters.h" #include "llfloaterpathfindinglinksets.h" #include "llfloaterpay.h" @@ -5660,6 +5661,25 @@ void toggle_debug_menus(void*) // gExportDialog = LLUploadDialog::modalUploadDialog("Exporting selected objects..."); // } // + +class LLCommunicateNearbyChat : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLFloaterIMContainer* im_box = LLFloaterIMContainer::getInstance(); + bool nearby_visible = LLFloaterReg::getTypedInstance("nearby_chat")->isInVisibleChain(); + if(nearby_visible && im_box->getSelectedSession() == LLUUID() && im_box->getConversationListItemSize() > 1) + { + im_box->selectNextorPreviousConversation(false); + } + else + { + LLFloaterReg::toggleInstanceOrBringToFront("nearby_chat"); + } + return true; + } +}; + class LLWorldSetHomeLocation : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -8577,6 +8597,9 @@ void initialize_menus() // Me > Movement view_listener_t::addMenu(new LLAdvancedAgentFlyingInfo(), "Agent.getFlying"); + //Communicate Nearby chat + view_listener_t::addMenu(new LLCommunicateNearbyChat(), "Communicate.NearbyChat"); + // Communicate > Voice morphing > Subscribe... commit.add("Communicate.VoiceMorphing.Subscribe", boost::bind(&handle_voice_morphing_subscribe)); LLVivoxVoiceClient * voice_clientp = LLVivoxVoiceClient::getInstance(); diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index b1c1b236f0..acec017622 100755 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -259,8 +259,7 @@ function="Floater.Visible" parameter="nearby_chat" /> + function="Communicate.NearbyChat"/> - - + - + Date: Tue, 20 May 2014 14:07:23 -0700 Subject: MAINT-3950 FIXED can't open lag meter brought back llfloaterlagmeter from the dead, and ported to lltrace --- indra/newview/CMakeLists.txt | 2 + indra/newview/llfloaterlagmeter.cpp | 378 +++++++++++++++++++++ indra/newview/llfloaterlagmeter.h | 80 +++++ indra/newview/lltextureview.cpp | 2 +- indra/newview/llviewerfloaterreg.cpp | 2 + indra/newview/llviewertexture.cpp | 12 +- indra/newview/llviewertexture.h | 2 +- .../skins/default/xui/da/floater_lagmeter.xml | 151 ++++++++ .../skins/default/xui/de/floater_lagmeter.xml | 151 ++++++++ .../skins/default/xui/en/floater_lagmeter.xml | 336 ++++++++++++++++++ .../skins/default/xui/es/floater_lagmeter.xml | 154 +++++++++ .../skins/default/xui/fr/floater_lagmeter.xml | 151 ++++++++ .../skins/default/xui/it/floater_lagmeter.xml | 154 +++++++++ .../skins/default/xui/ja/floater_lagmeter.xml | 151 ++++++++ .../skins/default/xui/pl/floater_lagmeter.xml | 151 ++++++++ .../skins/default/xui/pt/floater_lagmeter.xml | 154 +++++++++ .../skins/default/xui/ru/floater_lagmeter.xml | 151 ++++++++ .../skins/default/xui/tr/floater_lagmeter.xml | 151 ++++++++ .../skins/default/xui/zh/floater_lagmeter.xml | 151 ++++++++ 19 files changed, 2476 insertions(+), 8 deletions(-) create mode 100644 indra/newview/llfloaterlagmeter.cpp create mode 100644 indra/newview/llfloaterlagmeter.h create mode 100644 indra/newview/skins/default/xui/da/floater_lagmeter.xml create mode 100644 indra/newview/skins/default/xui/de/floater_lagmeter.xml create mode 100644 indra/newview/skins/default/xui/en/floater_lagmeter.xml create mode 100644 indra/newview/skins/default/xui/es/floater_lagmeter.xml create mode 100644 indra/newview/skins/default/xui/fr/floater_lagmeter.xml create mode 100644 indra/newview/skins/default/xui/it/floater_lagmeter.xml create mode 100644 indra/newview/skins/default/xui/ja/floater_lagmeter.xml create mode 100644 indra/newview/skins/default/xui/pl/floater_lagmeter.xml create mode 100644 indra/newview/skins/default/xui/pt/floater_lagmeter.xml create mode 100644 indra/newview/skins/default/xui/ru/floater_lagmeter.xml create mode 100644 indra/newview/skins/default/xui/tr/floater_lagmeter.xml create mode 100644 indra/newview/skins/default/xui/zh/floater_lagmeter.xml (limited to 'indra') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index c94969435b..cf584048f9 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -245,6 +245,7 @@ set(viewer_SOURCE_FILES llfloaterinspect.cpp llfloaterinventory.cpp llfloaterjoystick.cpp + llfloaterlagmeter.cpp llfloaterland.cpp llfloaterlandholdings.cpp llfloatermap.cpp @@ -839,6 +840,7 @@ set(viewer_HEADER_FILES llfloaterinspect.h llfloaterinventory.h llfloaterjoystick.h + llfloaterlagmeter.h llfloaterland.h llfloaterlandholdings.h llfloatermap.h diff --git a/indra/newview/llfloaterlagmeter.cpp b/indra/newview/llfloaterlagmeter.cpp new file mode 100644 index 0000000000..f72f2631a1 --- /dev/null +++ b/indra/newview/llfloaterlagmeter.cpp @@ -0,0 +1,378 @@ +/** + * @file llfloaterlagmeter.cpp + * @brief The "Lag-o-Meter" floater used to tell users what is causing lag. + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llfloaterlagmeter.h" + +#include "lluictrlfactory.h" +#include "llviewerstats.h" +#include "llviewertexture.h" +#include "llviewercontrol.h" +#include "llappviewer.h" + +#include "lltexturefetch.h" + +#include "llbutton.h" +#include "llfocusmgr.h" +#include "lltextbox.h" + +const std::string LAG_CRITICAL_IMAGE_NAME = "lag_status_critical.tga"; +const std::string LAG_WARNING_IMAGE_NAME = "lag_status_warning.tga"; +const std::string LAG_GOOD_IMAGE_NAME = "lag_status_good.tga"; + +LLFloaterLagMeter::LLFloaterLagMeter(const LLSD& key) + : LLFloater(key) +{ + mCommitCallbackRegistrar.add("LagMeter.ClickShrink", boost::bind(&LLFloaterLagMeter::onClickShrink, this)); +} + +BOOL LLFloaterLagMeter::postBuild() +{ + // Don't let this window take keyboard focus -- it's confusing to + // lose arrow-key driving when testing lag. + setIsChrome(TRUE); + + // were we shrunk last time? + if (isShrunk()) + { + onClickShrink(); + } + + mClientButton = getChild("client_lagmeter"); + mClientText = getChild("client_text"); + mClientCause = getChild("client_lag_cause"); + + mNetworkButton = getChild("network_lagmeter"); + mNetworkText = getChild("network_text"); + mNetworkCause = getChild("network_lag_cause"); + + mServerButton = getChild("server_lagmeter"); + mServerText = getChild("server_text"); + mServerCause = getChild("server_lag_cause"); + + std::string config_string = getString("client_frame_rate_critical_fps", mStringArgs); + mClientFrameTimeCritical = F32Seconds(1.0f / (float)atof( config_string.c_str() )); + config_string = getString("client_frame_rate_warning_fps", mStringArgs); + mClientFrameTimeWarning = F32Seconds(1.0f / (float)atof( config_string.c_str() )); + + config_string = getString("network_packet_loss_critical_pct", mStringArgs); + mNetworkPacketLossCritical = F32Percent((float)atof( config_string.c_str() )); + config_string = getString("network_packet_loss_warning_pct", mStringArgs); + mNetworkPacketLossWarning = F32Percent((float)atof( config_string.c_str() )); + + config_string = getString("network_ping_critical_ms", mStringArgs); + mNetworkPingCritical = F32Milliseconds((float)atof( config_string.c_str() )); + config_string = getString("network_ping_warning_ms", mStringArgs); + mNetworkPingWarning = F32Milliseconds((float)atof( config_string.c_str() )); + config_string = getString("server_frame_rate_critical_fps", mStringArgs); + + mServerFrameTimeCritical = F32Seconds(1.0f / (float)atof( config_string.c_str() )); + config_string = getString("server_frame_rate_warning_fps", mStringArgs); + mServerFrameTimeWarning = F32Seconds(1.0f / (float)atof( config_string.c_str() )); + config_string = getString("server_single_process_max_time_ms", mStringArgs); + mServerSingleProcessMaxTime = F32Seconds((float)atof( config_string.c_str() )); + +// mShrunk = false; + config_string = getString("max_width_px", mStringArgs); + mMaxWidth = atoi( config_string.c_str() ); + config_string = getString("min_width_px", mStringArgs); + mMinWidth = atoi( config_string.c_str() ); + + mStringArgs["[CLIENT_FRAME_RATE_CRITICAL]"] = getString("client_frame_rate_critical_fps"); + mStringArgs["[CLIENT_FRAME_RATE_WARNING]"] = getString("client_frame_rate_warning_fps"); + + mStringArgs["[NETWORK_PACKET_LOSS_CRITICAL]"] = getString("network_packet_loss_critical_pct"); + mStringArgs["[NETWORK_PACKET_LOSS_WARNING]"] = getString("network_packet_loss_warning_pct"); + + mStringArgs["[NETWORK_PING_CRITICAL]"] = getString("network_ping_critical_ms"); + mStringArgs["[NETWORK_PING_WARNING]"] = getString("network_ping_warning_ms"); + + mStringArgs["[SERVER_FRAME_RATE_CRITICAL]"] = getString("server_frame_rate_critical_fps"); + mStringArgs["[SERVER_FRAME_RATE_WARNING]"] = getString("server_frame_rate_warning_fps"); + +// childSetAction("minimize", onClickShrink, this); + updateControls(isShrunk()); // if expanded append colon to the labels (EXT-4079) + + return TRUE; +} +LLFloaterLagMeter::~LLFloaterLagMeter() +{ + // save shrunk status for next time +// gSavedSettings.setBOOL("LagMeterShrunk", mShrunk); + // expand so we save the large window rectangle + if (isShrunk()) + { + onClickShrink(); + } +} + +void LLFloaterLagMeter::draw() +{ + determineClient(); + determineNetwork(); + determineServer(); + + LLFloater::draw(); +} + +void LLFloaterLagMeter::determineClient() +{ + F32Milliseconds client_frame_time = LLTrace::get_frame_recording().getPeriodMean(LLStatViewer::FRAME_STACKTIME); + bool find_cause = false; + + if (!gFocusMgr.getAppHasFocus()) + { + mClientButton->setImageUnselected(LLUI::getUIImage(LAG_GOOD_IMAGE_NAME)); + mClientText->setText( getString("client_frame_time_window_bg_msg", mStringArgs) ); + mClientCause->setText( LLStringUtil::null ); + } + else if(client_frame_time >= mClientFrameTimeCritical) + { + mClientButton->setImageUnselected(LLUI::getUIImage(LAG_CRITICAL_IMAGE_NAME)); + mClientText->setText( getString("client_frame_time_critical_msg", mStringArgs) ); + find_cause = true; + } + else if(client_frame_time >= mClientFrameTimeWarning) + { + mClientButton->setImageUnselected(LLUI::getUIImage(LAG_WARNING_IMAGE_NAME)); + mClientText->setText( getString("client_frame_time_warning_msg", mStringArgs) ); + find_cause = true; + } + else + { + mClientButton->setImageUnselected(LLUI::getUIImage(LAG_GOOD_IMAGE_NAME)); + mClientText->setText( getString("client_frame_time_normal_msg", mStringArgs) ); + mClientCause->setText( LLStringUtil::null ); + } + + if(find_cause) + { + if(gSavedSettings.getF32("RenderFarClip") > 128) + { + mClientCause->setText( getString("client_draw_distance_cause_msg", mStringArgs) ); + } + else if(LLAppViewer::instance()->getTextureFetch()->getNumRequests() > 2) + { + mClientCause->setText( getString("client_texture_loading_cause_msg", mStringArgs) ); + } + else if(LLViewerTexture::sBoundTextureMemory > LLViewerTexture::sMaxBoundTextureMemory) + { + mClientCause->setText( getString("client_texture_memory_cause_msg", mStringArgs) ); + } + else + { + mClientCause->setText( getString("client_complex_objects_cause_msg", mStringArgs) ); + } + } +} + +void LLFloaterLagMeter::determineNetwork() +{ + LLTrace::PeriodicRecording& frame_recording = LLTrace::get_frame_recording(); + F32Percent packet_loss = frame_recording.getPeriodMean(LLStatViewer::PACKETS_LOST_PERCENT); + F32Milliseconds ping_time = frame_recording.getPeriodMean(LLStatViewer::SIM_PING); + bool find_cause_loss = false; + bool find_cause_ping = false; + + // *FIXME: We can't blame a large ping time on anything in + // particular if the frame rate is low, because a low frame + // rate is a sure recipe for bad ping times right now until + // the network handlers are de-synched from the rendering. + F32Milliseconds client_frame_time = frame_recording.getPeriodMean(LLStatViewer::FRAME_STACKTIME); + + if(packet_loss >= mNetworkPacketLossCritical) + { + mNetworkButton->setImageUnselected(LLUI::getUIImage(LAG_CRITICAL_IMAGE_NAME)); + mNetworkText->setText( getString("network_packet_loss_critical_msg", mStringArgs) ); + find_cause_loss = true; + } + else if(ping_time >= mNetworkPingCritical) + { + mNetworkButton->setImageUnselected(LLUI::getUIImage(LAG_CRITICAL_IMAGE_NAME)); + if (client_frame_time < mNetworkPingCritical) + { + mNetworkText->setText( getString("network_ping_critical_msg", mStringArgs) ); + find_cause_ping = true; + } + } + else if(packet_loss >= mNetworkPacketLossWarning) + { + mNetworkButton->setImageUnselected(LLUI::getUIImage(LAG_WARNING_IMAGE_NAME)); + mNetworkText->setText( getString("network_packet_loss_warning_msg", mStringArgs) ); + find_cause_loss = true; + } + else if(ping_time >= mNetworkPingWarning) + { + mNetworkButton->setImageUnselected(LLUI::getUIImage(LAG_WARNING_IMAGE_NAME)); + if (client_frame_time < mNetworkPingWarning) + { + mNetworkText->setText( getString("network_ping_warning_msg", mStringArgs) ); + find_cause_ping = true; + } + } + else + { + mNetworkButton->setImageUnselected(LLUI::getUIImage(LAG_GOOD_IMAGE_NAME)); + mNetworkText->setText( getString("network_performance_normal_msg", mStringArgs) ); + } + + if(find_cause_loss) + { + mNetworkCause->setText( getString("network_packet_loss_cause_msg", mStringArgs) ); + } + else if(find_cause_ping) + { + mNetworkCause->setText( getString("network_ping_cause_msg", mStringArgs) ); + } + else + { + mNetworkCause->setText( LLStringUtil::null ); + } +} + +void LLFloaterLagMeter::determineServer() +{ + F32Milliseconds sim_frame_time = LLTrace::get_frame_recording().getLastRecording().getLastValue(LLStatViewer::SIM_FRAME_TIME); + bool find_cause = false; + + if(sim_frame_time >= mServerFrameTimeCritical) + { + mServerButton->setImageUnselected(LLUI::getUIImage(LAG_CRITICAL_IMAGE_NAME)); + mServerText->setText( getString("server_frame_time_critical_msg", mStringArgs) ); + find_cause = true; + } + else if(sim_frame_time >= mServerFrameTimeWarning) + { + mServerButton->setImageUnselected(LLUI::getUIImage(LAG_WARNING_IMAGE_NAME)); + mServerText->setText( getString("server_frame_time_warning_msg", mStringArgs) ); + find_cause = true; + } + else + { + mServerButton->setImageUnselected(LLUI::getUIImage(LAG_GOOD_IMAGE_NAME)); + mServerText->setText( getString("server_frame_time_normal_msg", mStringArgs) ); + mServerCause->setText( LLStringUtil::null ); + } + + if(find_cause) + { + LLTrace::Recording& last_recording = LLTrace::get_frame_recording().getLastRecording(); + + if(last_recording.getLastValue(LLStatViewer::SIM_PHYSICS_TIME) > mServerSingleProcessMaxTime) + { + mServerCause->setText( getString("server_physics_cause_msg", mStringArgs) ); + } + else if(last_recording.getLastValue(LLStatViewer::SIM_SCRIPTS_TIME) > mServerSingleProcessMaxTime) + { + mServerCause->setText( getString("server_scripts_cause_msg", mStringArgs) ); + } + else if(last_recording.getLastValue(LLStatViewer::SIM_NET_TIME) > mServerSingleProcessMaxTime) + { + mServerCause->setText( getString("server_net_cause_msg", mStringArgs) ); + } + else if(last_recording.getLastValue(LLStatViewer::SIM_AGENTS_TIME) > mServerSingleProcessMaxTime) + { + mServerCause->setText( getString("server_agent_cause_msg", mStringArgs) ); + } + else if(last_recording.getLastValue(LLStatViewer::SIM_IMAGES_TIME) > mServerSingleProcessMaxTime) + { + mServerCause->setText( getString("server_images_cause_msg", mStringArgs) ); + } + else + { + mServerCause->setText( getString("server_generic_cause_msg", mStringArgs) ); + } + } +} + +void LLFloaterLagMeter::updateControls(bool shrink) +{ +// LLFloaterLagMeter * self = (LLFloaterLagMeter*)data; + + LLButton * button = getChild("minimize"); + S32 delta_width = mMaxWidth -mMinWidth; + LLRect r = getRect(); + + if(!shrink) + { + setTitle(getString("max_title_msg", mStringArgs) ); + // make left edge appear to expand + r.translate(-delta_width, 0); + setRect(r); + reshape(mMaxWidth, getRect().getHeight()); + + getChild("client")->setValue(getString("client_text_msg", mStringArgs) + ":"); + getChild("network")->setValue(getString("network_text_msg",mStringArgs) + ":"); + getChild("server")->setValue(getString("server_text_msg", mStringArgs) + ":"); + + // usually "<<" + button->setLabel( getString("smaller_label", mStringArgs) ); + } + else + { + setTitle( getString("min_title_msg", mStringArgs) ); + // make left edge appear to collapse + r.translate(delta_width, 0); + setRect(r); + reshape(mMinWidth, getRect().getHeight()); + + getChild("client")->setValue(getString("client_text_msg", mStringArgs) ); + getChild("network")->setValue(getString("network_text_msg",mStringArgs) ); + getChild("server")->setValue(getString("server_text_msg", mStringArgs) ); + + // usually ">>" + button->setLabel( getString("bigger_label", mStringArgs) ); + } + // Don't put keyboard focus on the button + button->setFocus(FALSE); + +// self->mClientText->setVisible(self->mShrunk); +// self->mClientCause->setVisible(self->mShrunk); +// self->getChildView("client_help")->setVisible( self->mShrunk); + +// self->mNetworkText->setVisible(self->mShrunk); +// self->mNetworkCause->setVisible(self->mShrunk); +// self->getChildView("network_help")->setVisible( self->mShrunk); + +// self->mServerText->setVisible(self->mShrunk); +// self->mServerCause->setVisible(self->mShrunk); +// self->getChildView("server_help")->setVisible( self->mShrunk); + +// self->mShrunk = !self->mShrunk; +} + +BOOL LLFloaterLagMeter::isShrunk() +{ + return gSavedSettings.getBOOL("LagMeterShrunk"); +} + +void LLFloaterLagMeter::onClickShrink() // toggle "LagMeterShrunk" +{ + bool shrunk = isShrunk(); + updateControls(!shrunk); + gSavedSettings.setBOOL("LagMeterShrunk", !shrunk); +} diff --git a/indra/newview/llfloaterlagmeter.h b/indra/newview/llfloaterlagmeter.h new file mode 100644 index 0000000000..929ea40629 --- /dev/null +++ b/indra/newview/llfloaterlagmeter.h @@ -0,0 +1,80 @@ +/** + * @file llfloaterlagmeter.h + * @brief The "Lag-o-Meter" floater used to tell users what is causing lag. + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LLFLOATERLAGMETER_H +#define LLFLOATERLAGMETER_H + +#include "llfloater.h" + +class LLTextBox; + +class LLFloaterLagMeter : public LLFloater +{ + friend class LLFloaterReg; + +public: + /*virtual*/ void draw(); + /*virtual*/ BOOL postBuild(); +private: + + LLFloaterLagMeter(const LLSD& key); + /*virtual*/ ~LLFloaterLagMeter(); + void determineClient(); + void determineNetwork(); + void determineServer(); + void updateControls(bool shrink); + BOOL isShrunk(); + + void onClickShrink(); + + bool mShrunk; + S32 mMaxWidth, mMinWidth; + + F32Milliseconds mClientFrameTimeCritical; + F32Milliseconds mClientFrameTimeWarning; + LLButton* mClientButton; + LLTextBox* mClientText; + LLTextBox* mClientCause; + + F32Percent mNetworkPacketLossCritical; + F32Percent mNetworkPacketLossWarning; + F32Milliseconds mNetworkPingCritical; + F32Milliseconds mNetworkPingWarning; + LLButton* mNetworkButton; + LLTextBox* mNetworkText; + LLTextBox* mNetworkCause; + + F32Milliseconds mServerFrameTimeCritical; + F32Milliseconds mServerFrameTimeWarning; + F32Milliseconds mServerSingleProcessMaxTime; + LLButton* mServerButton; + LLTextBox* mServerText; + LLTextBox* mServerCause; + + LLStringUtil::format_map_t mStringArgs; +}; + +#endif diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp index 8ee83b5df0..d464b57b4a 100755 --- a/indra/newview/lltextureview.cpp +++ b/indra/newview/lltextureview.cpp @@ -509,7 +509,7 @@ private: void LLGLTexMemBar::draw() { S32Megabytes bound_mem = LLViewerTexture::sBoundTextureMemory; - S32Megabytes max_bound_mem = LLViewerTexture::sMaxBoundTextureMem; + S32Megabytes max_bound_mem = LLViewerTexture::sMaxBoundTextureMemory; S32Megabytes total_mem = LLViewerTexture::sTotalTextureMemory; S32Megabytes max_total_mem = LLViewerTexture::sMaxTotalTextureMem; F32 discard_bias = LLViewerTexture::sDesiredDiscardBias; diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index e427bb1735..55aeed68cc 100755 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -73,6 +73,7 @@ #include "llfloaterinspect.h" #include "llfloaterinventory.h" #include "llfloaterjoystick.h" +#include "llfloaterlagmeter.h" #include "llfloaterland.h" #include "llfloaterlandholdings.h" #include "llfloatermap.h" @@ -233,6 +234,7 @@ void LLViewerFloaterReg::registerFloaters() LLNotificationsUI::registerFloater(); LLFloaterDisplayNameUtil::registerFloater(); + LLFloaterReg::add("lagmeter", "floater_lagmeter.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("land_holdings", "floater_land_holdings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("mem_leaking", "floater_mem_leaking.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 3be82a5531..b83697b2f1 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -88,7 +88,7 @@ F32 LLViewerTexture::sDesiredDiscardBias = 0.f; F32 LLViewerTexture::sDesiredDiscardScale = 1.1f; S32Bytes LLViewerTexture::sBoundTextureMemory; S32Bytes LLViewerTexture::sTotalTextureMemory; -S32Megabytes LLViewerTexture::sMaxBoundTextureMem; +S32Megabytes LLViewerTexture::sMaxBoundTextureMemory; S32Megabytes LLViewerTexture::sMaxTotalTextureMem; S32Bytes LLViewerTexture::sMaxDesiredTextureMem; S8 LLViewerTexture::sCameraMovingDiscardBias = 0; @@ -534,11 +534,11 @@ void LLViewerTexture::updateClass(const F32 velocity, const F32 angular_velocity sBoundTextureMemory = LLImageGL::sBoundTextureMemory; sTotalTextureMemory = LLImageGL::sGlobalTextureMemory; - sMaxBoundTextureMem = gTextureList.getMaxResidentTexMem(); + sMaxBoundTextureMemory = gTextureList.getMaxResidentTexMem(); sMaxTotalTextureMem = gTextureList.getMaxTotalTextureMem(); sMaxDesiredTextureMem = sMaxTotalTextureMem; //in Bytes, by default and when total used texture memory is small. - if (sBoundTextureMemory >= sMaxBoundTextureMem || + if (sBoundTextureMemory >= sMaxBoundTextureMemory || sTotalTextureMemory >= sMaxTotalTextureMem) { //when texture memory overflows, lower down the threshold to release the textures more aggressively. @@ -558,7 +558,7 @@ void LLViewerTexture::updateClass(const F32 velocity, const F32 angular_velocity sEvaluationTimer.reset(); } else if (sDesiredDiscardBias > 0.0f && - sBoundTextureMemory < sMaxBoundTextureMem * texmem_lower_bound_scale && + sBoundTextureMemory < sMaxBoundTextureMemory * texmem_lower_bound_scale && sTotalTextureMemory < sMaxTotalTextureMem * texmem_lower_bound_scale) { // If we are using less texture memory than we should, @@ -576,7 +576,7 @@ void LLViewerTexture::updateClass(const F32 velocity, const F32 angular_velocity sCameraMovingBias = llmax(0.2f * camera_moving_speed, 2.0f * camera_angular_speed - 1); sCameraMovingDiscardBias = (S8)(sCameraMovingBias); - LLViewerTexture::sFreezeImageScalingDown = (sBoundTextureMemory < 0.75f * sMaxBoundTextureMem * texmem_middle_bound_scale) && + LLViewerTexture::sFreezeImageScalingDown = (sBoundTextureMemory < 0.75f * sMaxBoundTextureMemory * texmem_middle_bound_scale) && (sTotalTextureMemory < 0.75f * sMaxTotalTextureMem * texmem_middle_bound_scale); } @@ -2962,7 +2962,7 @@ void LLViewerLODTexture::processTextureStats() scaleDown(); } // Limit the amount of GL memory bound each frame - else if ( sBoundTextureMemory > sMaxBoundTextureMem * texmem_middle_bound_scale && + else if ( sBoundTextureMemory > sMaxBoundTextureMemory * texmem_middle_bound_scale && (!getBoundRecently() || mDesiredDiscardLevel >= mCachedRawDiscardLevel)) { scaleDown(); diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index b12b988513..302cc8302a 100755 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -207,7 +207,7 @@ public: static F32 sDesiredDiscardScale; static S32Bytes sBoundTextureMemory; static S32Bytes sTotalTextureMemory; - static S32Megabytes sMaxBoundTextureMem; + static S32Megabytes sMaxBoundTextureMemory; static S32Megabytes sMaxTotalTextureMem; static S32Bytes sMaxDesiredTextureMem ; static S8 sCameraMovingDiscardBias; diff --git a/indra/newview/skins/default/xui/da/floater_lagmeter.xml b/indra/newview/skins/default/xui/da/floater_lagmeter.xml new file mode 100644 index 0000000000..149d174c34 --- /dev/null +++ b/indra/newview/skins/default/xui/da/floater_lagmeter.xml @@ -0,0 +1,151 @@ + + + + Lag måler + + + 360 + + + Lag + + + 90 + + + Klient + + + 10 + + + 15 + + + Normal, vindue i baggrund + + + Klients billeder/sek under [CLIENT_FRAME_RATE_CRITICAL] + + + Klients billeder/sek mellem [CLIENT_FRAME_RATE_CRITICAL] og [CLIENT_FRAME_RATE_WARNING] + + + Normal + + + Mulig årsag: 'Vis afstand' sat for højt i grafik indstillinger + + + Mulig årsag: Billeder hentes + + + Mulig årsag: For mange billeder i hukommelse + + + Mulig årsag: For mange komplekse objekter i scenariet + + + Netværk + + + 10 + + + 5 + + + Forbindelsen mister over [NETWORK_PACKET_LOSS_CRITICAL]% pakker + + + Forbindelsen mister [NETWORK_PACKET_LOSS_WARNING]%-[NETWORK_PACKET_LOSS_CRITICAL]% pakker + + + Normal + + + 600 + + + 300 + + + Forbindelsens ping tider er over [NETWORK_PING_CRITICAL] ms + + + Forbindelsens ping tider er [NETWORK_PING_WARNING]-[NETWORK_PING_CRITICAL] ms + + + Muligvis dårlig forbindelse eller 'båndbredde' sat for højt i netværksopsætning. + + + Muligvis dårlig forbindelse eller fil delings program. + + + Server + + + 20 + + + 30 + + + 20 + + + Simulator framerate er under [SERVER_FRAME_RATE_CRITICAL] + + + Simulator framerate er mellem [SERVER_FRAME_RATE_CRITICAL] og [SERVER_FRAME_RATE_WARNING] + + + Normal + + + Mulig årsag: For mange fysiske objekter + + + Mulig årsag: For mange objekter med script + + + Mulig årsag: For meget netværks trafik + + + Mulig årsag: For mange avatarer i bevægelse i regionen + + + Mulig årsag: For mange billed udregninger + + + Mulig årsag: Simulator belastning for stor + + + >> + + + << + + + diff --git a/indra/newview/skins/default/xui/es/floater_lagmeter.xml b/indra/newview/skins/default/xui/es/floater_lagmeter.xml new file mode 100644 index 0000000000..227689a194 --- /dev/null +++ b/indra/newview/skins/default/xui/es/floater_lagmeter.xml @@ -0,0 +1,154 @@ + + + + Medidor del lag + + + 360 + + + Lag + + + 90 + + + Cliente + + + 10 + + + 15 + + + Normal, ventana en segundo plano + + + Frames del cliente valorados por debajo de [CLIENT_FRAME_RATE_CRITICAL] + + + Frames del cliente valorados entre [CLIENT_FRAME_RATE_CRITICAL] y [CLIENT_FRAME_RATE_WARNING] + + + Normal + + + Posible causa: distancia de dibujo fijada muy alta + + + Posible causa: imágenes cargándose + + + Posible causa: demasiadas imágenes en la memoria + + + Posible causa: demasiados objetos complejos en la escena + + + Red + + + 10 + + + 5 + + + La conexión deja caer más del [NETWORK_PACKET_LOSS_CRITICAL]% de los paquetes + + + La conexión deja caer [NETWORK_PACKET_LOSS_WARNING]%-[NETWORK_PACKET_LOSS_CRITICAL]% de los paquetes + + + Normal + + + 600 + + + 300 + + + El tiempo de conexión -ping- supera los [NETWORK_PING_CRITICAL] ms + + + El tiempo de conexión -ping- es de [NETWORK_PING_WARNING]-[NETWORK_PING_CRITICAL] ms + + + Quizá una mala conexión o un ancho de banda fijado demasiado alto. + + + Quizá una mala conexión o una aplicación de archivos compartidos. + + + Servidor + + + 20 + + + 30 + + + 20 + + + Frecuencia (framerate) por debajo de [SERVER_FRAME_RATE_CRITICAL] + + + Frecuencia (framerate) entre [SERVER_FRAME_RATE_CRITICAL] y [SERVER_FRAME_RATE_WARNING] + + + Normal + + + Posible causa: demasiados objetos físicos + + + Posible causa: demasiados objetos con script + + + Posible causa: demasiado tráfico en la red + + + Posible causa: demasiada gente moviéndose en la región + + + Posible causa: demasiados cálculos de imáganes + + + Posible causa: carga del simulador muy pesada + + + >> + + + << + + -- cgit v1.2.3