From 932921766740655de84108970095ca17d24c5829 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Fri, 27 Apr 2012 17:08:33 -0700 Subject: PATH-585: Adding an initial notification for when a server-side automatic unfreeze occurs. --- indra/llui/llnotifications.cpp | 4 +++ indra/llui/llnotificationtemplate.h | 2 ++ indra/newview/llpathfindingmanager.cpp | 14 +++++++++ indra/newview/llpathfindingmanager.h | 1 + .../newview/skins/default/xui/en/notifications.xml | 34 ++++++++++++++++++++++ indra/newview/skins/default/xui/en/strings.xml | 3 ++ 6 files changed, 58 insertions(+) diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index 8aa548b974..83fa6da863 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -1477,6 +1477,10 @@ bool LLNotifications::loadTemplates() { replaceFormText(notification.form_ref.form, "$canceltext", notification.form_ref.form_template.cancel_text); } + if(notification.form_ref.form_template.help_text.isProvided()) + { + replaceFormText(notification.form_ref.form, "$helptext", notification.form_ref.form_template.help_text); + } if(notification.form_ref.form_template.ignore_text.isProvided()) { replaceFormText(notification.form_ref.form, "$ignoretext", notification.form_ref.form_template.ignore_text); diff --git a/indra/llui/llnotificationtemplate.h b/indra/llui/llnotificationtemplate.h index fb50c9c123..56b18eb81a 100644 --- a/indra/llui/llnotificationtemplate.h +++ b/indra/llui/llnotificationtemplate.h @@ -121,6 +121,7 @@ struct LLNotificationTemplate Optional yes_text, no_text, cancel_text, + help_text, ignore_text; TemplateRef() @@ -128,6 +129,7 @@ struct LLNotificationTemplate yes_text("yestext"), no_text("notext"), cancel_text("canceltext"), + help_text("helptext"), ignore_text("ignoretext") {} }; diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp index e754e77588..59cfc398f2 100644 --- a/indra/newview/llpathfindingmanager.cpp +++ b/indra/newview/llpathfindingmanager.cpp @@ -42,6 +42,9 @@ #include "llpathfindinglinksetlist.h" #include "llpathfindingcharacterlist.h" #include "llhttpnode.h" +#include "llnotificationsutil.h" +#include "lltrans.h" +#include "llweb.h" #include #include @@ -663,6 +666,17 @@ void LLPathfindingManager::handleAgentStateUpdate(const LLSD &pContent) EAgentState agentState = (pContent.get(ALTER_NAVMESH_OBJECTS_FIELD).asBoolean() ? kAgentStateUnfrozen : kAgentStateFrozen); setAgentState(agentState); + + LLSD substitutions, payload; + LLNotificationsUtil::add("AutomaticAgentStateUnfreeze", substitutions, payload, boost::bind(&LLPathfindingManager::handleAgentStateUserNotification, this, _1, _2)); +} + +void LLPathfindingManager::handleAgentStateUserNotification(const LLSD &pNotification, const LLSD &pResponse) +{ + if (LLNotificationsUtil::getSelectedOption(pNotification, pResponse) == 1) + { + LLWeb::loadURL(LLTrans::getString("Pathfinding_Wiki_URL")); + } } std::string LLPathfindingManager::getNavMeshStatusURLForRegion(LLViewerRegion *pRegion) const diff --git a/indra/newview/llpathfindingmanager.h b/indra/newview/llpathfindingmanager.h index 9797c783b5..f5d7cd1332 100644 --- a/indra/newview/llpathfindingmanager.h +++ b/indra/newview/llpathfindingmanager.h @@ -123,6 +123,7 @@ private: void handleAgentStateResult(const LLSD &pContent, EAgentState pRequestedAgentState); void handleAgentStateError(U32 pStatus, const std::string &pReason, const std::string &pURL); void handleAgentStateUpdate(const LLSD &pContent); + void handleAgentStateUserNotification(const LLSD &pNotification, const LLSD &pResponse); std::string getNavMeshStatusURLForRegion(LLViewerRegion *pRegion) const; std::string getRetrieveNavMeshURLForRegion(LLViewerRegion *pRegion) const; diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 3b03bc0aed..a0a670f233 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -77,6 +77,21 @@ + +