From 8f4848ca2ea02bb60caaf9fd08c9f55075dbcd9a Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Tue, 29 May 2012 19:10:13 -0700 Subject: EXP-1950: Breaking out the dialogs into 2 paths so that teleports can report messages with slightly different wordings. --- indra/newview/llviewermessage.cpp | 76 +++++++++++++++-- .../newview/skins/default/xui/en/notifications.xml | 98 +++++++++++++++++++--- 2 files changed, 156 insertions(+), 18 deletions(-) (limited to 'indra/newview') 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(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're trying to visit contains content, which is accessible to adults only."/> + ignoretext="Region crossing: The region you're trying to visit contains content, which is accessible to adults only."/> - fail + fail confirm -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. -
+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. + +