diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llchathistory.cpp | 18 | ||||
-rw-r--r-- | indra/newview/llchatitemscontainerctrl.cpp | 19 | ||||
-rw-r--r-- | indra/newview/llviewermenu.cpp | 8 | ||||
-rw-r--r-- | indra/newview/llviewermenu.h | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_object_icon.xml | 11 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_url_objectim.xml | 7 |
6 files changed, 60 insertions, 5 deletions
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index a48e22bc73..4d8a49ac0e 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -189,7 +189,14 @@ public: std::string url = "secondlife://" + mObjectData["slurl"].asString(); LLUrlAction::teleportToLocation(url); } - + else if (level == "obj_zoom_in") + { + LLUUID obj_id = mObjectData["object_id"]; + if (obj_id.notNull()) + { + handle_zoom_to_object(obj_id); + } + } } bool onObjectIconContextMenuItemVisible(const LLSD& userdata) @@ -203,6 +210,15 @@ public: { return !LLMuteList::getInstance()->isMuted(getAvatarId(), mFrom, LLMute::flagTextChat); } + else if (level == "obj_zoom_in") + { + LLUUID obj_id = mObjectData["object_id"]; + if (obj_id.notNull()) + { + return nullptr != gObjectList.findObject(mAvatarID); + } + return false; + } return false; } diff --git a/indra/newview/llchatitemscontainerctrl.cpp b/indra/newview/llchatitemscontainerctrl.cpp index 550dfeb802..5ac4ce0d52 100644 --- a/indra/newview/llchatitemscontainerctrl.cpp +++ b/indra/newview/llchatitemscontainerctrl.cpp @@ -37,6 +37,8 @@ #include "lllocalcliprect.h" #include "lltrans.h" #include "llfloaterimnearbychat.h" +#include "llfloaterworldmap.h" +#include "llviewermenu.h" #include "llviewercontrol.h" #include "llagentdata.h" @@ -75,6 +77,23 @@ public: return true; } + if (verb == "zoomin") + { + if (!handle_zoom_to_object(object_id) && params.size() > 2) + { + // zoom faled, show location + // secondlife:///app/object/object_id/zoomin/{LOCATION}/{COORDS} SLapp + const std::string region_name = LLURI::unescape(params[0].asString()); + S32 x = (params.size() > 1) ? params[1].asInteger() : 128; + S32 y = (params.size() > 2) ? params[2].asInteger() : 128; + S32 z = (params.size() > 3) ? params[3].asInteger() : 0; + + LLFloaterWorldMap::getInstance()->trackURL(region_name, x, y, z); + LLFloaterReg::showInstance("world_map", "center"); + } + return true; + } + return false; } }; diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 44157d2d2d..9625df5b7b 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -6485,7 +6485,7 @@ void handle_look_at_selection(const LLSD& param) } } -void handle_zoom_to_object(const LLUUID& object_id) +bool handle_zoom_to_object(const LLUUID& object_id) { const F32 PADDING_FACTOR = 2.f; @@ -6503,12 +6503,14 @@ void handle_zoom_to_object(const LLUUID& object_id) obj_to_cam.normVec(); - LLVector3d object_center_global = gAgent.getPosGlobalFromAgent(bbox.getCenterAgent()); + LLVector3d object_center_global = gAgent.getPosGlobalFromAgent(bbox.getCenterAgent()); - gAgentCamera.setCameraPosAndFocusGlobal(object_center_global + LLVector3d(obj_to_cam * distance), + gAgentCamera.setCameraPosAndFocusGlobal(object_center_global + LLVector3d(obj_to_cam * distance), object_center_global, object_id ); + return true; } + return false; } class LLAvatarInviteToGroup : public view_listener_t diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h index 68c3dbc126..522c7e8109 100644 --- a/indra/newview/llviewermenu.h +++ b/indra/newview/llviewermenu.h @@ -73,7 +73,7 @@ void handle_buy(); void handle_take(bool take_separate = false); void handle_take_copy(); void handle_look_at_selection(const LLSD& param); -void handle_zoom_to_object(const LLUUID& object_id); +bool handle_zoom_to_object(const LLUUID& object_id); void handle_object_return(); void handle_object_delete(); void handle_object_edit(); diff --git a/indra/newview/skins/default/xui/en/menu_object_icon.xml b/indra/newview/skins/default/xui/en/menu_object_icon.xml index f3e520700b..d43ce26e56 100644 --- a/indra/newview/skins/default/xui/en/menu_object_icon.xml +++ b/indra/newview/skins/default/xui/en/menu_object_icon.xml @@ -41,6 +41,17 @@ <menu_item_separator layout="topleft" /> <menu_item_call + label="Zoom in" + layout="topleft" + name="zoom_in"> + <menu_item_call.on_click + function="ObjectIcon.Action" + parameter="obj_zoom_in" /> + <menu_item_call.on_enable + function="ObjectIcon.Visible" + parameter="obj_zoom_in" /> + </menu_item_call> + <menu_item_call label="Show on Map" layout="topleft" name="show_on_map"> diff --git a/indra/newview/skins/default/xui/en/menu_url_objectim.xml b/indra/newview/skins/default/xui/en/menu_url_objectim.xml index 1874c01f8d..fb6081e1fb 100644 --- a/indra/newview/skins/default/xui/en/menu_url_objectim.xml +++ b/indra/newview/skins/default/xui/en/menu_url_objectim.xml @@ -26,6 +26,13 @@ <menu_item_separator layout="topleft" /> <menu_item_call + label="Zoom in" + layout="topleft" + name="zoom_in"> + <menu_item_call.on_click + function="Url.ZoomInObject" /> + </menu_item_call> + <menu_item_call label="Show on Map" layout="topleft" name="show_on_map"> |