From 10614ebd917f4dbb8a16e8a0473409c42f8d7608 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Wed, 4 Jan 2012 15:52:20 -0800 Subject: Hijaking the land status messaging for temporary development of the pathfinding linksets floater. --- indra/llui/llscrolllistctrl.cpp | 16 ++++++++++++++++ indra/llui/llscrolllistctrl.h | 1 + 2 files changed, 17 insertions(+) (limited to 'indra/llui') diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index 466fac33ea..f7017064d7 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -389,6 +389,22 @@ std::vector LLScrollListCtrl::getAllSelected() const return ret; } +S32 LLScrollListCtrl::getNumSelected() const +{ + S32 numSelected = 0; + + for(item_list::const_iterator iter = mItemList.begin(); iter != mItemList.end(); ++iter) + { + LLScrollListItem* item = *iter; + if (item->getSelected()) + { + ++numSelected; + } + } + + return numSelected; +} + S32 LLScrollListCtrl::getFirstSelectedIndex() const { S32 CurSelectedIndex = 0; diff --git a/indra/llui/llscrolllistctrl.h b/indra/llui/llscrolllistctrl.h index ae8aea9245..44d9635838 100644 --- a/indra/llui/llscrolllistctrl.h +++ b/indra/llui/llscrolllistctrl.h @@ -257,6 +257,7 @@ public: LLScrollListItem* getFirstSelected() const; virtual S32 getFirstSelectedIndex() const; std::vector getAllSelected() const; + S32 getNumSelected() const; LLScrollListItem* getLastSelectedItem() const { return mLastSelected; } // iterate over all items -- cgit v1.3 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(+) (limited to 'indra/llui') 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 @@ + +