Add Follow to pie and right click UI menus for objects and avatars
This commit is contained in:
@@ -2505,15 +2505,22 @@ BOOL enable_has_attachments(void*)
|
|||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
// Avatar pie menu
|
// Avatar pie menu
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
//void handle_follow(void *userdata)
|
|
||||||
//{
|
class LLObjectFollow : public view_listener_t
|
||||||
// // follow a given avatar by ID
|
{
|
||||||
// LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject();
|
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
|
||||||
// if (objectp)
|
{
|
||||||
// {
|
// follow a given avatar by ID
|
||||||
// gAgent.startFollowPilot(objectp->getID());
|
LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject();
|
||||||
// }
|
if (objectp)
|
||||||
//}
|
{
|
||||||
|
if (auto av = objectp->getAvatarAncestor()) // Follow the avatar, not a control avatar or an attachment, if possible
|
||||||
|
objectp = av;
|
||||||
|
gAgent.startFollowPilot(objectp->getID(), true, 1.0f);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
bool enable_object_mute()
|
bool enable_object_mute()
|
||||||
{
|
{
|
||||||
@@ -9401,6 +9408,15 @@ class ListIsNearby : public view_listener_t
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class ListFollow : public view_listener_t
|
||||||
|
{
|
||||||
|
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
|
||||||
|
{
|
||||||
|
gAgent.startFollowPilot(LFIDBearer::getActiveSelectedID(), true, 1.0f);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
class ListGoTo : public view_listener_t
|
class ListGoTo : public view_listener_t
|
||||||
{
|
{
|
||||||
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
|
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
|
||||||
@@ -9813,6 +9829,7 @@ void initialize_menus()
|
|||||||
addMenu(new LLOHGOD(), "Object.EnableExplode");
|
addMenu(new LLOHGOD(), "Object.EnableExplode");
|
||||||
add_wave_listeners();
|
add_wave_listeners();
|
||||||
add_dae_listeners();
|
add_dae_listeners();
|
||||||
|
addMenu(new LLObjectFollow(), "Object.Follow");
|
||||||
// </edit>
|
// </edit>
|
||||||
addMenu(new LLObjectMute(), "Object.Mute");
|
addMenu(new LLObjectMute(), "Object.Mute");
|
||||||
addMenu(new LLObjectBuy(), "Object.Buy");
|
addMenu(new LLObjectBuy(), "Object.Buy");
|
||||||
@@ -9945,6 +9962,7 @@ void initialize_menus()
|
|||||||
addMenu(new ListTeleportTo, "List.TeleportTo");
|
addMenu(new ListTeleportTo, "List.TeleportTo");
|
||||||
addMenu(new ListAbuseReport(), "List.AbuseReport");
|
addMenu(new ListAbuseReport(), "List.AbuseReport");
|
||||||
addMenu(new ListIsNearby, "List.IsNearby");
|
addMenu(new ListIsNearby, "List.IsNearby");
|
||||||
|
addMenu(new ListFollow, "List.Follow");
|
||||||
addMenu(new ListGoTo, "List.GoTo");
|
addMenu(new ListGoTo, "List.GoTo");
|
||||||
addMenu(new ListTrack, "List.Track");
|
addMenu(new ListTrack, "List.Track");
|
||||||
addMenu(new ListEject(), "List.ParcelEject");
|
addMenu(new ListEject(), "List.ParcelEject");
|
||||||
|
|||||||
@@ -45,6 +45,11 @@
|
|||||||
<on_click function="List.InviteToGroup"/>
|
<on_click function="List.InviteToGroup"/>
|
||||||
<on_visible function="List.EnableAnySelected"/>
|
<on_visible function="List.EnableAnySelected"/>
|
||||||
</menu_item_call>
|
</menu_item_call>
|
||||||
|
<menu_item_call label="Follow" name="Follow">
|
||||||
|
<on_click function="List.Follow"/>
|
||||||
|
<on_enable function="List.EnableSingleSelected"/>
|
||||||
|
<on_visible function="List.IsNearby"/>
|
||||||
|
</menu_item_call>
|
||||||
<menu_item_call label="Move To" name="Move To">
|
<menu_item_call label="Move To" name="Move To">
|
||||||
<on_click function="List.GoTo"/>
|
<on_click function="List.GoTo"/>
|
||||||
<on_enable function="List.EnableSingleSelected"/>
|
<on_enable function="List.EnableSingleSelected"/>
|
||||||
|
|||||||
@@ -45,6 +45,10 @@
|
|||||||
<on_click function="List.InviteToGroup"/>
|
<on_click function="List.InviteToGroup"/>
|
||||||
<on_visible function="List.EnableAnySelected"/>
|
<on_visible function="List.EnableAnySelected"/>
|
||||||
</menu_item_call>
|
</menu_item_call>
|
||||||
|
<menu_item_call label="Follow" name="Follow">
|
||||||
|
<on_click function="List.Follow"/>
|
||||||
|
<on_visible function="List.IsNearby"/>
|
||||||
|
</menu_item_call>
|
||||||
<menu_item_call label="Move To" name="Move To">
|
<menu_item_call label="Move To" name="Move To">
|
||||||
<on_click function="List.GoTo"/>
|
<on_click function="List.GoTo"/>
|
||||||
<on_enable function="List.EnableSingleSelected"/>
|
<on_enable function="List.EnableSingleSelected"/>
|
||||||
|
|||||||
@@ -67,6 +67,9 @@
|
|||||||
<on_click function="ShowFloater" userdata="show inspect" />
|
<on_click function="ShowFloater" userdata="show inspect" />
|
||||||
<on_enable function="Object.EnableInspect" />
|
<on_enable function="Object.EnableInspect" />
|
||||||
</menu_item_call>
|
</menu_item_call>
|
||||||
|
<menu_item_call label="Follow" name="Follow">
|
||||||
|
<on_click function="Object.Follow"/>
|
||||||
|
</menu_item_call>
|
||||||
</pie_menu>
|
</pie_menu>
|
||||||
<menu_item_call enabled="false" label="Send IM..." mouse_opaque="true" name="Send IM...">
|
<menu_item_call enabled="false" label="Send IM..." mouse_opaque="true" name="Send IM...">
|
||||||
<on_click function="Avatar.SendIM" />
|
<on_click function="Avatar.SendIM" />
|
||||||
|
|||||||
@@ -79,6 +79,9 @@
|
|||||||
<menu_item_separator />
|
<menu_item_separator />
|
||||||
<menu_item_call enabled="true" label="Reload" mouse_opaque="true" name="Reload Textures">
|
<menu_item_call enabled="true" label="Reload" mouse_opaque="true" name="Reload Textures">
|
||||||
<on_click function="Object.ReloadTextures" />
|
<on_click function="Object.ReloadTextures" />
|
||||||
|
</menu_item_call>
|
||||||
|
<menu_item_call label="Follow" name="Follow">
|
||||||
|
<on_click function="Object.Follow"/>
|
||||||
</menu_item_call>
|
</menu_item_call>
|
||||||
</pie_menu>
|
</pie_menu>
|
||||||
<menu_item_call enabled="false" label="Mute" mouse_opaque="true" name="Object Mute">
|
<menu_item_call enabled="false" label="Mute" mouse_opaque="true" name="Object Mute">
|
||||||
|
|||||||
@@ -45,6 +45,10 @@
|
|||||||
<on_click function="List.InviteToGroup"/>
|
<on_click function="List.InviteToGroup"/>
|
||||||
<on_visible function="List.EnableAnySelected"/>
|
<on_visible function="List.EnableAnySelected"/>
|
||||||
</menu_item_call>
|
</menu_item_call>
|
||||||
|
<menu_item_call label="Follow" name="Follow">
|
||||||
|
<on_click function="List.Follow"/>
|
||||||
|
<on_visible function="List.IsNearby"/>
|
||||||
|
</menu_item_call>
|
||||||
<menu_item_call label="Move To" name="Move To">
|
<menu_item_call label="Move To" name="Move To">
|
||||||
<on_click function="List.GoTo"/>
|
<on_click function="List.GoTo"/>
|
||||||
<on_enable function="List.EnableSingleSelected"/>
|
<on_enable function="List.EnableSingleSelected"/>
|
||||||
|
|||||||
@@ -33,6 +33,10 @@
|
|||||||
<menu_item_call label="Invite To Group" name="Invite To Group">
|
<menu_item_call label="Invite To Group" name="Invite To Group">
|
||||||
<on_click function="List.InviteToGroup"/>
|
<on_click function="List.InviteToGroup"/>
|
||||||
</menu_item_call>
|
</menu_item_call>
|
||||||
|
<menu_item_call label="Follow" name="Follow">
|
||||||
|
<on_click function="List.Follow"/>
|
||||||
|
<on_visible function="List.IsNearby"/>
|
||||||
|
</menu_item_call>
|
||||||
<menu_item_call label="Move To" name="Move To">
|
<menu_item_call label="Move To" name="Move To">
|
||||||
<on_click function="List.GoTo"/>
|
<on_click function="List.GoTo"/>
|
||||||
<on_enable function="List.EnableSingleSelected"/>
|
<on_enable function="List.EnableSingleSelected"/>
|
||||||
|
|||||||
@@ -40,6 +40,10 @@
|
|||||||
<menu_item_call.on_click
|
<menu_item_call.on_click
|
||||||
function="Text.Url" userdata="Teleport" />
|
function="Text.Url" userdata="Teleport" />
|
||||||
</menu_item_call>
|
</menu_item_call>
|
||||||
|
<menu_item_call label="Follow" name="Follow">
|
||||||
|
<on_click function="List.Follow"/>
|
||||||
|
<on_visible function="List.IsNearby"/>
|
||||||
|
</menu_item_call>
|
||||||
<menu_item_call label="Move To" name="Move To">
|
<menu_item_call label="Move To" name="Move To">
|
||||||
<on_click function="List.GoTo"/>
|
<on_click function="List.GoTo"/>
|
||||||
<on_visible function="List.IsNearby"/>
|
<on_visible function="List.IsNearby"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user