diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 6038e5623394c5383eadb2752368244e4c50f5fb..147e7a291a6a0259741dd7fc35e844f78add0f07 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -2668,7 +2668,7 @@ void LLAgent::handlePreferredMaturityResult(U8 pServerMaturity) { mMaturityPreferenceNumRetries = 0; reportPreferredMaturitySuccess(); - llassert(static_cast<U8>(gSavedSettings.getU32("PreferredMaturity")) == mLastKnownResponseMaturity); + llassert(static_cast<U8>(ALControlCache::PreferredMaturity) == mLastKnownResponseMaturity); } // Else, the viewer is out of sync with the server, so let's try to re-sync with the // server by re-sending our last known request. Cap the re-tries at 3 just to be safe. @@ -2752,7 +2752,7 @@ void LLAgent::reportPreferredMaturityError() // Check the saved settings to ensure that we are consistent. If we are not consistent, update // the viewer, but do not send anything to server - U8 localMaturity = static_cast<U8>(gSavedSettings.getU32("PreferredMaturity")); + U8 localMaturity = static_cast<U8>(ALControlCache::PreferredMaturity); if (localMaturity != mLastKnownResponseMaturity) { bool tmpIsDoSendMaturityPreferenceToServer = mIsDoSendMaturityPreferenceToServer; diff --git a/indra/newview/llagentaccess.cpp b/indra/newview/llagentaccess.cpp index c4ee321e04f926e2f2c9b5e1f4bd2cb5ac38052f..b567d2bae82989ac58f1f82982998b5b288e7bdc 100644 --- a/indra/newview/llagentaccess.cpp +++ b/indra/newview/llagentaccess.cpp @@ -27,7 +27,7 @@ #include "llagentaccess.h" #include "indra_constants.h" -#include "llcontrol.h" +#include "llviewercontrol.h" LLAgentAccess::LLAgentAccess(LLControlGroup& savedSettings) : mSavedSettings(savedSettings), @@ -101,19 +101,19 @@ bool LLAgentAccess::canAccessAdult() const bool LLAgentAccess::prefersPG() const { - U32 access = mSavedSettings.getU32("PreferredMaturity"); + U32 access = ALControlCache::PreferredMaturity; return access < SIM_ACCESS_MATURE; } bool LLAgentAccess::prefersMature() const { - U32 access = mSavedSettings.getU32("PreferredMaturity"); + U32 access = ALControlCache::PreferredMaturity; return access >= SIM_ACCESS_MATURE; } bool LLAgentAccess::prefersAdult() const { - U32 access = mSavedSettings.getU32("PreferredMaturity"); + U32 access = ALControlCache::PreferredMaturity; return access >= SIM_ACCESS_ADULT; } diff --git a/indra/newview/llfloaterimnearbychathandler.cpp b/indra/newview/llfloaterimnearbychathandler.cpp index 9c06a28086ac65439ee5f9cffc52eda755c831ac..53e3bf27151c84f4b5ff6205389d4ab3b5b405dd 100644 --- a/indra/newview/llfloaterimnearbychathandler.cpp +++ b/indra/newview/llfloaterimnearbychathandler.cpp @@ -297,7 +297,7 @@ void LLFloaterIMNearbyChatScreenChannel::addChat(LLSD& chat) } LLRect channel_rect; mFloaterSnapRegion->localRectToOtherView(mFloaterSnapRegion->getLocalRect(), &channel_rect, gFloaterView); - chat["available_height"] = channel_rect.getHeight() - channel_rect.mBottom - gSavedSettings.getS32("ToastGap") - 110;; + chat["available_height"] = channel_rect.getHeight() - channel_rect.mBottom - ALControlCache::ToastGap - 110;; /* find last toast and check ID @@ -405,7 +405,7 @@ void LLFloaterIMNearbyChatScreenChannel::arrangeToasts() S32 channel_bottom = channel_rect.mBottom; S32 bottom = channel_bottom + 80; - S32 margin = gSavedSettings.getS32("ToastGap"); + S32 margin = ALControlCache::ToastGap; //sort active toasts std::sort(m_active_toasts.begin(),m_active_toasts.end(),sort_toasts_predicate); diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index 692094746eb2de4b670b6a6910bc5412b0263ca0..0e5f252910c23283c9deccf233ef778763e630a4 100644 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -139,7 +139,7 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask) gGL.matrixMode(LLRender::MM_PROJECTION); gGL.pushMatrix(); - BOOL limit_select_distance = gSavedSettings.getBOOL("LimitSelectDistance"); + BOOL limit_select_distance = ALControlCache::LimitSelectDistance; if (limit_select_distance) { // ...select distance from control diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp index d662f6c5cf0d9971e50b3ebb8875252f99bc4c2e..619c8d8ae0a5fdea34f8e4e0a1156d2ed8af0477 100644 --- a/indra/newview/lllocationinputctrl.cpp +++ b/indra/newview/lllocationinputctrl.cpp @@ -607,8 +607,7 @@ void LLLocationInputCtrl::draw() refreshLocation(); } - static LLUICachedControl<bool> show_icons("NavBarShowParcelProperties", false); - if (show_icons) + if (ALControlCache::NavBarShowParcelProperties) { refreshHealth(); } @@ -858,7 +857,7 @@ void LLLocationInputCtrl::refreshParcelIcons() x = layout_widget(mForSaleBtn, x); - if (gSavedSettings.getBOOL("NavBarShowParcelProperties")) + if (ALControlCache::NavBarShowParcelProperties) { LLParcel* current_parcel; LLViewerRegion* selection_region = vpm->getSelectionRegion(); diff --git a/indra/newview/llmanip.cpp b/indra/newview/llmanip.cpp index 6589aa477ff45971a8b1d2835d35d83d060a8c10..4843821215e7957ae657ff4c99b3cb2aa6b90a14 100644 --- a/indra/newview/llmanip.cpp +++ b/indra/newview/llmanip.cpp @@ -593,7 +593,7 @@ LLColor4 LLManip::setupSnapGuideRenderPass(S32 pass) static LLColor4 grid_color_shadow = LLUIColorTable::instance().getColor("GridlineShadowColor"); LLColor4 line_color; - F32 line_alpha = gSavedSettings.getF32("GridOpacity"); + F32 line_alpha = ALControlCache::GridOpacity; switch(pass) { diff --git a/indra/newview/llmaniprotate.cpp b/indra/newview/llmaniprotate.cpp index f158aae3d2a5fe1922cee511ac39c2712e67b59c..ed4e0fee3d17a8e0d1dcf0b99c906de0ce9df389 100644 --- a/indra/newview/llmaniprotate.cpp +++ b/indra/newview/llmaniprotate.cpp @@ -747,8 +747,7 @@ void LLManipRotate::renderActiveRing( F32 radius, F32 width, const LLColor4& fro void LLManipRotate::renderSnapGuides() { - static LLCachedControl<bool> snap_enabled(gSavedSettings, "SnapEnabled", true); - if (!snap_enabled) + if (!ALControlCache::SnapEnabled) { return; } @@ -1126,7 +1125,7 @@ void LLManipRotate::renderSnapGuides() LLVector3 offset_dir = LLViewerCamera::getInstance()->getUpAxis(); - F32 line_alpha = gSavedSettings.getF32("GridOpacity"); + F32 line_alpha = ALControlCache::GridOpacity; LLVector3 help_text_pos = selection_center_start + (mRadiusMeters * 3.f * offset_dir); const LLFontGL* big_fontp = LLFontGL::getFontSansSerif(); @@ -1196,7 +1195,7 @@ BOOL LLManipRotate::updateVisiblity() F32 z_dist = -1.f * (mCenterToCam * cameraAtAxis); // Don't drag manip if object too far away - if (gSavedSettings.getBOOL("LimitSelectDistance")) + if (ALControlCache::LimitSelectDistance) { F32 max_select_distance = gSavedSettings.getF32("MaxSelectDistance"); if (dist_vec_squared(gAgent.getPositionAgent(), center) > (max_select_distance * max_select_distance)) @@ -1410,7 +1409,7 @@ LLQuaternion LLManipRotate::dragConstrained( S32 x, S32 y ) BOOL hit = getMousePointOnPlaneAgent(projected_mouse, x, y, snap_plane_center, constraint_axis); projected_mouse -= snap_plane_center; - if (gSavedSettings.getBOOL("SnapEnabled")) { + if (ALControlCache::SnapEnabled) { S32 snap_plane = 0; F32 dot = cam_to_snap_plane * constraint_axis; @@ -1601,7 +1600,7 @@ LLQuaternion LLManipRotate::dragConstrained( S32 x, S32 y ) return LLQuaternion::DEFAULT; } - if (gSavedSettings.getBOOL("SnapEnabled") && projected_mouse.magVec() > SNAP_GUIDE_INNER_RADIUS * mRadiusMeters) + if (ALControlCache::SnapEnabled && projected_mouse.magVec() > SNAP_GUIDE_INNER_RADIUS * mRadiusMeters) { if (!mInSnapRegime) { @@ -1928,7 +1927,7 @@ BOOL LLManipRotate::canAffectSelection() LLViewerObject *root_object = (objectp == NULL) ? NULL : objectp->getRootEdit(); return objectp->permMove() && !objectp->isPermanentEnforced() && ((root_object == NULL) || !root_object->isPermanentEnforced()) && - (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts")); + (objectp->permModify() || !ALControlCache::EditLinkedParts); } } func; can_rotate = mObjectSelection->applyToObjects(&func); diff --git a/indra/newview/llmanipscale.cpp b/indra/newview/llmanipscale.cpp index 9a8222d9412eb36b9e72f9f3e1827303138bb88d..0d6a6e3644298ecf035e50aba5d3cd71c57fe97d 100644 --- a/indra/newview/llmanipscale.cpp +++ b/indra/newview/llmanipscale.cpp @@ -249,7 +249,7 @@ void LLManipScale::render() F32 range_from_agent_squared = dist_vec_squared(gAgent.getPositionAgent(), manipulator_pos); // Don't draw manip if object too far away - if (gSavedSettings.getBOOL("LimitSelectDistance")) + if (ALControlCache::LimitSelectDistance) { F32 max_select_distance = gSavedSettings.getF32("MaxSelectDistance"); if (range_from_agent_squared > max_select_distance * max_select_distance) @@ -877,7 +877,7 @@ 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"); + BOOL snap_enabled = ALControlCache::SnapEnabled; if (snap_enabled && (mouse_on_plane1 - projected_drag_pos1) * mSnapGuideDir1 > mSnapRegimeOffset) { F32 drag_dist = mScaleDir * projected_drag_pos1; // Projecting the drag position allows for negative results, vs using the length which will result in a "reverse scaling" bug. @@ -1088,7 +1088,7 @@ void LLManipScale::dragFace( S32 x, S32 y ) F32 dist_from_scale_line = dist_vec(scale_center_to_mouse, (mouse_on_scale_line - mScaleCenter)); F32 dist_along_scale_line = scale_center_to_mouse * mScaleDir; - BOOL snap_enabled = gSavedSettings.getBOOL("SnapEnabled"); + BOOL snap_enabled = ALControlCache::SnapEnabled; if (snap_enabled && dist_from_scale_line > mSnapRegimeOffset) { @@ -1186,7 +1186,7 @@ void LLManipScale::sendUpdates( BOOL send_position_update, BOOL send_scale_updat mLastUpdateFlags = update_flags; // enforce minimum update delay and don't stream updates on sub-object selections - if( elapsed_time > UPDATE_DELAY && !gSavedSettings.getBOOL("EditLinkedParts") ) + if( elapsed_time > UPDATE_DELAY && !ALControlCache::EditLinkedParts ) { LLSelectMgr::getInstance()->sendMultipleUpdate( update_flags ); update_timer.reset(); @@ -1552,12 +1552,12 @@ void LLManipScale::updateSnapGuides(const LLBBox& bbox) void LLManipScale::renderSnapGuides(const LLBBox& bbox) { - if (!gSavedSettings.getBOOL("SnapEnabled")) + if (!ALControlCache::SnapEnabled) { return; } - F32 grid_alpha = gSavedSettings.getF32("GridOpacity"); + F32 grid_alpha = ALControlCache::GridOpacity; F32 max_point_on_scale_line = partToMaxScale(mManipPart, bbox); LLVector3 drag_point = gAgent.getPosAgentFromGlobal(mDragPointGlobal); @@ -1746,7 +1746,7 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) 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); + F32 grid_resolution = mObjectSelection->getSelectType() == SELECT_TYPE_HUD ? 0.25f : llmax<F32>(ALControlCache::GridResolution, 0.001f); S32 label_sub_div_offset_1 = ll_round(fmod(dist_grid_axis - grid_offset1, mScaleSnapUnit1 * 32.f) / smallest_subdivision1); S32 label_sub_div_offset_2 = ll_round(fmod(dist_grid_axis - grid_offset2, mScaleSnapUnit2 * 32.f) / smallest_subdivision2); diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp index 11b51ba6f61946d66854c090ac7fae5cccc1ec4a..a0edbdf38b252e25b2c53111d12d5a35ded6a91f 100644 --- a/indra/newview/llmaniptranslate.cpp +++ b/indra/newview/llmaniptranslate.cpp @@ -546,7 +546,7 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask) getMousePointOnPlaneGlobal(cursor_point_snap_line, x, y, current_pos_global, mSnapOffsetAxis % axis_f); off_axis_magnitude = axis_exists ? llabs((cursor_point_snap_line - current_pos_global) * LLVector3d(mSnapOffsetAxis)) : 0.f; - if (gSavedSettings.getBOOL("SnapEnabled")) + if (ALControlCache::SnapEnabled) { if (off_axis_magnitude > mSnapOffsetMeters) { @@ -1074,13 +1074,13 @@ void LLManipTranslate::render() void LLManipTranslate::renderSnapGuides() { - if (!gSavedSettings.getBOOL("SnapEnabled")) + if (!ALControlCache::SnapEnabled) { return; } F32 max_subdivisions = sGridMaxSubdivisionLevel;//(F32)gSavedSettings.getS32("GridSubdivision"); - F32 line_alpha = gSavedSettings.getF32("GridOpacity"); + F32 line_alpha = ALControlCache::GridOpacity; gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); LLGLDepthTest gls_depth(GL_TRUE); @@ -1840,7 +1840,7 @@ void LLManipTranslate::renderTranslationHandles() F32 range_from_agent = dist_vec(gAgent.getPositionAgent(), selection_center); // Don't draw handles if you're too far away - if (gSavedSettings.getBOOL("LimitSelectDistance")) + if (ALControlCache::LimitSelectDistance) { if (range_from_agent > gSavedSettings.getF32("MaxSelectDistance")) { @@ -1866,7 +1866,7 @@ void LLManipTranslate::renderTranslationHandles() mArrowLengthMeters *= ui_scale_factor; mPlaneManipOffsetMeters = mArrowLengthMeters * 1.8f; - mGridSizeMeters = gSavedSettings.getF32("GridDrawSize"); + mGridSizeMeters = ALControlCache::GridDrawSize; mConeSize = mArrowLengthMeters / 4.f; gGL.matrixMode(LLRender::MM_MODELVIEW); @@ -2300,7 +2300,7 @@ BOOL LLManipTranslate::canAffectSelection() LLViewerObject *root_object = (objectp == NULL) ? NULL : objectp->getRootEdit(); return objectp->permMove() && !objectp->isPermanentEnforced() && ((root_object == NULL) || !root_object->isPermanentEnforced()) && - (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts")); + (objectp->permModify() || !ALControlCache::EditLinkedParts); } } func; can_move = mObjectSelection->applyToObjects(&func); diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index 832b6db0332c574ff7eb7c7733ee84974b561b0c..4abad8dda2d2edd4962308943beef77b87c7e6bc 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -1584,7 +1584,7 @@ void LLPanelObject::sendRotation(BOOL btn_down) // To include avatars into movements and rotation // If false, all children are selected anyway - move avatar // If true, not all children are selected - save positions - bool individual_selection = gSavedSettings.getBOOL("EditLinkedParts"); + bool individual_selection = ALControlCache::EditLinkedParts; std::vector<LLVector3>& child_positions = mObject->mUnselectedChildrenPositions ; std::vector<LLQuaternion> child_rotations; if (mObject->isRootEdit() && individual_selection) diff --git a/indra/newview/llpaneltopinfobar.cpp b/indra/newview/llpaneltopinfobar.cpp index b0dafe5a1195a396592fcb24bcfbeea7530f414f..5d2d33aa7b4ccd92e37756ebba71dac39484582c 100644 --- a/indra/newview/llpaneltopinfobar.cpp +++ b/indra/newview/llpaneltopinfobar.cpp @@ -287,7 +287,7 @@ void LLPanelTopInfoBar::updateParcelIcons() if (!agent_region || !agent_parcel) return; - if (gSavedSettings.getBOOL("NavBarShowParcelProperties")) + if (ALControlCache::NavBarShowParcelProperties) { LLParcel* current_parcel; LLViewerRegion* selection_region = vpm->getSelectionRegion(); @@ -340,10 +340,8 @@ void LLPanelTopInfoBar::updateParcelIcons() void LLPanelTopInfoBar::updateHealth() { - static LLUICachedControl<bool> show_icons("NavBarShowParcelProperties", false); - // *FIXME: Status bar owns health information, should be in agent - if (show_icons && gStatusBar) + if (ALControlCache::NavBarShowParcelProperties && gStatusBar) { static S32 last_health = -1; S32 health = gStatusBar->getHealth(); diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp index 852766b0cde883a115638edbea1c9f5f7c3620a2..be8aa6ea733c7b2b91df78d95aac2626ab4830c6 100644 --- a/indra/newview/llscreenchannel.cpp +++ b/indra/newview/llscreenchannel.cpp @@ -628,7 +628,7 @@ void LLScreenChannel::showToastsBottom() } bottom = toast->getRect().mTop - toast->getTopPad(); - toast_margin = gSavedSettings.getS32("ToastGap"); + toast_margin = ALControlCache::ToastGap; } LLToast* toast = it->getToast(); @@ -671,7 +671,7 @@ void LLScreenChannel::showToastsBottom() { if( it != vToastList.rend()-1) { - S32 toast_top = toast->getRect().mTop + gSavedSettings.getS32("ToastGap"); + S32 toast_top = toast->getRect().mTop + ALControlCache::ToastGap; stop_showing_toasts = toast_top > getRect().mTop; } } @@ -740,7 +740,7 @@ void LLScreenChannel::showToastsCentre() } toast_rect = toast->getRect(); - toast_rect.setLeftTopAndSize(getRect().mLeft - toast_rect.getWidth() / 2, bottom + toast_rect.getHeight() / 2 + gSavedSettings.getS32("ToastGap"), toast_rect.getWidth() ,toast_rect.getHeight()); + toast_rect.setLeftTopAndSize(getRect().mLeft - toast_rect.getWidth() / 2, bottom + toast_rect.getHeight() / 2 + ALControlCache::ToastGap, toast_rect.getWidth() ,toast_rect.getHeight()); toast->setRect(toast_rect); toast->setVisible(TRUE); @@ -776,7 +776,6 @@ void LLScreenChannel::showToastsTop() } top = toast->getRect().mBottom - toast->getTopPad(); - gSavedSettings.getS32("ToastGap"); } LLToast* toast = it->getToast(); @@ -819,7 +818,7 @@ void LLScreenChannel::showToastsTop() { if( it != vToastList.rend()-1) { - S32 toast_bottom = toast->getRect().mBottom - gSavedSettings.getS32("ToastGap"); + S32 toast_bottom = toast->getRect().mBottom - ALControlCache::ToastGap; stop_showing_toasts = toast_bottom < channel_rect.mBottom; } } @@ -902,7 +901,7 @@ void LLScreenChannel::createStartUpToast(S32 notif_num, F32 timer) text_box->reshapeToFitText(); text_box->setOrigin(text_box->getRect().mLeft, (wrapper_panel->getRect().getHeight() - text_box->getRect().getHeight())/2); - toast_rect.setLeftTopAndSize(0, getRect().getHeight() - gSavedSettings.getS32("ToastGap"), getRect().getWidth(), toast_rect.getHeight()); + toast_rect.setLeftTopAndSize(0, getRect().getHeight() - ALControlCache::ToastGap, getRect().getWidth(), toast_rect.getHeight()); mStartUpToastPanel->setRect(toast_rect); addChild(mStartUpToastPanel); diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index fe45467b8a44f5d1b02d9196dd2cbcd0fc52235d..ba19a5d8b1655b384666320e415790e1e8027e62 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -464,7 +464,7 @@ LLObjectSelectionHandle LLSelectMgr::selectObjectAndFamily(LLViewerObject* obj, root->resetRot(); // leave component mode - if (gSavedSettings.getBOOL("EditLinkedParts")) + if (ALControlCache::EditLinkedParts) { gSavedSettings.setBOOL("EditLinkedParts", FALSE); promoteSelectionToRoot(); @@ -534,7 +534,7 @@ LLObjectSelectionHandle LLSelectMgr::selectObjectAndFamily(const std::vector<LLV } // leave component mode - if (gSavedSettings.getBOOL("EditLinkedParts")) + if (ALControlCache::EditLinkedParts) { gSavedSettings.setBOOL("EditLinkedParts", FALSE); promoteSelectionToRoot(); @@ -709,7 +709,7 @@ bool LLSelectMgr::enableLinkObjects() // user can modify at least one of the selected objects. // in component mode, can't link - if (!gSavedSettings.getBOOL("EditLinkedParts")) + if (!ALControlCache::EditLinkedParts) { if(LLSelectMgr::getInstance()->selectGetAllRootsValid() && LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() >= 2) { @@ -1231,7 +1231,7 @@ LLObjectSelectionHandle LLSelectMgr::selectHighlightedObjects() void LLSelectMgr::deselectHighlightedObjects() { - BOOL select_linked_set = !gSavedSettings.getBOOL("EditLinkedParts"); + BOOL select_linked_set = !ALControlCache::EditLinkedParts; for (std::set<LLPointer<LLViewerObject> >::iterator iter = mRectSelectedObjects.begin(); iter != mRectSelectedObjects.end(); iter++) { @@ -1367,7 +1367,7 @@ void LLSelectMgr::getGrid(LLVector3& origin, LLQuaternion &rotation, LLVector3 & LLXform* attachment_point_xform = first_object->getRootEdit()->mDrawable->mXform.getParent(); mGridOrigin = attachment_point_xform->getWorldPosition(); mGridRotation = attachment_point_xform->getWorldRotation(); - mGridScale = LLVector3(1.f, 1.f, 1.f) * gSavedSettings.getF32("GridResolution"); + mGridScale = LLVector3(1.f, 1.f, 1.f) * ALControlCache::GridResolution; } break; case SELECT_TYPE_HUD: @@ -1375,7 +1375,7 @@ void LLSelectMgr::getGrid(LLVector3& origin, LLQuaternion &rotation, LLVector3 & mGridScale = LLVector3(0.25f, 0.25f, 0.25f); break; case SELECT_TYPE_WORLD: - mGridScale = LLVector3(1.f, 1.f, 1.f) * gSavedSettings.getF32("GridResolution"); + mGridScale = LLVector3(1.f, 1.f, 1.f) * ALControlCache::GridResolution; break; } } @@ -3309,7 +3309,7 @@ struct LLSelectGetFirstTest void LLSelectMgr::getFirst(LLSelectGetFirstTest* test) { - if (gSavedSettings.getBOOL("EditLinkedParts")) + if (ALControlCache::EditLinkedParts) { for (LLObjectSelection::valid_iterator iter = getSelection()->valid_begin(); iter != getSelection()->valid_end(); ++iter ) @@ -3779,7 +3779,7 @@ BOOL LLSelectMgr::selectGetEditMoveLinksetPermissions(bool &move, bool &modify) { move = true; modify = true; - bool selecting_linked_set = !gSavedSettings.getBOOL("EditLinkedParts"); + bool selecting_linked_set = !ALControlCache::EditLinkedParts; for (LLObjectSelection::iterator iter = getSelection()->begin(); iter != getSelection()->end(); iter++) @@ -4178,7 +4178,7 @@ void LLSelectMgr::sendMultipleUpdate(U32 type) { if (type == UPD_NONE) return; // send individual updates when selecting textures or individual objects - ESendType send_type = (!gSavedSettings.getBOOL("EditLinkedParts") && !getTEMode()) ? SEND_ONLY_ROOTS : SEND_ROOTS_FIRST; + ESendType send_type = (!ALControlCache::EditLinkedParts && !getTEMode()) ? SEND_ONLY_ROOTS : SEND_ROOTS_FIRST; if (send_type == SEND_ONLY_ROOTS) { // tell simulator to apply to whole linked sets @@ -4494,7 +4494,7 @@ void LLSelectMgr::deselectAllIfTooFar() static RlvCachedBehaviourModifier<float> s_nFartouchDist(RLV_MODIFIER_FARTOUCHDIST); BOOL fRlvFartouch = gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH) && LLToolMgr::instance().inEdit(); - if ( (gSavedSettings.getBOOL("LimitSelectDistance") || (fRlvFartouch) ) + if ( (ALControlCache::LimitSelectDistance || (fRlvFartouch) ) // [/RLVa:KB] && (!mSelectedObjects->getPrimaryObject() || !mSelectedObjects->getPrimaryObject()->isAvatar()) && (mSelectedObjects->getPrimaryObject() != LLViewerMediaFocus::getInstance()->getFocusedObject()) @@ -5746,7 +5746,7 @@ void LLSelectMgr::updateSilhouettes() // persists from frame to frame to avoid regenerating object silhouettes // mHighlightedObjects includes all siblings of rect selected objects - BOOL select_linked_set = !gSavedSettings.getBOOL("EditLinkedParts"); + BOOL select_linked_set = !ALControlCache::EditLinkedParts; // generate list of roots from current object selection for (std::set<LLPointer<LLViewerObject> >::iterator iter = mRectSelectedObjects.begin(); @@ -7043,7 +7043,7 @@ BOOL LLSelectMgr::canUndo() const //----------------------------------------------------------------------------- void LLSelectMgr::undo() { - BOOL select_linked_set = !gSavedSettings.getBOOL("EditLinkedParts"); + BOOL select_linked_set = !ALControlCache::EditLinkedParts; LLUUID group_id(gAgent.getGroupID()); sendListToRegions("Undo", packAgentAndSessionAndGroupID, packObjectID, logNoOp, &group_id, select_linked_set ? SEND_ONLY_ROOTS : SEND_CHILDREN_FIRST); } @@ -7061,7 +7061,7 @@ BOOL LLSelectMgr::canRedo() const //----------------------------------------------------------------------------- void LLSelectMgr::redo() { - BOOL select_linked_set = !gSavedSettings.getBOOL("EditLinkedParts"); + BOOL select_linked_set = !ALControlCache::EditLinkedParts; LLUUID group_id(gAgent.getGroupID()); sendListToRegions("Redo", packAgentAndSessionAndGroupID, packObjectID, logNoOp, &group_id, select_linked_set ? SEND_ONLY_ROOTS : SEND_CHILDREN_FIRST); } @@ -8035,7 +8035,7 @@ bool LLSelectMgr::selectionMove(const LLVector3& displ, bool update_success = true; bool update_position = update_type & UPD_POSITION; bool update_rotation = update_type & UPD_ROTATION; - const bool noedit_linked_parts = !gSavedSettings.getBOOL("EditLinkedParts"); + const bool noedit_linked_parts = !ALControlCache::EditLinkedParts; if (update_position) { @@ -8168,7 +8168,7 @@ void LLSelectMgr::sendSelectionMove() S32 objects_in_this_packet = 0; // apply to linked objects if unable to select their individual parts - if (!gSavedSettings.getBOOL("EditLinkedParts") && !getTEMode()) + if (!ALControlCache::EditLinkedParts && !getTEMode()) { // tell simulator to apply to whole linked sets update_type |= UPD_LINKED_SETS; diff --git a/indra/newview/lltoolcomp.cpp b/indra/newview/lltoolcomp.cpp index f9c327b46e8a7f511bd4f23333fe61e6e905b1c7..87defe907de6c21ebbf8ffb3526b1ab4296f010f 100644 --- a/indra/newview/lltoolcomp.cpp +++ b/indra/newview/lltoolcomp.cpp @@ -111,7 +111,7 @@ BOOL LLToolComposite::isSelecting() void LLToolComposite::handleSelect() { - if (!gSavedSettings.getBOOL("EditLinkedParts")) + if (!ALControlCache::EditLinkedParts) { LLSelectMgr::getInstance()->promoteSelectionToRoot(); } @@ -179,7 +179,7 @@ void LLToolCompInspect::pickCallback(const LLPickInfo& pick_info) if (!tool_inspectp->mMouseDown) { // fast click on object, but mouse is already up...just do select - tool_inspectp->mSelectRect->handleObjectSelection(pick_info, gSavedSettings.getBOOL("EditLinkedParts"), FALSE); + tool_inspectp->mSelectRect->handleObjectSelection(pick_info, ALControlCache::EditLinkedParts, FALSE); return; } @@ -279,7 +279,7 @@ void LLToolCompTranslate::pickCallback(const LLPickInfo& pick_info) if (!LLToolCompTranslate::getInstance()->mMouseDown) { // fast click on object, but mouse is already up...just do select - LLToolCompTranslate::getInstance()->mSelectRect->handleObjectSelection(pick_info, gSavedSettings.getBOOL("EditLinkedParts"), FALSE); + LLToolCompTranslate::getInstance()->mSelectRect->handleObjectSelection(pick_info, ALControlCache::EditLinkedParts, FALSE); return; } @@ -403,7 +403,7 @@ void LLToolCompScale::pickCallback(const LLPickInfo& pick_info) if (!LLToolCompScale::getInstance()->mMouseDown) { // fast click on object, but mouse is already up...just do select - LLToolCompScale::getInstance()->mSelectRect->handleObjectSelection(pick_info, gSavedSettings.getBOOL("EditLinkedParts"), FALSE); + LLToolCompScale::getInstance()->mSelectRect->handleObjectSelection(pick_info, ALControlCache::EditLinkedParts, FALSE); return; } @@ -603,7 +603,7 @@ void LLToolCompRotate::pickCallback(const LLPickInfo& pick_info) if (!LLToolCompRotate::getInstance()->mMouseDown) { // fast click on object, but mouse is already up...just do select - LLToolCompRotate::getInstance()->mSelectRect->handleObjectSelection(pick_info, gSavedSettings.getBOOL("EditLinkedParts"), FALSE); + LLToolCompRotate::getInstance()->mSelectRect->handleObjectSelection(pick_info, ALControlCache::EditLinkedParts, FALSE); return; } diff --git a/indra/newview/lltoolgrab.cpp b/indra/newview/lltoolgrab.cpp index bc5cee6f540941ad578478f431c65f10a132220b..f6dd358eeb079d6a20e6f52b84c8c784794a7bbf 100644 --- a/indra/newview/lltoolgrab.cpp +++ b/indra/newview/lltoolgrab.cpp @@ -639,7 +639,7 @@ void LLToolGrabBase::handleHoverActive(S32 x, S32 y, MASK mask) BOOL snap_on = gSavedSettings.getBOOL("SnapEnabled"); if (snap_on && !gGrabTransientTool) { - F64 snap_size = gSavedSettings.getF32("GridResolution"); + F64 snap_size = ALControlCache::GridResolution; U8 snap_dimensions = (mVerticalDragging ? 3 : 2); for (U8 i = 0; i < snap_dimensions; i++) diff --git a/indra/newview/lltoolselect.cpp b/indra/newview/lltoolselect.cpp index aa9e2b1788120481828e94638354e50ebd40c5b5..b6de45b09dc72e765c93a46e2e28c7d55649ca81 100644 --- a/indra/newview/lltoolselect.cpp +++ b/indra/newview/lltoolselect.cpp @@ -293,7 +293,7 @@ LLObjectSelectionHandle LLToolSelect::handleObjectSelection(const LLPickInfo& pi BOOL LLToolSelect::handleMouseUp(S32 x, S32 y, MASK mask) { - mIgnoreGroup = gSavedSettings.getBOOL("EditLinkedParts"); + mIgnoreGroup = ALControlCache::EditLinkedParts; handleObjectSelection(mPick, mIgnoreGroup, FALSE); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 85fac2db26bcc8d1c3a6853a022367bc80bc3437..0456d37a31dec2f4666e8c723037e904b1631bc9 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -5258,7 +5258,7 @@ class LLToolsSnapObjectXY : public view_listener_t { bool handleEvent(const LLSD& userdata) { - F64 snap_size = (F64)gSavedSettings.getF32("GridResolution"); + F64 snap_size = (F64)ALControlCache::GridResolution; for (LLObjectSelection::root_iterator iter = LLSelectMgr::getInstance()->getSelection()->root_begin(); iter != LLSelectMgr::getInstance()->getSelection()->root_end(); iter++) @@ -5306,7 +5306,7 @@ class LLToolsEnableSelectNextPart : public view_listener_t bool handleEvent(const LLSD& userdata) { bool new_value = (!LLSelectMgr::getInstance()->getSelection()->isEmpty() - && (gSavedSettings.getBOOL("EditLinkedParts") + && (ALControlCache::EditLinkedParts || LLToolFace::getInstance() == LLToolMgr::getInstance()->getCurrentTool())); return new_value; } @@ -5320,7 +5320,7 @@ class LLToolsSelectNextPartFace : public view_listener_t bool handleEvent(const LLSD& userdata) { bool cycle_faces = LLToolFace::getInstance() == LLToolMgr::getInstance()->getCurrentTool(); - bool cycle_linked = gSavedSettings.getBOOL("EditLinkedParts"); + bool cycle_linked = ALControlCache::EditLinkedParts; if (!cycle_faces && !cycle_linked) {