diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index cd6e3f461..dfc1896d7 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -2233,6 +2233,17 @@ This should be as low as possible, but too low may break functionality IsCOA 1 + UISndRestart + + Comment + Sound file for region restarting (uuid for sound asset) + Persist + 1 + Type + String + Value + 1e506d0c-4811-bdf3-5ec7-d624284c9040 + UISndSnapshot Comment diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index ceea596b0..f532d5375 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -6434,7 +6434,6 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock) std::string regionMaturity = LLViewerRegion::accessToString(regionAccess); LLStringUtil::toLower(regionMaturity); llsdBlock["REGIONMATURITY"] = regionMaturity; - bool returnValue = false; LLNotificationPtr maturityLevelNotification; std::string notifySuffix = "_Notify"; @@ -6583,6 +6582,17 @@ void home_position_set() gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, FALSE); } +void add_time_arg(LLSD& args) +{ + static const LLCachedControl show_local_time("LiruLocalTime"); + // Get current UTC time, adjusted for the user's clock + // being off. + time_t utc_time = show_local_time ? time(NULL) : time_corrected(); + std::string timeStr; + timeStructToFormattedString(show_local_time ? std::localtime(&utc_time) : utc_to_pacific_time(utc_time, gPacificDaylightTime), gSavedSettings.getString("ShortTimeFormat"), timeStr); + args["TIME"] = timeStr; +} + bool attempt_standard_notification(LLMessageSystem* msgsystem) { // if we have additional alert data @@ -6654,6 +6664,11 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem) { LLViewerStats::getInstance()->incStat(LLViewerStats::ST_KILLED_COUNT); } + else if (notificationID == "RegionRestartMinutes" || notificationID == "RegionRestartSeconds") + { + add_time_arg(llsdBlock); + send_sound_trigger(LLUUID(gSavedSettings.getString("UISndRestart")), 1.0f); + } LLNotificationsUtil::add(notificationID, llsdBlock); return true; @@ -6712,7 +6727,6 @@ bool handle_not_age_verified_alert(const std::string &pAlertName) bool handle_special_alerts(const std::string &pAlertName) { bool isHandled = false; - if (LLStringUtil::compareStrings(pAlertName, "NotAgeVerified") == 0) { @@ -6763,14 +6777,18 @@ void process_alert_core(const std::string& message, BOOL modal) S32 mins = 0; LLStringUtil::convertToS32(text.substr(18), mins); args["MINUTES"] = llformat("%d",mins); + add_time_arg(args); LLNotificationsUtil::add("RegionRestartMinutes", args); + send_sound_trigger(LLUUID(gSavedSettings.getString("UISndRestart")), 1.0f); } else if (text.substr(0,17) == "RESTART_X_SECONDS") { S32 secs = 0; LLStringUtil::convertToS32(text.substr(18), secs); args["SECONDS"] = llformat("%d",secs); + add_time_arg(args); LLNotificationsUtil::add("RegionRestartSeconds", args); + send_sound_trigger(LLUUID(gSavedSettings.getString("UISndRestart")), 1.0f); } else { diff --git a/indra/newview/skins/default/xui/en-us/notifications.xml b/indra/newview/skins/default/xui/en-us/notifications.xml index 6ba816d7c..68df71296 100644 --- a/indra/newview/skins/default/xui/en-us/notifications.xml +++ b/indra/newview/skins/default/xui/en-us/notifications.xml @@ -6943,9 +6943,8 @@ This will add a bookmark in your inventory so you can quickly IM this resident. icon="notify.tga" name="RegionRestartMinutes" priority="high" - sound="UISndAlert" type="notify"> -Region is restarting in [MINUTES] minutes. +[TIME] This region will restart in [MINUTES] minutes. If you remain in this region you will be logged out. @@ -6953,9 +6952,8 @@ If you remain in this region you will be logged out. icon="notify.tga" name="RegionRestartSeconds" priority="high" - sound="UISndAlert" type="notify"> -Region is restarting in [SECONDS] seconds. +[TIME] This region will restart in [SECONDS] seconds. If you remain in this region you will be logged out.