diff options
Diffstat (limited to 'indra/newview')
33 files changed, 390 insertions, 271 deletions
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/llavataractions.cpp b/indra/newview/llavataractions.cpp index 307e72fe18..54b9336d93 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 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<LLFolderViewItem*> selectedItems = mConversationsRoot->getSelectionList(); + LLConversationItem * conversationItem; + for(std::set<LLFolderViewItem*>::const_iterator it = selectedItems.begin(); it != selectedItems.end(); ++it) + { + conversationItem = static_cast<LLConversationItem *>((*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; @@ -1376,6 +1392,10 @@ bool LLFloaterIMContainer::enableContextMenuItem(const std::string& item, uuid_v { return LLAvatarActions::canCall(); } + else if ("can_open_voice_conversation" == item) + { + return is_single_select && LLAvatarActions::canCall(); + } else if ("can_zoom_in" == item) { return is_single_select && gObjectList.findObject(single_id); 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<LLScrollListItem*> data_list = getChild<LLScrollListCtrl>("notifications_list")->getAllData(); + std::vector<LLScrollListItem*>::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<LLButton>("header"); @@ -124,7 +139,7 @@ bool LLNotificationChannelPanel::update(const LLSD& payload) row["columns"][2]["type"] = "date"; LLScrollListItem* sli = getChild<LLScrollListCtrl>("notifications_list")->addElement(row); - sli->setUserdata(&(*notification)); + sli->setUserdata(new LLNotification(notification->asLLSD())); } return false; 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<LLPanel>(sMainPanelName)->onOpen(key); } -void LLFloaterSidePanelContainer::onClickCloseBtn(bool) +void LLFloaterSidePanelContainer::closeFloater(bool app_quitting) { LLPanelOutfitEdit* panel_outfit_edit = dynamic_cast<LLPanelOutfitEdit*>(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/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); } diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index b666331a2c..c314886f16 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; } 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; } 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 cca8b905f3..cc28f52b0b 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,74 +1602,47 @@ 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 = (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_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) { // 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); @@ -1654,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.02f; + } + else + { + arrow_size = 0.01f * dist_vec(snap_line_center, LLViewerCamera::getInstance()->getOrigin()); + } + + // draw snap guide arrow gGL.begin(LLRender::TRIANGLES); { @@ -1665,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(); } @@ -1686,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); @@ -1722,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); @@ -1757,31 +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))); - F32 distance = (drag_point - mScaleCenter) * mScaleDir; - (void) distance; - 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)); @@ -1790,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)); @@ -1837,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; diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index 0621cc8fad..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) @@ -950,7 +948,7 @@ void LLPanelEditWearable::onCommitSexChange() gAgentAvatarp->updateSexDependentLayerSets( FALSE ); gAgentAvatarp->updateVisualParams(); - + showWearable(mWearablePtr, TRUE, TRUE); updateScrollingPanelUI(); } 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; 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<LLComboBox>("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; 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 { 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; 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); 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()) 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; 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(); 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 ) 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()) 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 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<LLParcelObserver*> mObservers; BOOL mTeleportInProgress; + LLVector3d mTeleportInProgressPosition; teleport_finished_signal_t mTeleportFinishedSignal; teleport_failed_signal_t mTeleportFailedSignal; 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 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" 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"> <on_click function="Avatar.DoToSelected" parameter="open_voice_conversation"/> + <on_enable function="Avatar.EnableItem" parameter="can_open_voice_conversation"/> </menu_item_call> <menu_item_call label="Disconnect from voice" |