summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/llui/lltextbase.cpp1
-rw-r--r--indra/llui/llurlaction.cpp10
-rw-r--r--indra/llui/llurlaction.h4
-rw-r--r--indra/newview/llchathistory.cpp18
-rw-r--r--indra/newview/llchatitemscontainerctrl.cpp19
-rw-r--r--indra/newview/llviewermenu.cpp8
-rw-r--r--indra/newview/llviewermenu.h2
-rw-r--r--indra/newview/skins/default/xui/en/menu_object_icon.xml11
-rw-r--r--indra/newview/skins/default/xui/en/menu_url_objectim.xml7
9 files changed, 75 insertions, 5 deletions
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 7007049e1c..d5755ae4b6 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -2227,6 +2227,7 @@ void LLTextBase::createUrlContextMenu(S32 x, S32 y, const std::string &in_url)
registrar.add("Url.RemoveFriend", boost::bind(&LLUrlAction::removeFriend, url));
registrar.add("Url.ReportAbuse", boost::bind(&LLUrlAction::reportAbuse, url));
registrar.add("Url.SendIM", boost::bind(&LLUrlAction::sendIM, url));
+ registrar.add("Url.ZoomInObject", boost::bind(&LLUrlAction::zoomInObject, url));
registrar.add("Url.ShowOnMap", boost::bind(&LLUrlAction::showLocationOnMap, url));
registrar.add("Url.ShowParcelOnMap", boost::bind(&LLUrlAction::showParcelOnMap, url));
registrar.add("Url.CopyLabel", boost::bind(&LLUrlAction::copyLabelToClipboard, url));
diff --git a/indra/llui/llurlaction.cpp b/indra/llui/llurlaction.cpp
index ce599a7552..e86a02d1df 100644
--- a/indra/llui/llurlaction.cpp
+++ b/indra/llui/llurlaction.cpp
@@ -117,6 +117,16 @@ void LLUrlAction::teleportToLocation(std::string url)
}
}
+void LLUrlAction::zoomInObject(std::string url)
+{
+ LLUrlMatch match;
+ std::string object_id = getObjectId(url);
+ if (LLUUID::validate(object_id) && LLUrlRegistry::instance().findUrl(url, match))
+ {
+ executeSLURL("secondlife:///app/object/" + object_id + "/zoomin/" + match.getLocation());
+ }
+}
+
void LLUrlAction::showLocationOnMap(std::string url)
{
LLUrlMatch match;
diff --git a/indra/llui/llurlaction.h b/indra/llui/llurlaction.h
index c960d61ca0..9d1cfba2d6 100644
--- a/indra/llui/llurlaction.h
+++ b/indra/llui/llurlaction.h
@@ -60,6 +60,10 @@ public:
/// if the Url specifies an SL location, teleport there
static void teleportToLocation(std::string url);
+ /// If the Url specifies an object id, attempt to zoom in.
+ /// If not possible to zoom in, show on map
+ static void zoomInObject(std::string url);
+
/// if the Url specifies an SL location, show it on a map
static void showLocationOnMap(std::string url);
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">