summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorTodd Stinson <stinson@lindenlab.com>2012-05-29 19:10:13 -0700
committerTodd Stinson <stinson@lindenlab.com>2012-05-29 19:10:13 -0700
commit8f4848ca2ea02bb60caaf9fd08c9f55075dbcd9a (patch)
tree2d19c95cbd84a2c463fc4165cddc0137a342403f /indra/newview
parentfbf01e9c2a919fb51df2c6d71fa9d673ca69c1a8 (diff)
EXP-1950: Breaking out the dialogs into 2 paths so that teleports can report messages with slightly different wordings.
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llviewermessage.cpp76
-rw-r--r--indra/newview/skins/default/xui/en/notifications.xml98
2 files changed, 156 insertions, 18 deletions
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 74cd635a75..4a0de81eb1 100755
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -5448,8 +5448,71 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock)
}
else if (gAgent.prefersPG())
{
- if ((LLStringUtil::compareStrings(notificationID, "RegionEntryAccessBlocked") == 0) &&
- gAgent.hasRestartableFailedTeleportRequest())
+ maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback);
+ returnValue = true;
+ }
+ else if (LLStringUtil::compareStrings(notificationID, "RegionEntryAccessBlocked") == 0)
+ {
+ maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_PreferencesOutOfSync", llsdBlock, llsdBlock);
+ returnValue = true;
+ }
+ }
+ else if (regionAccess == SIM_ACCESS_ADULT)
+ {
+ if (!gAgent.isAdult())
+ {
+ gAgent.clearTeleportRequest();
+ maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_AdultsOnlyContent", llsdBlock);
+ returnValue = true;
+
+ notifySuffix = "_NotifyAdultsOnly";
+ }
+ else if (gAgent.prefersPG() || gAgent.prefersMature())
+ {
+ maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_Change", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback);
+ returnValue = true;
+ }
+ else if (LLStringUtil::compareStrings(notificationID, "RegionEntryAccessBlocked") == 0)
+ {
+ maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_PreferencesOutOfSync", llsdBlock, llsdBlock);
+ returnValue = true;
+ }
+ }
+
+ if ((maturityLevelNotification == NULL) || maturityLevelNotification->isIgnored())
+ {
+ // Given a simple notification if no maturityLevelNotification is set or it is ignore
+ LLNotificationsUtil::add(notificationID + notifySuffix, llsdBlock);
+ }
+
+ return returnValue;
+}
+
+// some of the server notifications need special handling. This is where we do that.
+bool handle_teleport_access_blocked(LLSD& llsdBlock)
+{
+ std::string notificationID("TeleportEntryAccessBlocked");
+ U8 regionAccess = static_cast<U8>(llsdBlock["_region_access"].asInteger());
+ std::string regionMaturity = LLViewerRegion::accessToString(regionAccess);
+ LLStringUtil::toLower(regionMaturity);
+ llsdBlock["REGIONMATURITY"] = regionMaturity;
+
+ bool returnValue = false;
+ LLNotificationPtr maturityLevelNotification;
+ std::string notifySuffix = "_Notify";
+ if (regionAccess == SIM_ACCESS_MATURE)
+ {
+ if (gAgent.isTeen())
+ {
+ gAgent.clearTeleportRequest();
+ maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_AdultsOnlyContent", llsdBlock);
+ returnValue = true;
+
+ notifySuffix = "_NotifyAdultsOnly";
+ }
+ else if (gAgent.prefersPG())
+ {
+ if (gAgent.hasRestartableFailedTeleportRequest())
{
maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_ChangeAndReTeleport", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_and_reteleport_callback);
returnValue = true;
@@ -5461,7 +5524,7 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock)
returnValue = true;
}
}
- else if (LLStringUtil::compareStrings(notificationID, "RegionEntryAccessBlocked") == 0)
+ else
{
gAgent.clearTeleportRequest();
maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_PreferencesOutOfSync", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback);
@@ -5480,8 +5543,7 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock)
}
else if (gAgent.prefersPG() || gAgent.prefersMature())
{
- if ((LLStringUtil::compareStrings(notificationID, "RegionEntryAccessBlocked") == 0) &&
- gAgent.hasRestartableFailedTeleportRequest())
+ if (gAgent.hasRestartableFailedTeleportRequest())
{
maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_ChangeAndReTeleport", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_and_reteleport_callback);
returnValue = true;
@@ -5493,7 +5555,7 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock)
returnValue = true;
}
}
- else if (LLStringUtil::compareStrings(notificationID, "RegionEntryAccessBlocked") == 0)
+ else
{
gAgent.clearTeleportRequest();
maturityLevelNotification = LLNotificationsUtil::add(notificationID+"_PreferencesOutOfSync", llsdBlock, llsdBlock, handle_prompt_for_maturity_level_change_callback);
@@ -6275,7 +6337,7 @@ void process_teleport_failed(LLMessageSystem *msg, void**)
else
{
// change notification name in this special case
- if (handle_special_notification("RegionEntryAccessBlocked", llsd_block))
+ if (handle_teleport_access_blocked(llsd_block))
{
if( gAgent.getTeleportState() != LLAgent::TELEPORT_NONE )
{
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 9c08ef147b..1b4123efaa 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -4090,7 +4090,7 @@ Are you sure you want to change the Estate Covenant?
name="okcancelignore"
yestext="Go to Knowledge Base"
notext="Close"
- ignoretext="The region you&apos;re trying to visit contains content, which is accessible to adults only."/>
+ ignoretext="Region crossing: The region you&apos;re trying to visit contains content, which is accessible to adults only."/>
</notification>
<notification
@@ -4111,12 +4111,88 @@ The region you're trying to visit contains [REGIONMATURITY] content, but your cu
<notification
icon="alertmodal.tga"
- name="RegionEntryAccessBlocked_ChangeAndReTeleport"
+ name="RegionEntryAccessBlocked_Change"
type="alertmodal">
- <tag>fail</tag>
+ <tag>fail</tag>
<tag>confirm</tag>
-The region you're trying to visit contains [REGIONMATURITY] content, but your current preferences are set to exclude [REGIONMATURITY] content. We can change your preferences and continue with the teleport, or you can cancel this teleport.
- <form name="form">
+The region you're trying to visit contains [REGIONMATURITY] content, but your current preferences are set to exclude [REGIONMATURITY] content. We can change your preferences, or you can cancel. After your preferences are changed, you may attempt enter the region again.
+ <form name="form">
+ <button
+ index="0"
+ name="OK"
+ text="Change preferences"/>
+ <button
+ default="true"
+ index="1"
+ name="Cancel"
+ text="Cancel"/>
+ <ignore name="ignore" text="Region crossing: The region you&apos;re trying to visit contains content excluded by your preferences."/>
+ </form>
+ </notification>
+
+ <notification
+ icon="alertmodal.tga"
+ name="RegionEntryAccessBlocked_PreferencesOutOfSync"
+ type="alertmodal">
+ <tag>fail</tag>
+ We are having technical difficulties with your teleport because your preferences are out of sync with the server.
+ <usetemplate
+ name="okbutton"
+ yestext="OK"/>
+ </notification>
+
+ <notification
+ icon="alertmodal.tga"
+ name="TeleportEntryAccessBlocked"
+ type="alertmodal">
+ <tag>fail</tag>
+ The region you're trying to visit contains content exceeding your current preferences. You can change your preferences using Me &gt; Preferences &gt; General.
+ <usetemplate
+ name="okbutton"
+ yestext="OK"/>
+ </notification>
+
+ <notification
+ icon="alertmodal.tga"
+ name="TeleportEntryAccessBlocked_AdultsOnlyContent"
+ type="alertmodal">
+ <tag>fail</tag>
+ <tag>confirm</tag>
+ The region you're trying to visit contains [REGIONMATURITY] content, which is accessible to adults only.
+ <url option="0" name="url">
+ http://wiki.secondlife.com/wiki/Linden_Lab_Official:Maturity_ratings:_an_overview
+ </url>
+ <usetemplate
+ name="okcancelignore"
+ yestext="Go to Knowledge Base"
+ notext="Close"
+ ignoretext="Teleport: The region you&apos;re trying to visit contains content, which is accessible to adults only."/>
+ </notification>
+
+ <notification
+ icon="notifytip.tga"
+ name="TeleportEntryAccessBlocked_Notify"
+ type="notifytip">
+ <tag>fail</tag>
+ The region you're trying to visit contains [REGIONMATURITY] content, but your current preferences are set to exclude [REGIONMATURITY] content.
+ </notification>
+
+ <notification
+ icon="notifytip.tga"
+ name="RegionEntryAccessBlocked_NotifyAdultsOnly"
+ type="notifytip">
+ <tag>fail</tag>
+ The region you're trying to visit contains content, which is accessible to adults only.
+ </notification>
+
+ <notification
+ icon="alertmodal.tga"
+ name="TeleportEntryAccessBlocked_ChangeAndReTeleport"
+ type="alertmodal">
+ <tag>fail</tag>
+ <tag>confirm</tag>
+ The region you're trying to visit contains [REGIONMATURITY] content, but your current preferences are set to exclude [REGIONMATURITY] content. We can change your preferences and continue with the teleport, or you can cancel this teleport.
+ <form name="form">
<button
index="0"
name="OK"
@@ -4126,34 +4202,34 @@ The region you're trying to visit contains [REGIONMATURITY] content, but your cu
index="1"
name="Cancel"
text="Cancel"/>
- <ignore name="ignore" text="The region you&apos;re trying to visit contains content excluded by your preferences. We can change your preferences and continue with the teleport."/>
+ <ignore name="ignore" text="Teleport (restartable): The region you&apos;re trying to visit contains content excluded by your preferences."/>
</form>
</notification>
<notification
icon="alertmodal.tga"
- name="RegionEntryAccessBlocked_Change"
+ name="TeleportEntryAccessBlocked_Change"
type="alertmodal">
<tag>fail</tag>
<tag>confirm</tag>
-The region you're trying to visit contains [REGIONMATURITY] content, but your current preferences are set to exclude [REGIONMATURITY] content. We can change your preferences, or you can cancel the teleport. After your preferences are changed, you will need to attempt the teleport again.
+ The region you're trying to visit contains [REGIONMATURITY] content, but your current preferences are set to exclude [REGIONMATURITY] content. We can change your preferences, or you can cancel the teleport. After your preferences are changed, you will need to attempt the teleport again.
<form name="form">
<button
index="0"
name="OK"
text="Change preferences"/>
- <button
+ <button
default="true"
index="1"
name="Cancel"
text="Cancel"/>
- <ignore name="ignore" text="The region you&apos;re trying to visit contains content excluded by your preferences. We can change your preferences. Then, you will need to attempt the teleport again."/>
+ <ignore name="ignore" text="Teleport (non-restartable): The region you&apos;re trying to visit contains content excluded by your preferences."/>
</form>
</notification>
<notification
icon="alertmodal.tga"
- name="RegionEntryAccessBlocked_PreferencesOutOfSync"
+ name="TeleportEntryAccessBlocked_PreferencesOutOfSync"
type="alertmodal">
<tag>fail</tag>
We are having technical difficulties with your teleport because your preferences are out of sync with the server.