Skip to content
Snippets Groups Projects
Commit 0afbc85e authored by Jonathan Yap's avatar Jonathan Yap
Browse files

STORM-1838 Minor UI improvements and code changes

parent 12182d7c
No related branches found
No related tags found
No related merge requests found
...@@ -399,43 +399,62 @@ void LLAvatarActions::pay(const LLUUID& id) ...@@ -399,43 +399,62 @@ void LLAvatarActions::pay(const LLUUID& id)
void LLAvatarActions::teleport_request_callback(const LLSD& notification, const LLSD& response) void LLAvatarActions::teleport_request_callback(const LLSD& notification, const LLSD& response)
{ {
LLMessageSystem* msg = gMessageSystem; S32 option;
if (response.isInteger())
msg->newMessageFast(_PREHASH_ImprovedInstantMessage); {
msg->nextBlockFast(_PREHASH_AgentData); option = response.asInteger();
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); }
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); else
{
msg->nextBlockFast(_PREHASH_MessageBlock); option = LLNotificationsUtil::getSelectedOption(notification, response);
msg->addBOOLFast(_PREHASH_FromGroup, FALSE); }
msg->addUUIDFast(_PREHASH_ToAgentID, notification["substitutions"]["uuid"] );
msg->addU8Fast(_PREHASH_Offline, IM_ONLINE);
msg->addU8Fast(_PREHASH_Dialog, IM_TELEPORT_REQUEST);
msg->addUUIDFast(_PREHASH_ID, LLUUID::null);
msg->addU32Fast(_PREHASH_Timestamp, NO_TIMESTAMP); // no timestamp necessary
std::string name;
LLAgentUI::buildFullname(name);
msg->addStringFast(_PREHASH_FromAgentName, name); if (0 == option)
msg->addStringFast(_PREHASH_Message, response["message"]); {
msg->addU32Fast(_PREHASH_ParentEstateID, 0); LLMessageSystem* msg = gMessageSystem;
msg->addUUIDFast(_PREHASH_RegionID, LLUUID::null);
msg->addVector3Fast(_PREHASH_Position, gAgent.getPositionAgent());
gMessageSystem->addBinaryDataFast( msg->newMessageFast(_PREHASH_ImprovedInstantMessage);
_PREHASH_BinaryBucket, msg->nextBlockFast(_PREHASH_AgentData);
EMPTY_BINARY_BUCKET, msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
EMPTY_BINARY_BUCKET_SIZE); msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_MessageBlock);
msg->addBOOLFast(_PREHASH_FromGroup, FALSE);
msg->addUUIDFast(_PREHASH_ToAgentID, notification["substitutions"]["uuid"] );
msg->addU8Fast(_PREHASH_Offline, IM_ONLINE);
msg->addU8Fast(_PREHASH_Dialog, IM_TELEPORT_REQUEST);
msg->addUUIDFast(_PREHASH_ID, LLUUID::null);
msg->addU32Fast(_PREHASH_Timestamp, NO_TIMESTAMP); // no timestamp necessary
std::string name;
LLAgentUI::buildFullname(name);
msg->addStringFast(_PREHASH_FromAgentName, name);
msg->addStringFast(_PREHASH_Message, response["message"]);
msg->addU32Fast(_PREHASH_ParentEstateID, 0);
msg->addUUIDFast(_PREHASH_RegionID, LLUUID::null);
msg->addVector3Fast(_PREHASH_Position, gAgent.getPositionAgent());
gMessageSystem->addBinaryDataFast(
_PREHASH_BinaryBucket,
EMPTY_BINARY_BUCKET,
EMPTY_BINARY_BUCKET_SIZE);
gAgent.sendReliableMessage(); gAgent.sendReliableMessage();
}
} }
// static // static
void LLAvatarActions::teleportRequest(const LLUUID& id) void LLAvatarActions::teleportRequest(const LLUUID& id)
{ {
std::string name;
gCacheName->getFullName(id, name);
gCacheName->cleanFullName(name);
LLSD notification; LLSD notification;
notification["uuid"] = id; notification["uuid"] = id;
notification["NAME"] = name + "'s";
LLSD payload; LLSD payload;
LLNotificationsUtil::add("TeleportRequestPrompt", notification, payload, teleport_request_callback); LLNotificationsUtil::add("TeleportRequestPrompt", notification, payload, teleport_request_callback);
......
...@@ -2936,7 +2936,8 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) ...@@ -2936,7 +2936,8 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
bool canUserAccessDstRegion = true; bool canUserAccessDstRegion = true;
bool doesUserRequireMaturityIncrease = false; bool doesUserRequireMaturityIncrease = false;
if (parse_lure_bucket(region_info, region_handle, pos, look_at, region_access)) // Do not parse the (empty) lure bucket for TELEPORT_REQUEST
if (IM_TELEPORT_REQUEST != dialog && parse_lure_bucket(region_info, region_handle, pos, look_at, region_access))
{ {
region_access_str = LLViewerRegion::accessToString(region_access); region_access_str = LLViewerRegion::accessToString(region_access);
region_access_icn = LLViewerRegion::getAccessIcon(region_access); region_access_icn = LLViewerRegion::getAccessIcon(region_access);
...@@ -6915,15 +6916,6 @@ bool teleport_request_callback(const LLSD& notification, const LLSD& response) ...@@ -6915,15 +6916,6 @@ bool teleport_request_callback(const LLSD& notification, const LLSD& response)
LLAvatarActions::startIM(from_id); LLAvatarActions::startIM(from_id);
} }
break; break;
/* // Block
case 3:
{
LLMute mute(from_id, from_name, LLMute::AGENT);
LLMuteList::getInstance()->add(mute);
LLPanelBlockedList::showPanelAndSelect(mute.mID);
}
break; */
} }
return false; return false;
} }
......
...@@ -3931,7 +3931,7 @@ Join me in [REGION] ...@@ -3931,7 +3931,7 @@ Join me in [REGION]
icon="alertmodal.tga" icon="alertmodal.tga"
name="TeleportRequestPrompt" name="TeleportRequestPrompt"
type="alertmodal"> type="alertmodal">
Request a teleport to their location with the following message Request a teleport to [NAME] location with the following message
<tag>confirm</tag> <tag>confirm</tag>
<form name="form"> <form name="form">
<input name="message" type="text"> <input name="message" type="text">
...@@ -6478,7 +6478,7 @@ Your object named &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt; has given you th ...@@ -6478,7 +6478,7 @@ Your object named &lt;nolink&gt;[OBJECTFROMNAME]&lt;/nolink&gt; has given you th
type="offer"> type="offer">
[NAME_SLURL] has offered to teleport you to their location: [NAME_SLURL] has offered to teleport you to their location:
[MESSAGE]” "[MESSAGE]”
&lt;icon&gt;[MATURITY_ICON]&lt;/icon&gt; - [MATURITY_STR] &lt;icon&gt;[MATURITY_ICON]&lt;/icon&gt; - [MATURITY_STR]
<tag>confirm</tag> <tag>confirm</tag>
<form name="form"> <form name="form">
...@@ -6543,7 +6543,7 @@ However, this region contains content accessible to adults only. ...@@ -6543,7 +6543,7 @@ However, this region contains content accessible to adults only.
[NAME_SLURL] is requesting to be teleported your to your location. [NAME_SLURL] is requesting to be teleported your to your location.
[MESSAGE] [MESSAGE]
Will you permit this? Offer a teleport?
<tag>confirm</tag> <tag>confirm</tag>
<form name="form"> <form name="form">
<button <button
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment