diff options
author | Leyla Farazha <leyla@lindenlab.com> | 2009-10-08 00:31:01 +0000 |
---|---|---|
committer | Leyla Farazha <leyla@lindenlab.com> | 2009-10-08 00:31:01 +0000 |
commit | 6f66cdf7a1307ab37d7f07928fabbe7aa4ac2673 (patch) | |
tree | 9dfcf4091996a846b6a622b9826bc283e754f62b | |
parent | 3a6a18ee30425bf1000f82b0a4b245c23f0deafc (diff) |
EXT-1325 Texture Picker does not open
EXT-1264 'Zoom in' world context menu opens IM session
reviewed by Richard
-rw-r--r-- | indra/newview/llinspectavatar.cpp | 14 | ||||
-rw-r--r-- | indra/newview/llinspectobject.cpp | 8 | ||||
-rw-r--r-- | indra/newview/lltexturectrl.cpp | 6 | ||||
-rw-r--r-- | indra/newview/llviewermenu.cpp | 84 | ||||
-rw-r--r-- | indra/newview/llviewermenu.h | 3 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/inspect_object.xml | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_inspect_avatar_gear.xml | 3 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_inspect_object_gear.xml | 3 |
8 files changed, 82 insertions, 41 deletions
diff --git a/indra/newview/llinspectavatar.cpp b/indra/newview/llinspectavatar.cpp index 4046c893c1..947e5d80da 100644 --- a/indra/newview/llinspectavatar.cpp +++ b/indra/newview/llinspectavatar.cpp @@ -109,10 +109,11 @@ private: void onClickPay(); void onClickBlock(); void onClickReport(); + void onClickZoomIn(); + void onClickFindOnMap(); bool onVisibleFindOnMap(); bool onVisibleGodMode(); void onClickMuteVolume(); - void onFindOnMap(); void onVolumeChange(const LLSD& data); // Callback for gCacheName to look up avatar name @@ -196,7 +197,8 @@ LLInspectAvatar::LLInspectAvatar(const LLSD& sd) mCommitCallbackRegistrar.add("InspectAvatar.Pay", boost::bind(&LLInspectAvatar::onClickPay, this)); mCommitCallbackRegistrar.add("InspectAvatar.Block", boost::bind(&LLInspectAvatar::onClickBlock, this)); mCommitCallbackRegistrar.add("InspectAvatar.Report", boost::bind(&LLInspectAvatar::onClickReport, this)); - mCommitCallbackRegistrar.add("InspectAvatar.FindOnMap", boost::bind(&LLInspectAvatar::onFindOnMap, this)); + mCommitCallbackRegistrar.add("InspectAvatar.FindOnMap", boost::bind(&LLInspectAvatar::onClickFindOnMap, this)); + mCommitCallbackRegistrar.add("InspectAvatar.ZoomIn", boost::bind(&LLInspectAvatar::onClickZoomIn, this)); mVisibleCallbackRegistrar.add("InspectAvatar.VisibleFindOnMap", boost::bind(&LLInspectAvatar::onVisibleFindOnMap, this)); mVisibleCallbackRegistrar.add("InspectAvatar.VisibleGodMode", boost::bind(&LLInspectAvatar::onVisibleGodMode, this)); @@ -476,7 +478,6 @@ void LLInspectAvatar::onClickViewProfile() // hide inspector when showing profile setFocus(FALSE); LLAvatarActions::showProfile(mAvatarID); - } bool LLInspectAvatar::onVisibleFindOnMap() @@ -521,8 +522,13 @@ void LLInspectAvatar::onClickReport() LLFloaterReporter::showFromObject(mAvatarID); } +void LLInspectAvatar::onClickZoomIn() +{ + handle_zoom_to_object(mAvatarID); + closeFloater(); +} -void LLInspectAvatar::onFindOnMap() +void LLInspectAvatar::onClickFindOnMap() { gFloaterWorldMap->trackAvatar(mAvatarID, mAvatarName); LLFloaterReg::showInstance("world_map"); diff --git a/indra/newview/llinspectobject.cpp b/indra/newview/llinspectobject.cpp index 8c38e785e9..cdb3a10dfc 100644 --- a/indra/newview/llinspectobject.cpp +++ b/indra/newview/llinspectobject.cpp @@ -109,6 +109,7 @@ private: void onClickSit(); void onClickOpen(); void onClickMoreInfo(); + void onClickZoomIn(); private: LLUUID mObjectID; @@ -132,6 +133,7 @@ LLInspectObject::LLInspectObject(const LLSD& sd) mCommitCallbackRegistrar.add("InspectObject.Sit", boost::bind(&LLInspectObject::onClickSit, this)); mCommitCallbackRegistrar.add("InspectObject.Open", boost::bind(&LLInspectObject::onClickOpen, this)); mCommitCallbackRegistrar.add("InspectObject.MoreInfo", boost::bind(&LLInspectObject::onClickMoreInfo, this)); + mCommitCallbackRegistrar.add("InspectObject.ZoomIn", boost::bind(&LLInspectObject::onClickZoomIn, this)); } @@ -554,6 +556,12 @@ void LLInspectObject::onClickMoreInfo() closeFloater(); } +void LLInspectObject::onClickZoomIn() +{ + handle_look_at_selection("zoom"); + closeFloater(); +} + ////////////////////////////////////////////////////////////////////////////// // LLInspectObjectUtil ////////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 43f82e592b..b5aec1b80b 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -1066,15 +1066,17 @@ BOOL LLTextureCtrl::handleHover(S32 x, S32 y, MASK mask) BOOL LLTextureCtrl::handleMouseDown(S32 x, S32 y, MASK mask) { BOOL handled = LLUICtrl::handleMouseDown( x, y , mask ); - if( handled ) + + if( !handled ) { showPicker(FALSE); - //grab textures first... gInventory.startBackgroundFetch(gInventory.findCategoryUUIDForType(LLAssetType::AT_TEXTURE)); //...then start full inventory fetch. gInventory.startBackgroundFetch(); + handled = TRUE; } + return handled; } diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index dde7b1c7ee..d9a74477f4 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -5338,42 +5338,64 @@ class LLWorldCreateLandmark : public view_listener_t } }; -class LLToolsLookAtSelection : public view_listener_t +void handle_look_at_selection(const LLSD& param) { - bool handleEvent(const LLSD& userdata) + const F32 PADDING_FACTOR = 2.f; + BOOL zoom = (param.asString() == "zoom"); + if (!LLSelectMgr::getInstance()->getSelection()->isEmpty()) { - const F32 PADDING_FACTOR = 2.f; - BOOL zoom = (userdata.asString() == "zoom"); - if (!LLSelectMgr::getInstance()->getSelection()->isEmpty()) - { - gAgent.setFocusOnAvatar(FALSE, ANIMATE); + gAgent.setFocusOnAvatar(FALSE, ANIMATE); - LLBBox selection_bbox = LLSelectMgr::getInstance()->getBBoxOfSelection(); - F32 angle_of_view = llmax(0.1f, LLViewerCamera::getInstance()->getAspect() > 1.f ? LLViewerCamera::getInstance()->getView() * LLViewerCamera::getInstance()->getAspect() : LLViewerCamera::getInstance()->getView()); - F32 distance = selection_bbox.getExtentLocal().magVec() * PADDING_FACTOR / atan(angle_of_view); + LLBBox selection_bbox = LLSelectMgr::getInstance()->getBBoxOfSelection(); + F32 angle_of_view = llmax(0.1f, LLViewerCamera::getInstance()->getAspect() > 1.f ? LLViewerCamera::getInstance()->getView() * LLViewerCamera::getInstance()->getAspect() : LLViewerCamera::getInstance()->getView()); + F32 distance = selection_bbox.getExtentLocal().magVec() * PADDING_FACTOR / atan(angle_of_view); - LLVector3 obj_to_cam = LLViewerCamera::getInstance()->getOrigin() - selection_bbox.getCenterAgent(); - obj_to_cam.normVec(); + LLVector3 obj_to_cam = LLViewerCamera::getInstance()->getOrigin() - selection_bbox.getCenterAgent(); + obj_to_cam.normVec(); - LLUUID object_id; - if (LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()) - { - object_id = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()->mID; - } - if (zoom) - { - gAgent.setCameraPosAndFocusGlobal(LLSelectMgr::getInstance()->getSelectionCenterGlobal() + LLVector3d(obj_to_cam * distance), - LLSelectMgr::getInstance()->getSelectionCenterGlobal(), - object_id ); - } - else - { - gAgent.setFocusGlobal( LLSelectMgr::getInstance()->getSelectionCenterGlobal(), object_id ); - } + LLUUID object_id; + if (LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()) + { + object_id = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()->mID; + } + if (zoom) + { + gAgent.setCameraPosAndFocusGlobal(LLSelectMgr::getInstance()->getSelectionCenterGlobal() + LLVector3d(obj_to_cam * distance), + LLSelectMgr::getInstance()->getSelectionCenterGlobal(), + object_id ); + } + else + { + gAgent.setFocusGlobal( LLSelectMgr::getInstance()->getSelectionCenterGlobal(), object_id ); } - return true; } -}; +} + +void handle_zoom_to_object(LLUUID object_id) +{ + const F32 PADDING_FACTOR = 2.f; + + LLViewerObject* object = gObjectList.findObject(object_id); + + if (object) + { + gAgent.setFocusOnAvatar(FALSE, ANIMATE); + + LLBBox bbox = object->getBoundingBoxAgent() ; + F32 angle_of_view = llmax(0.1f, LLViewerCamera::getInstance()->getAspect() > 1.f ? LLViewerCamera::getInstance()->getView() * LLViewerCamera::getInstance()->getAspect() : LLViewerCamera::getInstance()->getView()); + F32 distance = bbox.getExtentLocal().magVec() * PADDING_FACTOR / atan(angle_of_view); + + LLVector3 obj_to_cam = LLViewerCamera::getInstance()->getOrigin() - bbox.getCenterAgent(); + obj_to_cam.normVec(); + + + LLVector3d object_center_global = gAgent.getPosGlobalFromAgent(bbox.getCenterAgent()); + + gAgent.setCameraPosAndFocusGlobal(object_center_global + LLVector3d(obj_to_cam * distance), + object_center_global, + object_id ); + } +} class LLAvatarInviteToGroup : public view_listener_t { @@ -7753,8 +7775,8 @@ void initialize_menus() view_listener_t::addMenu(new LLToolsUnlink(), "Tools.Unlink"); view_listener_t::addMenu(new LLToolsStopAllAnimations(), "Tools.StopAllAnimations"); view_listener_t::addMenu(new LLToolsReleaseKeys(), "Tools.ReleaseKeys"); - view_listener_t::addMenu(new LLToolsEnableReleaseKeys(), "Tools.EnableReleaseKeys"); - view_listener_t::addMenu(new LLToolsLookAtSelection(), "Tools.LookAtSelection"); + view_listener_t::addMenu(new LLToolsEnableReleaseKeys(), "Tools.EnableReleaseKeys"); + commit.add("Tools.LookAtSelection", boost::bind(&handle_look_at_selection, _2)); commit.add("Tools.BuyOrTake", boost::bind(&handle_buy_or_take)); commit.add("Tools.TakeCopy", boost::bind(&handle_take_copy)); view_listener_t::addMenu(new LLToolsSaveToInventory(), "Tools.SaveToInventory"); diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h index 75f4f08bde..d28d54c933 100644 --- a/indra/newview/llviewermenu.h +++ b/indra/newview/llviewermenu.h @@ -98,8 +98,9 @@ bool enable_object_open(); // Buy either contents or object itself void handle_buy(); - void handle_take_copy(); +void handle_look_at_selection(const LLSD& param); +void handle_zoom_to_object(LLUUID object_id); // Can anyone take a free copy of the object? // *TODO: Move to separate file diff --git a/indra/newview/skins/default/xui/en/inspect_object.xml b/indra/newview/skins/default/xui/en/inspect_object.xml index 97df28aa30..73a7bef77d 100644 --- a/indra/newview/skins/default/xui/en/inspect_object.xml +++ b/indra/newview/skins/default/xui/en/inspect_object.xml @@ -144,7 +144,7 @@ This is a really long description for an object being as how it is at least 80 c image_disabled="OptionsMenu_Disabled" image_selected="OptionsMenu_Press" image_unselected="OptionsMenu_Off" - menu_filename="menu_inspect_avatar_gear.xml" + menu_filename="menu_inspect_object_gear.xml" name="gear_btn" picture_style="true" right="-10" diff --git a/indra/newview/skins/default/xui/en/menu_inspect_avatar_gear.xml b/indra/newview/skins/default/xui/en/menu_inspect_avatar_gear.xml index 9f5b7f3813..5279f9d141 100644 --- a/indra/newview/skins/default/xui/en/menu_inspect_avatar_gear.xml +++ b/indra/newview/skins/default/xui/en/menu_inspect_avatar_gear.xml @@ -99,10 +99,11 @@ function="InspectAvatar.VisibleFindOnMap"/>
</menu_item_call>
<menu_item_call
- enabled="false"
label="Zoom In"
layout="topleft"
name="zoom_in">
+ <menu_item_call.on_click
+ function="InspectAvatar.ZoomIn"/>
</menu_item_call>
<menu_item_call
label="Pay"
diff --git a/indra/newview/skins/default/xui/en/menu_inspect_object_gear.xml b/indra/newview/skins/default/xui/en/menu_inspect_object_gear.xml index 1bba8eb264..93c53981f3 100644 --- a/indra/newview/skins/default/xui/en/menu_inspect_object_gear.xml +++ b/indra/newview/skins/default/xui/en/menu_inspect_object_gear.xml @@ -105,10 +105,11 @@ function="Object.VisibleMute" /> </menu_item_call> <menu_item_call - enabled="false" label="Zoom In" layout="topleft" name="zoom_in"> + <menu_item_call.on_click + function="InspectObject.ZoomIn" /> </menu_item_call> <menu_item_call label="Remove" |