Teleport and move to objects by their IM name links

This commit is contained in:
Liru Færs
2020-01-07 15:00:31 -05:00
parent 2c5ad97697
commit d2052b9e4c
2 changed files with 13 additions and 3 deletions

View File

@@ -9357,7 +9357,8 @@ class ListTeleportTo : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
gAgent.teleportViaLocation(get_av_pos(LFIDBearer::getActiveSelectedID()));
const auto&& id = LFIDBearer::getActiveSelectedID();
gAgent.teleportViaLocation(LFIDBearer::getActiveType() == LFIDBearer::OBJECT ? gObjectList.findObject(id)->getPositionGlobal() : get_av_pos(id));
return true;
}
};
@@ -9394,7 +9395,8 @@ class ListIsNearby : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
gMenuHolder->findControl(userdata["control"].asString())->setValue(is_nearby(LFIDBearer::getActiveSelectedID()));
const auto&& id = LFIDBearer::getActiveSelectedID();
gMenuHolder->findControl(userdata["control"].asString())->setValue(LFIDBearer::getActiveType() == LFIDBearer::OBJECT ? gObjectList.findObject(id) : is_nearby(id));
return true;
}
};

View File

@@ -34,12 +34,20 @@
function="Text.Url" userdata="ShowOnMap" />
</menu_item_call>
<menu_item_call
label="Teleport to Object Location"
label="Teleport to Object URL Location"
layout="topleft"
name="teleport_to_object">
<menu_item_call.on_click
function="Text.Url" userdata="Teleport" />
</menu_item_call>
<menu_item_call label="Move To" name="Move To">
<on_click function="List.GoTo"/>
<on_visible function="List.IsNearby"/>
</menu_item_call>
<menu_item_call label="Teleport To (current location)" name="Teleport To (current location)">
<on_click function="List.TeleportTo"/>
<on_visible function="List.IsNearby"/>
</menu_item_call>
<menu_item_separator
layout="topleft" />
<menu_item_call