MAINT-2676 - Set home to here - screen_home.bmp not saved. Reviewed by Kelly.
parent
5a8c4c40aa
commit
e5bdb0f0e1
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue