From e571e75912d49f538c9a61776b5ad1596f8908a1 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Sun, 4 Oct 2009 03:51:58 -0700 Subject: Disable camera constraints now disables max zoom for the scrollwheel --- linden/indra/newview/llagent.cpp | 111 +++++++++++++++++++++++---------------- 1 file changed, 66 insertions(+), 45 deletions(-) (limited to 'linden') diff --git a/linden/indra/newview/llagent.cpp b/linden/indra/newview/llagent.cpp index e6438f4..08fd35d 100644 --- a/linden/indra/newview/llagent.cpp +++ b/linden/indra/newview/llagent.cpp @@ -187,6 +187,9 @@ const F32 OBJECT_MIN_ZOOM = 0.02f; const F32 APPEARANCE_MIN_ZOOM = 0.39f; const F32 APPEARANCE_MAX_ZOOM = 8.f; +const F32 DIST_FUDGE = 16.f; // meters +const F32 MAX_CAMERA_DIST_NO_CONSTRANT = 65535.f*4.f; + // fidget constants const F32 MIN_FIDGET_TIME = 8.f; // seconds const F32 MAX_FIDGET_TIME = 20.f; // seconds @@ -1728,10 +1731,17 @@ F32 LLAgent::getCameraZoomFraction() else { F32 min_zoom; - const F32 DIST_FUDGE = 16.f; // meters - F32 max_zoom = llmin(mDrawDistance - DIST_FUDGE, + F32 max_zoom; + if (gSavedSettings.getBOOL("DisableCameraConstraints")) + { + max_zoom = MAX_CAMERA_DIST_NO_CONSTRANT; + } + else + { + max_zoom = llmin(mDrawDistance - DIST_FUDGE, LLWorld::getInstance()->getRegionWidthInMeters() - DIST_FUDGE, MAX_CAMERA_DISTANCE_FROM_AGENT); + } F32 distance = (F32)mCameraFocusOffsetTarget.magVec(); if (mFocusObject.notNull()) @@ -1777,10 +1787,17 @@ void LLAgent::setCameraZoomFraction(F32 fraction) else { F32 min_zoom = LAND_MIN_ZOOM; - const F32 DIST_FUDGE = 16.f; // meters - F32 max_zoom = llmin(mDrawDistance - DIST_FUDGE, + F32 max_zoom; + if (gSavedSettings.getBOOL("DisableCameraConstraints")) + { + max_zoom = MAX_CAMERA_DIST_NO_CONSTRANT; + } + else + { + max_zoom = llmin(mDrawDistance - DIST_FUDGE, LLWorld::getInstance()->getRegionWidthInMeters() - DIST_FUDGE, MAX_CAMERA_DISTANCE_FROM_AGENT); + } if (mFocusObject.notNull()) { @@ -1898,29 +1915,32 @@ void LLAgent::cameraZoomIn(const F32 fraction) } } - new_distance = llmax(new_distance, min_zoom); - // Don't zoom too far back - const F32 DIST_FUDGE = 16.f; // meters - F32 max_distance = llmin(mDrawDistance - DIST_FUDGE, - LLWorld::getInstance()->getRegionWidthInMeters() - DIST_FUDGE ); - - if (new_distance > max_distance) + // Actually, let's when disable camera constraints is active -- McCabe + if (!gSavedSettings.getBOOL("DisableCameraConstraints")) { - new_distance = max_distance; + new_distance = llmax(new_distance, min_zoom); - /* - // Unless camera is unlocked - if (!LLViewerCamera::sDisableCameraConstraints) + F32 max_distance = llmin(mDrawDistance - DIST_FUDGE, + LLWorld::getInstance()->getRegionWidthInMeters() - DIST_FUDGE ); + + if (new_distance > max_distance) { - return; + new_distance = max_distance; + + /* + // Unless camera is unlocked + if (!LLViewerCamera::sDisableCameraConstraints) + { + return; + } + */ } - */ - } - if( cameraCustomizeAvatar() ) - { - new_distance = llclamp( new_distance, APPEARANCE_MIN_ZOOM, APPEARANCE_MAX_ZOOM ); + if( cameraCustomizeAvatar() ) + { + new_distance = llclamp( new_distance, APPEARANCE_MIN_ZOOM, APPEARANCE_MAX_ZOOM ); + } } mCameraFocusOffsetTarget = new_distance * camera_offset_unit; @@ -1951,40 +1971,41 @@ void LLAgent::cameraOrbitIn(const F32 meters) LLVector3d camera_offset_unit(mCameraFocusOffsetTarget); F32 current_distance = (F32)camera_offset_unit.normalize(); F32 new_distance = current_distance - meters; - F32 min_zoom = LAND_MIN_ZOOM; - - // Don't move through focus point - if (mFocusObject.notNull()) + + // Don't zoom too far back + // Actually, let's when disable camera constraints is active -- McCabe + if (!gSavedSettings.getBOOL("DisableCameraConstraints")) { - if (mFocusObject->isAvatar()) - { - min_zoom = AVATAR_MIN_ZOOM; - } - else + F32 min_zoom = LAND_MIN_ZOOM; + F32 max_distance; + + // Don't move through focus point + if (mFocusObject.notNull()) { - min_zoom = OBJECT_MIN_ZOOM; + if (mFocusObject->isAvatar()) + { + min_zoom = AVATAR_MIN_ZOOM; + } + else + { + min_zoom = OBJECT_MIN_ZOOM; + } } - } - new_distance = llmax(new_distance, min_zoom); + new_distance = llmax(new_distance, min_zoom); - // Don't zoom too far back - const F32 DIST_FUDGE = 16.f; // meters - F32 max_distance = llmin(mDrawDistance - DIST_FUDGE, - LLWorld::getInstance()->getRegionWidthInMeters() - DIST_FUDGE ); + max_distance = llmin(mDrawDistance - DIST_FUDGE, + LLWorld::getInstance()->getRegionWidthInMeters() - DIST_FUDGE ); - if (new_distance > max_distance) - { - // Unless camera is unlocked - if (!gSavedSettings.getBOOL("DisableCameraConstraints")) + if (new_distance > max_distance) { return; } - } - if( CAMERA_MODE_CUSTOMIZE_AVATAR == getCameraMode() ) - { - new_distance = llclamp( new_distance, APPEARANCE_MIN_ZOOM, APPEARANCE_MAX_ZOOM ); + if( CAMERA_MODE_CUSTOMIZE_AVATAR == getCameraMode() ) + { + new_distance = llclamp( new_distance, APPEARANCE_MIN_ZOOM, APPEARANCE_MAX_ZOOM ); + } } // Compute new camera offset -- cgit v1.1 From fac71ad35e5dc3db777a98d60c30b6d56219a035 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Sat, 10 Oct 2009 00:44:27 -0700 Subject: Added and tweaked vertical IM option from Emerald viewer --- linden/indra/newview/app_settings/settings.xml | 11 +++++++++ linden/indra/newview/llfloaterchatterbox.cpp | 11 ++++++++- linden/indra/newview/llprefsim.cpp | 2 ++ .../xui/en-us/floater_chatterbox_vertical.xml | 14 +++++++++++ .../default/xui/en-us/panel_preferences_im.xml | 28 ++++++++++++---------- 5 files changed, 53 insertions(+), 13 deletions(-) create mode 100644 linden/indra/newview/skins/default/xui/en-us/floater_chatterbox_vertical.xml (limited to 'linden') diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml index f148b80..55e6131 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml @@ -10107,6 +10107,17 @@ Value 0 + VerticalIMTabs + + Comment + Enable vertical layout for IM tabs + Persist + 1 + Type + Boolean + Value + 0 + VivoxDebugLevel Comment diff --git a/linden/indra/newview/llfloaterchatterbox.cpp b/linden/indra/newview/llfloaterchatterbox.cpp index 5ef5a30..e18cca0 100644 --- a/linden/indra/newview/llfloaterchatterbox.cpp +++ b/linden/indra/newview/llfloaterchatterbox.cpp @@ -97,7 +97,16 @@ LLFloaterChatterBox::LLFloaterChatterBox(const LLSD& seed) : { mAutoResize = FALSE; - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_chatterbox.xml", NULL, FALSE); + // check if vertical tabs is selected + if (gSavedSettings.getBOOL("VerticalIMTabs")) + { + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_chatterbox_vertical.xml", NULL, FALSE); + } + else + { + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_chatterbox.xml", NULL, FALSE); + } + if (gSavedSettings.getBOOL("ContactsTornOff")) { LLFloaterMyFriends* floater_contacts = LLFloaterMyFriends::getInstance(0); diff --git a/linden/indra/newview/llprefsim.cpp b/linden/indra/newview/llprefsim.cpp index 3d71202..b6fbc88 100644 --- a/linden/indra/newview/llprefsim.cpp +++ b/linden/indra/newview/llprefsim.cpp @@ -121,6 +121,7 @@ BOOL LLPrefsIMImpl::postBuild() childSetValue("include_im_in_chat_history", gSavedSettings.getBOOL("IMInChatHistory")); childSetValue("show_timestamps_check", gSavedSettings.getBOOL("IMShowTimestamps")); childSetValue("friends_online_notify_checkbox", gSavedSettings.getBOOL("ChatOnlineNotification")); + childSetValue("vertical-imtabs-toggle", gSavedSettings.getBOOL("VerticalIMTabs")); childSetText("log_path_string", gSavedPerAccountSettings.getString("InstantMessageLogPath")); childSetValue("log_instant_messages", gSavedPerAccountSettings.getBOOL("LogInstantMessages")); @@ -216,6 +217,7 @@ void LLPrefsIMImpl::apply() gAgent.sendReliableMessage(); } } + gSavedSettings.setBOOL("VerticalIMTabs", childGetValue("vertical-imtabs-toggle").asBoolean()); } void LLPrefsIMImpl::setPersonalInfo(const std::string& visibility, bool im_via_email, const std::string& email) diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_chatterbox_vertical.xml b/linden/indra/newview/skins/default/xui/en-us/floater_chatterbox_vertical.xml new file mode 100644 index 0000000..8b1f41b --- /dev/null +++ b/linden/indra/newview/skins/default/xui/en-us/floater_chatterbox_vertical.xml @@ -0,0 +1,14 @@ + + + + + Unread IM + + + Unread IMs + + + diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_im.xml b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_im.xml index ee00455..9b18e11 100644 --- a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_im.xml +++ b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_im.xml @@ -49,55 +49,59 @@ initial_value="false" label="Show online Friend notifications" left="148" mouse_opaque="true" name="friends_online_notify_checkbox" radio_style="false" width="256" /> + Busy Mode Response: - Logging Options: - - - - - - - -