Add request teleport option to V2 chat header context menu & avatar SLURL context menu
parent
538e33331a
commit
8e3e639388
|
|
@ -37,7 +37,8 @@ enum EFSRegistrarFunctionActionType
|
|||
FS_RGSTR_ACT_OFFER_TELEPORT,
|
||||
FS_RGSTR_ACT_SHOW_PROFILE,
|
||||
FS_RGSTR_ACT_TRACK_AVATAR,
|
||||
FS_RGSTR_ACT_TELEPORT_TO
|
||||
FS_RGSTR_ACT_TELEPORT_TO,
|
||||
FS_RGSTR_ACT_REQUEST_TELEPORT
|
||||
};
|
||||
|
||||
class FSRegistrarUtils
|
||||
|
|
|
|||
|
|
@ -1914,6 +1914,7 @@ BOOL LLScrollListCtrl::handleRightMouseDown(S32 x, S32 y, MASK mask)
|
|||
registrar.add("FS.ZoomIn", boost::bind(&LLUrlAction::executeSLURL, "secondlife:///app/firestorm/" + id + "/zoom"));
|
||||
registrar.add("FS.TeleportToTarget", boost::bind(&LLUrlAction::executeSLURL, "secondlife:///app/firestorm/" + id + "/teleportto"));
|
||||
registrar.add("FS.OfferTeleport", boost::bind(&LLUrlAction::executeSLURL, "secondlife:///app/firestorm/" + id + "/offerteleport"));
|
||||
registrar.add("FS.RequestTeleport", boost::bind(&LLUrlAction::executeSLURL, "secondlife:///app/firestorm/" + id + "/requestteleport"));
|
||||
registrar.add("FS.TrackAvatar", boost::bind(&LLUrlAction::executeSLURL, "secondlife:///app/firestorm/" + id + "/track"));
|
||||
registrar.add("FS.AddToContactSet", boost::bind(&LLUrlAction::executeSLURL, "secondlife:///app/firestorm/" + id + "/addtocontactset")); // [FS:CR]
|
||||
// </FS:Ansariel> Additional convenience options
|
||||
|
|
@ -1928,6 +1929,7 @@ BOOL LLScrollListCtrl::handleRightMouseDown(S32 x, S32 y, MASK mask)
|
|||
enable_registrar.add("FS.EnableOfferTeleport", boost::bind(&FSRegistrarUtils::checkIsEnabled, gFSRegistrarUtils, uuid, FS_RGSTR_ACT_OFFER_TELEPORT));
|
||||
enable_registrar.add("FS.EnableTrackAvatar", boost::bind(&FSRegistrarUtils::checkIsEnabled, gFSRegistrarUtils, uuid, FS_RGSTR_ACT_TRACK_AVATAR));
|
||||
enable_registrar.add("FS.EnableTeleportToTarget", boost::bind(&FSRegistrarUtils::checkIsEnabled, gFSRegistrarUtils, uuid, FS_RGSTR_ACT_TELEPORT_TO));
|
||||
enable_registrar.add("FS.EnableRequestTeleport", boost::bind(&FSRegistrarUtils::checkIsEnabled, gFSRegistrarUtils, uuid, FS_RGSTR_ACT_REQUEST_TELEPORT));
|
||||
// </FS:Ansariel>
|
||||
|
||||
// create the context menu from the XUI file and display it
|
||||
|
|
|
|||
|
|
@ -2057,6 +2057,7 @@ void LLTextBase::createUrlContextMenu(S32 x, S32 y, const std::string &in_url)
|
|||
registrar.add("FS.ZoomIn", boost::bind(&LLUrlAction::executeSLURL, "secondlife:///app/firestorm/" + target_id_str + "/zoom"));
|
||||
registrar.add("FS.TeleportToTarget", boost::bind(&LLUrlAction::executeSLURL, "secondlife:///app/firestorm/" + target_id_str + "/teleportto"));
|
||||
registrar.add("FS.OfferTeleport", boost::bind(&LLUrlAction::executeSLURL, "secondlife:///app/firestorm/" + target_id_str + "/offerteleport"));
|
||||
registrar.add("FS.RequestTeleport", boost::bind(&LLUrlAction::executeSLURL, "secondlife:///app/firestorm/" + target_id_str + "/requestteleport"));
|
||||
registrar.add("FS.TrackAvatar", boost::bind(&LLUrlAction::executeSLURL, "secondlife:///app/firestorm/" + target_id_str + "/track"));
|
||||
registrar.add("FS.AddToContactSet", boost::bind(&LLUrlAction::executeSLURL, "secondlife:///app/firestorm/" + target_id_str + "/addtocontactset")); // [FS:CR]
|
||||
// </FS:Ansariel>
|
||||
|
|
@ -2072,6 +2073,7 @@ void LLTextBase::createUrlContextMenu(S32 x, S32 y, const std::string &in_url)
|
|||
enable_registrar.add("FS.EnableOfferTeleport", boost::bind(&FSRegistrarUtils::checkIsEnabled, gFSRegistrarUtils, target_id, FS_RGSTR_ACT_OFFER_TELEPORT));
|
||||
enable_registrar.add("FS.EnableTrackAvatar", boost::bind(&FSRegistrarUtils::checkIsEnabled, gFSRegistrarUtils, target_id, FS_RGSTR_ACT_TRACK_AVATAR));
|
||||
enable_registrar.add("FS.EnableTeleportToTarget", boost::bind(&FSRegistrarUtils::checkIsEnabled, gFSRegistrarUtils, target_id, FS_RGSTR_ACT_TELEPORT_TO));
|
||||
enable_registrar.add("FS.EnableRequestTeleport", boost::bind(&FSRegistrarUtils::checkIsEnabled, gFSRegistrarUtils, target_id, FS_RGSTR_ACT_REQUEST_TELEPORT));
|
||||
// </FS:Ansariel>
|
||||
|
||||
// create and return the context menu from the XUI file
|
||||
|
|
|
|||
|
|
@ -206,6 +206,10 @@ public:
|
|||
{
|
||||
LLAvatarActions::offerTeleport(getAvatarId());
|
||||
}
|
||||
else if (level == "request_teleport")
|
||||
{
|
||||
LLAvatarActions::teleportRequest(getAvatarId());
|
||||
}
|
||||
else if (level == "voice_call")
|
||||
{
|
||||
LLAvatarActions::startCall(getAvatarId());
|
||||
|
|
@ -276,62 +280,10 @@ public:
|
|||
{
|
||||
return LLMuteList::getInstance()->isMuted(getAvatarId(), LLMute::flagVoiceChat);
|
||||
}
|
||||
else if (level == "is_muted")
|
||||
if (level == "is_muted")
|
||||
{
|
||||
return LLMuteList::getInstance()->isMuted(getAvatarId(), LLMute::flagTextChat);
|
||||
}
|
||||
else if (level == "can_view_profile")
|
||||
{
|
||||
return FSCommon::checkIsActionEnabled(getAvatarId(), FS_RGSTR_ACT_SHOW_PROFILE);
|
||||
}
|
||||
else if (level == "can_im")
|
||||
{
|
||||
return FSCommon::checkIsActionEnabled(getAvatarId(), FS_RGSTR_ACT_SEND_IM);
|
||||
}
|
||||
else if (level == "can_offer_teleport")
|
||||
{
|
||||
return FSCommon::checkIsActionEnabled(getAvatarId(), FS_RGSTR_ACT_OFFER_TELEPORT);
|
||||
}
|
||||
else if (level == "can_teleport_to")
|
||||
{
|
||||
return FSCommon::checkIsActionEnabled(getAvatarId(), FS_RGSTR_ACT_TELEPORT_TO);
|
||||
}
|
||||
else if (level == "can_voice_call")
|
||||
{
|
||||
return (gAgentID != getAvatarId() && LLAvatarActions::canCall());
|
||||
}
|
||||
else if (level == "can_show_history")
|
||||
{
|
||||
return (gAgentID != getAvatarId());
|
||||
}
|
||||
else if (level == "can_zoom_in")
|
||||
{
|
||||
return FSCommon::checkIsActionEnabled(getAvatarId(), FS_RGSTR_ACT_ZOOM_IN);
|
||||
}
|
||||
else if (level == "can_track")
|
||||
{
|
||||
return FSCommon::checkIsActionEnabled(getAvatarId(), FS_RGSTR_ACT_TRACK_AVATAR);
|
||||
}
|
||||
else if (level == "can_share")
|
||||
{
|
||||
return (gAgentID != getAvatarId());
|
||||
}
|
||||
else if (level == "can_pay")
|
||||
{
|
||||
return (gAgentID != getAvatarId());
|
||||
}
|
||||
else if (level == "can_block")
|
||||
{
|
||||
return (gAgentID != getAvatarId());
|
||||
}
|
||||
else if (level == "can_mute")
|
||||
{
|
||||
return (gAgentID != getAvatarId());
|
||||
}
|
||||
else if (level == "can_invite_to_group")
|
||||
{
|
||||
return (gAgentID != getAvatarId());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -689,13 +641,35 @@ protected:
|
|||
menu->setItemEnabled("Add Friend", false);
|
||||
menu->setItemEnabled("Send IM", false);
|
||||
menu->setItemEnabled("Remove Friend", false);
|
||||
menu->setItemEnabled("Offer Teleport",false);
|
||||
menu->setItemEnabled("Request Teleport",false);
|
||||
menu->setItemEnabled("Teleport to",false);
|
||||
menu->setItemEnabled("Voice Call", false);
|
||||
menu->setItemEnabled("Add Contact Set", false);
|
||||
menu->setItemEnabled("Invite Group", false);
|
||||
menu->setItemEnabled("Zoom In", false);
|
||||
menu->setItemEnabled("track", false);
|
||||
menu->setItemEnabled("Share", false);
|
||||
menu->setItemEnabled("Pay", false);
|
||||
menu->setItemEnabled("Block Unblock", false);
|
||||
menu->setItemEnabled("Mute Text", false);
|
||||
}
|
||||
|
||||
if (mSessionID == LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, mAvatarID))
|
||||
else
|
||||
{
|
||||
menu->setItemVisible("Send IM", false);
|
||||
menu->setItemEnabled("Send IM", FSCommon::checkIsActionEnabled(mAvatarID, FS_RGSTR_ACT_SEND_IM));
|
||||
menu->setItemEnabled("Show Profile", FSCommon::checkIsActionEnabled(mAvatarID, FS_RGSTR_ACT_SHOW_PROFILE));
|
||||
menu->setItemEnabled("Teleport to", FSCommon::checkIsActionEnabled(mAvatarID, FS_RGSTR_ACT_TELEPORT_TO));
|
||||
menu->setItemEnabled("Offer Teleport", LLAvatarActions::canOfferTeleport(mAvatarID));
|
||||
menu->setItemEnabled("Request Teleport", LLAvatarActions::canOfferTeleport(mAvatarID));
|
||||
menu->setItemEnabled("Voice Call", LLAvatarActions::canCall());
|
||||
menu->setItemEnabled("Zoom In", FSCommon::checkIsActionEnabled(mAvatarID, FS_RGSTR_ACT_ZOOM_IN));
|
||||
menu->setItemEnabled("track", FSCommon::checkIsActionEnabled(mAvatarID, FS_RGSTR_ACT_TRACK_AVATAR));
|
||||
menu->setItemEnabled("Block Unblock", LLAvatarActions::canBlock(mAvatarID));
|
||||
menu->setItemEnabled("Mute Text", LLAvatarActions::canBlock(mAvatarID));
|
||||
}
|
||||
|
||||
menu->setItemEnabled("Chat History", LLLogChat::isTranscriptExist(mAvatarID));
|
||||
menu->setItemEnabled("Map", (LLAvatarTracker::instance().isBuddyOnline(mAvatarID) && is_agent_mappable(mAvatarID)) || gAgent.isGodlike() );
|
||||
menu->buildDrawLabels();
|
||||
menu->updateParent(LLMenuGL::sMenuContainer);
|
||||
LLMenuGL::showPopup(this, menu, x, y);
|
||||
|
|
|
|||
|
|
@ -318,7 +318,7 @@ bool FSCommon::checkIsActionEnabled(const LLUUID& av_id, EFSRegistrarFunctionAct
|
|||
{
|
||||
return (!isSelf && LLAvatarActions::canZoomIn(av_id));
|
||||
}
|
||||
else if (action == FS_RGSTR_ACT_OFFER_TELEPORT)
|
||||
else if (action == FS_RGSTR_ACT_OFFER_TELEPORT || action == FS_RGSTR_ACT_REQUEST_TELEPORT)
|
||||
{
|
||||
return (!isSelf && LLAvatarActions::canOfferTeleport(av_id));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,6 +80,16 @@ public:
|
|||
return true;
|
||||
}
|
||||
|
||||
if (verb == "requestteleport")
|
||||
{
|
||||
if (gAgentID != target_id)
|
||||
{
|
||||
LLAvatarActions::teleportRequest(target_id);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if (verb == "teleportto")
|
||||
{
|
||||
if (gAgentID != target_id)
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@
|
|||
<menu_item_call.on_click
|
||||
function="AvatarIcon.Action"
|
||||
parameter="profile" />
|
||||
<on_enable function="AvatarIcon.Check" parameter="can_view_profile" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="IM"
|
||||
|
|
@ -24,41 +23,36 @@
|
|||
<menu_item_call.on_click
|
||||
function="AvatarIcon.Action"
|
||||
parameter="im" />
|
||||
<on_enable function="AvatarIcon.Check" parameter="can_im" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Teleport to resident"
|
||||
layout="topleft"
|
||||
name="Teleport to">
|
||||
<on_click function="AvatarIcon.Action" parameter="teleport_to"/>
|
||||
<on_enable function="AvatarIcon.Check" parameter="can_teleport_to" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Offer teleport"
|
||||
layout="topleft"
|
||||
name="Offer Teleport">
|
||||
<on_click function="AvatarIcon.Action" parameter="teleport"/>
|
||||
<on_enable function="AvatarIcon.Check" parameter="can_offer_teleport" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Request Teleport"
|
||||
layout="topleft"
|
||||
name="Request Teleport">
|
||||
<on_click function="AvatarIcon.Action" parameter="request_teleport"/>
|
||||
<on_click function="AvatarIcon.Action" parameter="request_teleport"/>
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Voice call"
|
||||
layout="topleft"
|
||||
name="Voice Call">
|
||||
<on_click function="AvatarIcon.Action" parameter="voice_call"/>
|
||||
<on_enable function="AvatarIcon.Check" parameter="can_voice_call" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Chat history..."
|
||||
layout="topleft"
|
||||
name="Chat History">
|
||||
<on_click function="AvatarIcon.Action" parameter="chat_history"/>
|
||||
<on_enable function="AvatarIcon.Check" parameter="can_show_history" />
|
||||
</menu_item_call>
|
||||
<menu_item_separator layout="topleft" name="separator_chat_history"/>
|
||||
<menu_item_call
|
||||
|
|
@ -90,7 +84,6 @@
|
|||
layout="topleft"
|
||||
name="Invite Group">
|
||||
<on_click function="AvatarIcon.Action" parameter="invite_to_group" />
|
||||
<on_enable function="AvatarIcon.Check" parameter="can_invite_to_group" />
|
||||
</menu_item_call>
|
||||
<menu_item_separator layout="topleft" name="separator_invite_to_group"/>
|
||||
<menu_item_call
|
||||
|
|
@ -98,7 +91,6 @@
|
|||
layout="topleft"
|
||||
name="Zoom In">
|
||||
<on_click function="AvatarIcon.Action" parameter="zoom_in" />
|
||||
<on_enable function="AvatarIcon.Check" parameter="can_zoom_in" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Map"
|
||||
|
|
@ -111,21 +103,18 @@
|
|||
layout="topleft"
|
||||
name="track">
|
||||
<on_click function="AvatarIcon.Action" parameter="track" />
|
||||
<on_enable function="AvatarIcon.Check" parameter="can_track" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Share"
|
||||
layout="topleft"
|
||||
name="Share">
|
||||
<on_click function="AvatarIcon.Action" parameter="share" />
|
||||
<on_enable function="AvatarIcon.Check" parameter="can_share" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Pay"
|
||||
layout="topleft"
|
||||
name="Pay">
|
||||
<on_click function="AvatarIcon.Action" parameter="pay" />
|
||||
<on_enable function="AvatarIcon.Check" parameter="can_pay" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Copy Name to clipboard"
|
||||
|
|
@ -146,7 +135,6 @@
|
|||
name="Block Unblock">
|
||||
<on_click function="AvatarIcon.Action" parameter="block_unblock" />
|
||||
<on_check function="AvatarIcon.Check" parameter="is_blocked" />
|
||||
<on_enable function="AvatarIcon.Check" parameter="can_block" />
|
||||
</menu_item_check>
|
||||
<menu_item_check
|
||||
label="Block Text"
|
||||
|
|
@ -154,6 +142,5 @@
|
|||
name="Mute Text">
|
||||
<on_click function="AvatarIcon.Action" parameter="mute_unmute" />
|
||||
<on_check function="AvatarIcon.Check" parameter="is_muted" />
|
||||
<on_enable function="AvatarIcon.Check" parameter="can_mute" />
|
||||
</menu_item_check>
|
||||
</menu>
|
||||
|
|
|
|||
|
|
@ -66,6 +66,15 @@
|
|||
<menu_item_call.on_enable
|
||||
function="FS.EnableOfferTeleport" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Request Teleport"
|
||||
layout="topleft"
|
||||
name="request_teleport">
|
||||
<menu_item_call.on_click
|
||||
function="FS.RequestTeleport" />
|
||||
<menu_item_call.on_enable
|
||||
function="FS.EnableRequestTeleport" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Track Resident"
|
||||
layout="topleft"
|
||||
|
|
|
|||
Loading…
Reference in New Issue