From caaaa1e5e6444fa7d96a5bda792cea797b716282 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Tue, 5 Nov 2013 10:01:41 -0500 Subject: STORM-1980 Play sound for region restarting message --- indra/newview/llviewermessage.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index ab9ea5618e..ebc6ff8165 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -6085,6 +6085,7 @@ void process_alert_core(const std::string& message, BOOL modal) LLStringUtil::convertToS32(text.substr(18), mins); args["MINUTES"] = llformat("%d",mins); LLNotificationsUtil::add("RegionRestartMinutes", args); + send_sound_trigger(LLUUID(gSavedSettings.getString("UISndAlert")), 1.0f); } else if (text.substr(0,17) == "RESTART_X_SECONDS") { @@ -6092,6 +6093,7 @@ void process_alert_core(const std::string& message, BOOL modal) LLStringUtil::convertToS32(text.substr(18), secs); args["SECONDS"] = llformat("%d",secs); LLNotificationsUtil::add("RegionRestartSeconds", args); + send_sound_trigger(LLUUID(gSavedSettings.getString("UISndAlert")), 1.0f); } else { -- cgit v1.2.3 From ceb15e6edeed5d0e1fb7eaab9bc5b1592a252303 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Tue, 5 Nov 2013 15:45:48 -0500 Subject: STORM-1980/1983 Add time to region restarting message --- indra/newview/llviewermessage.cpp | 48 ++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 26 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index ebc6ff8165..bcd535bb90 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5748,7 +5748,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"; @@ -5918,6 +5917,7 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem) (notificationID == "RegionEntryAccessBlocked") || (notificationID == "LandClaimAccessBlocked") || (notificationID == "LandBuyAccessBlocked") + ) { /*--------------------------------------------------------------------- @@ -5959,7 +5959,23 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem) snap_filename += SCREEN_HOME_FILENAME; gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, FALSE); } - + + if (notificationID == "RegionRestartMinutes" || + notificationID == "RegionRestartSeconds") + { + // Get current UTC time, adjusted for the user's clock + // being off. + time_t utc_time; + utc_time = time_corrected(); + std::string timeStr = LLTrans::getString("ViewerMessageTime"); + LLSD substitution; + substitution["datetime"] = (S32) utc_time; + LLStringUtil::format(timeStr, substitution); + llsdBlock["TIME"] = timeStr; + + send_sound_trigger(LLUUID(gSavedSettings.getString("UISndAlert")), 1.0f); + } + LLNotificationsUtil::add(notificationID, llsdBlock); return true; } @@ -6019,7 +6035,6 @@ void process_alert_message(LLMessageSystem *msgsystem, void **user_data) std::string message; msgsystem->getStringFast(_PREHASH_AlertData, _PREHASH_Message, message); - process_special_alert_messages(message); if (!attempt_standard_notification(msgsystem)) @@ -6043,7 +6058,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) { @@ -6079,28 +6093,10 @@ void process_alert_core(const std::string& message, BOOL modal) // System message is important, show in upper-right box not tip std::string text(message.substr(1)); LLSD args; - if (text.substr(0,17) == "RESTART_X_MINUTES") - { - S32 mins = 0; - LLStringUtil::convertToS32(text.substr(18), mins); - args["MINUTES"] = llformat("%d",mins); - LLNotificationsUtil::add("RegionRestartMinutes", args); - send_sound_trigger(LLUUID(gSavedSettings.getString("UISndAlert")), 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); - LLNotificationsUtil::add("RegionRestartSeconds", args); - send_sound_trigger(LLUUID(gSavedSettings.getString("UISndAlert")), 1.0f); - } - else - { - std::string new_msg =LLNotifications::instance().getGlobalString(text); - args["MESSAGE"] = new_msg; - LLNotificationsUtil::add("SystemMessage", args); - } + + std::string new_msg =LLNotifications::instance().getGlobalString(text); + args["MESSAGE"] = new_msg; + LLNotificationsUtil::add("SystemMessage", args); } else if (modal) { -- cgit v1.2.3 From 7d4deed8bef62cee1fc782a9676505136b231412 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Tue, 5 Nov 2013 17:47:00 -0500 Subject: STORM-1980/1983 Attempt to test alert message with a new uploaded sound --- indra/newview/llviewermessage.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index bcd535bb90..51260c98cd 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5960,21 +5960,21 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem) gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, FALSE); } - if (notificationID == "RegionRestartMinutes" || - notificationID == "RegionRestartSeconds") - { - // Get current UTC time, adjusted for the user's clock - // being off. - time_t utc_time; - utc_time = time_corrected(); - std::string timeStr = LLTrans::getString("ViewerMessageTime"); - LLSD substitution; - substitution["datetime"] = (S32) utc_time; - LLStringUtil::format(timeStr, substitution); - llsdBlock["TIME"] = timeStr; + if (notificationID == "RegionRestartMinutes" || + notificationID == "RegionRestartSeconds") + { + // Get current UTC time, adjusted for the user's clock + // being off. + time_t utc_time; + utc_time = time_corrected(); + std::string timeStr = LLTrans::getString("ViewerMessageTime"); + LLSD substitution; + substitution["datetime"] = (S32) utc_time; + LLStringUtil::format(timeStr, substitution); + llsdBlock["TIME"] = timeStr; - send_sound_trigger(LLUUID(gSavedSettings.getString("UISndAlert")), 1.0f); - } + send_sound_trigger(LLUUID("4b315701-1972-9e23-cdd8-23cbc8cb0f42"), 1.0f); + } LLNotificationsUtil::add(notificationID, llsdBlock); return true; -- cgit v1.2.3 From 21ff4de02669f04ca9afec8d3f5aa0b68864fd13 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Tue, 5 Nov 2013 17:57:56 -0500 Subject: STORM-1980/1983 Revert previous change --- indra/newview/llviewermessage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 51260c98cd..f66b3ba805 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5973,7 +5973,7 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem) LLStringUtil::format(timeStr, substitution); llsdBlock["TIME"] = timeStr; - send_sound_trigger(LLUUID("4b315701-1972-9e23-cdd8-23cbc8cb0f42"), 1.0f); + send_sound_trigger(LLUUID(gSavedSettings.getString("UISndAlert")), 1.0f); } LLNotificationsUtil::add(notificationID, llsdBlock); -- cgit v1.2.3 From 662efccfb821c2bf61c286aeec97563d7f95a9f8 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Wed, 6 Nov 2013 15:11:11 -0500 Subject: STORM-1980/1983 Add debug setting UISndRestart and value. This UUID will need to be replaced with an official UUID once one has been established. --- indra/newview/llviewermessage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index f66b3ba805..48bfdc03ac 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5973,7 +5973,7 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem) LLStringUtil::format(timeStr, substitution); llsdBlock["TIME"] = timeStr; - send_sound_trigger(LLUUID(gSavedSettings.getString("UISndAlert")), 1.0f); + send_sound_trigger(LLUUID(gSavedSettings.getString("UISndRestart")), 1.0f); } LLNotificationsUtil::add(notificationID, llsdBlock); -- cgit v1.2.3 From 3e429c1e11ab5d9a3279598fd671cee230d40afd Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Fri, 8 Nov 2013 16:15:36 -0500 Subject: STORM-1980/1983 Small XML cleanup. Changed notification type to Alert. Addes seconds field to notification message. --- indra/newview/llviewermessage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 48bfdc03ac..805b3aab18 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5967,7 +5967,7 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem) // being off. time_t utc_time; utc_time = time_corrected(); - std::string timeStr = LLTrans::getString("ViewerMessageTime"); + std::string timeStr = LLTrans::getString("HMSTime"); LLSD substitution; substitution["datetime"] = (S32) utc_time; LLStringUtil::format(timeStr, substitution); -- cgit v1.2.3 From 1e9cfd39c8441fad71ed7171ac93bdeb1d02e54b Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Fri, 15 Nov 2013 11:49:35 -0500 Subject: STORM-1980 Added a floater displaying a countdown timer. Removed most of the previous changes. --- indra/newview/llviewermessage.cpp | 41 ++++++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 9 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 805b3aab18..ac652ef329 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -110,6 +110,7 @@ #include "llpanelblockedlist.h" #include "llpanelplaceprofile.h" #include "llviewerregion.h" +#include "llfloaterregionrestarting.h" #include // #include @@ -5963,15 +5964,30 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem) if (notificationID == "RegionRestartMinutes" || notificationID == "RegionRestartSeconds") { - // Get current UTC time, adjusted for the user's clock - // being off. - time_t utc_time; - utc_time = time_corrected(); - std::string timeStr = LLTrans::getString("HMSTime"); - LLSD substitution; - substitution["datetime"] = (S32) utc_time; - LLStringUtil::format(timeStr, substitution); - llsdBlock["TIME"] = timeStr; + U32 seconds; + if (notificationID == "RegionRestartMinutes") + { + seconds = 60 * static_cast(llsdBlock["MINUTES"].asInteger()); + } + else + { + seconds = static_cast(llsdBlock["SECONDS"].asInteger()); + } + + LLSD params; + params["NAME"] = llsdBlock["NAME"]; + params["SECONDS"] = (LLSD::Integer)seconds; + + LLFloaterRegionRestarting* floaterp = LLFloaterReg::findTypedInstance("region_restarting"); + + if (floaterp) + { + LLFloaterRegionRestarting::updateTime(seconds); + } + else + { + LLFloaterReg::showInstance("region_restarting", params); + } send_sound_trigger(LLUUID(gSavedSettings.getString("UISndRestart")), 1.0f); } @@ -6094,6 +6110,13 @@ void process_alert_core(const std::string& message, BOOL modal) std::string text(message.substr(1)); LLSD args; + // *NOTE: If the text from the server ever changes this line will need to be adjusted. + std::string restart_cancelled = "Region restart cancelled."; + if (text.substr(0, restart_cancelled.length()) == restart_cancelled) + { + LLFloaterRegionRestarting::close(); + } + std::string new_msg =LLNotifications::instance().getGlobalString(text); args["MESSAGE"] = new_msg; LLNotificationsUtil::add("SystemMessage", args); -- cgit v1.2.3 From 590630a32fee3205861e61438a88de0944d9c996 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Sat, 16 Nov 2013 10:54:30 -0500 Subject: STORM-1980 Code cleanup and an attempt to fix a mac/linux compile error --- indra/newview/llviewermessage.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index ac652ef329..0ce8585c15 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5964,14 +5964,14 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem) if (notificationID == "RegionRestartMinutes" || notificationID == "RegionRestartSeconds") { - U32 seconds; + S32 seconds; if (notificationID == "RegionRestartMinutes") { - seconds = 60 * static_cast(llsdBlock["MINUTES"].asInteger()); + seconds = 60 * static_cast(llsdBlock["MINUTES"].asInteger()); } else { - seconds = static_cast(llsdBlock["SECONDS"].asInteger()); + seconds = static_cast(llsdBlock["SECONDS"].asInteger()); } LLSD params; -- cgit v1.2.3 From d15cc2dadc34c757d1ac6aef66d5baa38fb80968 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Fri, 3 Jan 2014 13:31:51 -0500 Subject: STORM-1980 Add shake effect --- indra/newview/llviewermessage.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index e81de844d1..076419e96a 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5967,10 +5967,6 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem) seconds = static_cast(llsdBlock["SECONDS"].asInteger()); } - LLSD params; - params["NAME"] = llsdBlock["NAME"]; - params["SECONDS"] = (LLSD::Integer)seconds; - LLFloaterRegionRestarting* floaterp = LLFloaterReg::findTypedInstance("region_restarting"); if (floaterp) @@ -5979,6 +5975,9 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem) } else { + LLSD params; + params["NAME"] = llsdBlock["NAME"]; + params["SECONDS"] = (LLSD::Integer)seconds; LLFloaterReg::showInstance("region_restarting", params); } -- cgit v1.2.3 From 24c5ac7417f8b32c39dd5defec21845bd03786c4 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Sat, 4 Jan 2014 10:40:20 -0500 Subject: STORM-1980 Center floater on screen. Tweak shaking parameters. --- indra/newview/llviewermessage.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 076419e96a..267aa9532c 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5978,7 +5978,11 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem) LLSD params; params["NAME"] = llsdBlock["NAME"]; params["SECONDS"] = (LLSD::Integer)seconds; - LLFloaterReg::showInstance("region_restarting", params); + LLFloaterRegionRestarting* restarting_floater = dynamic_cast(LLFloaterReg::showInstance("region_restarting", params)); + if(restarting_floater) + { + restarting_floater->center(); + } } send_sound_trigger(LLUUID(gSavedSettings.getString("UISndRestart")), 1.0f); -- cgit v1.2.3