summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermessage.cpp
diff options
context:
space:
mode:
authorsimon <none@none>2013-05-21 13:50:49 -0700
committersimon <none@none>2013-05-21 13:50:49 -0700
commite5bdb0f0e1b3c48173e36b54da0f25c7d535df49 (patch)
tree2d6b24a9f450d61c40bb437ee9b77e98cf102e17 /indra/newview/llviewermessage.cpp
parent5a8c4c40aa5c2bce83f164705333af88290e4c6e (diff)
MAINT-2676 - Set home to here - screen_home.bmp not saved. Reviewed by Kelly.
Diffstat (limited to 'indra/newview/llviewermessage.cpp')
-rwxr-xr-xindra/newview/llviewermessage.cpp52
1 files changed, 32 insertions, 20 deletions
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 9894ec7c07..d6ba803c46 100755
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -5938,19 +5938,42 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem)
}
+static void process_special_alert_messages(const std::string & message)
+{
+ // Do special handling for alert messages. This is a legacy hack, and any actual displayed
+ // text should be altered in the notifications.xml files.
+ if ( message == "You died and have been teleported to your home location")
+ {
+ LLViewerStats::getInstance()->incStat(LLViewerStats::ST_KILLED_COUNT);
+ }
+ else if( message == "Home position set." )
+ {
+ // save the home location image to disk
+ std::string snap_filename = gDirUtilp->getLindenUserDir();
+ snap_filename += gDirUtilp->getDirDelimiter();
+ snap_filename += SCREEN_HOME_FILENAME;
+ gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, FALSE);
+ }
+}
+
+
+
void process_agent_alert_message(LLMessageSystem* msgsystem, void** user_data)
{
// make sure the cursor is back to the usual default since the
// alert is probably due to some kind of error.
gViewerWindow->getWindow()->resetBusyCount();
+ std::string message;
+ msgsystem->getStringFast(_PREHASH_AlertData, _PREHASH_Message, message);
+
+ process_special_alert_messages(message);
+
if (!attempt_standard_notification(msgsystem))
{
BOOL modal = FALSE;
msgsystem->getBOOL("AlertData", "Modal", modal);
- std::string buffer;
- msgsystem->getStringFast(_PREHASH_AlertData, _PREHASH_Message, buffer);
- process_alert_core(buffer, modal);
+ process_alert_core(message, modal);
}
}
@@ -5965,12 +5988,15 @@ void process_alert_message(LLMessageSystem *msgsystem, void **user_data)
// alert is probably due to some kind of error.
gViewerWindow->getWindow()->resetBusyCount();
+ std::string message;
+ msgsystem->getStringFast(_PREHASH_AlertData, _PREHASH_Message, message);
+
+ process_special_alert_messages(message);
+
if (!attempt_standard_notification(msgsystem))
{
BOOL modal = FALSE;
- std::string buffer;
- msgsystem->getStringFast(_PREHASH_AlertData, _PREHASH_Message, buffer);
- process_alert_core(buffer, modal);
+ process_alert_core(message, modal);
}
}
@@ -6000,20 +6026,6 @@ bool handle_special_alerts(const std::string &pAlertName)
void process_alert_core(const std::string& message, BOOL modal)
{
- // HACK -- handle callbacks for specific alerts. It also is localized in notifications.xml
- if ( message == "You died and have been teleported to your home location")
- {
- LLViewerStats::getInstance()->incStat(LLViewerStats::ST_KILLED_COUNT);
- }
- else if( message == "Home position set." )
- {
- // save the home location image to disk
- std::string snap_filename = gDirUtilp->getLindenUserDir();
- snap_filename += gDirUtilp->getDirDelimiter();
- snap_filename += SCREEN_HOME_FILENAME;
- gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, FALSE);
- }
-
const std::string ALERT_PREFIX("ALERT: ");
const std::string NOTIFY_PREFIX("NOTIFY: ");
if (message.find(ALERT_PREFIX) == 0)