diff options
author | Todd Stinson <stinson@lindenlab.com> | 2012-08-14 17:58:26 -0700 |
---|---|---|
committer | Todd Stinson <stinson@lindenlab.com> | 2012-08-14 17:58:26 -0700 |
commit | 2e338ef2efcfa2f1812506201d1ff5d61a13310f (patch) | |
tree | f2ba7020a82937bbc461098a9ed8369439ce6418 /indra | |
parent | 0517f5f487550f0616bc2ca062f94c3ccf63374e (diff) |
PATH-856: Adding a new notification to indicate when the user will be toggling the phantom flag of a linkset through the Pathfinding Linksets floater.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llfloaterpathfindinglinksets.cpp | 45 | ||||
-rw-r--r-- | indra/newview/llfloaterpathfindinglinksets.h | 1 | ||||
-rw-r--r-- | indra/newview/llpathfindinglinkset.cpp | 5 | ||||
-rw-r--r-- | indra/newview/llpathfindinglinkset.h | 1 | ||||
-rw-r--r-- | indra/newview/llpathfindinglinksetlist.cpp | 14 | ||||
-rw-r--r-- | indra/newview/llpathfindinglinksetlist.h | 1 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/notifications.xml | 89 |
7 files changed, 141 insertions, 15 deletions
diff --git a/indra/newview/llfloaterpathfindinglinksets.cpp b/indra/newview/llfloaterpathfindinglinksets.cpp index 651be274d9..0fe0e151fb 100644 --- a/indra/newview/llfloaterpathfindinglinksets.cpp +++ b/indra/newview/llfloaterpathfindinglinksets.cpp @@ -500,6 +500,23 @@ bool LLFloaterPathfindingLinksets::isShowUnmodifiablePhantomWarning(LLPathfindin return isShowWarning; } +bool LLFloaterPathfindingLinksets::isShowPhantomToggleWarning(LLPathfindingLinkset::ELinksetUse pLinksetUse) const +{ + bool isShowWarning = false; + + if (pLinksetUse != LLPathfindingLinkset::kUnknown) + { + LLPathfindingObjectListPtr selectedObjects = getSelectedObjects(); + if ((selectedObjects != NULL) && !selectedObjects->isEmpty()) + { + const LLPathfindingLinksetList *linksetList = dynamic_cast<const LLPathfindingLinksetList *>(selectedObjects.get()); + isShowWarning = linksetList->isShowPhantomToggleWarning(pLinksetUse); + } + } + + return isShowWarning; +} + bool LLFloaterPathfindingLinksets::isShowCannotBeVolumeWarning(LLPathfindingLinkset::ELinksetUse pLinksetUse) const { bool isShowWarning = false; @@ -569,29 +586,41 @@ void LLFloaterPathfindingLinksets::applyEdit() { LLPathfindingLinkset::ELinksetUse linksetUse = getEditLinksetUse(); + bool showPhantomToggleWarning = isShowPhantomToggleWarning(linksetUse); bool showUnmodifiablePhantomWarning = isShowUnmodifiablePhantomWarning(linksetUse); bool showCannotBeVolumeWarning = isShowCannotBeVolumeWarning(linksetUse); - if (showUnmodifiablePhantomWarning || showCannotBeVolumeWarning) + if (showPhantomToggleWarning || showUnmodifiablePhantomWarning || showCannotBeVolumeWarning) { LLPathfindingLinkset::ELinksetUse restrictedLinksetUse = LLPathfindingLinkset::getLinksetUseWithToggledPhantom(linksetUse); LLSD substitutions; substitutions["REQUESTED_TYPE"] = getLinksetUseString(linksetUse); substitutions["RESTRICTED_TYPE"] = getLinksetUseString(restrictedLinksetUse); - std::string notificationName; - if (showUnmodifiablePhantomWarning && showCannotBeVolumeWarning) + // Build one of the following notifications names + // - PathfindingLinksets_WarnOnPhantom + // - PathfindingLinksets_WarnOnPhantom_MismatchOnRestricted + // - PathfindingLinksets_WarnOnPhantom_MismatchOnVolume + // - PathfindingLinksets_WarnOnPhantom_MismatchOnRestricted_MismatchOnVolume + // - PathfindingLinksets_MismatchOnRestricted + // - PathfindingLinksets_MismatchOnVolume + // - PathfindingLinksets_MismatchOnRestricted_MismatchOnVolume + + std::string notificationName = "PathfindingLinksets"; + + if (showPhantomToggleWarning) { - notificationName = "PathfindingLinksets_SetLinksetUseMismatchOnRestrictedAndVolume"; + notificationName += "_WarnOnPhantom"; } - else if (showUnmodifiablePhantomWarning) + if (showUnmodifiablePhantomWarning) { - notificationName = "PathfindingLinksets_SetLinksetUseMismatchOnRestricted"; + notificationName += "_MismatchOnRestricted"; } - else + if (showCannotBeVolumeWarning) { - notificationName = "PathfindingLinksets_SetLinksetUseMismatchOnVolume"; + notificationName += "_MismatchOnVolume"; } + LLNotificationsUtil::add(notificationName, substitutions, LLSD(), boost::bind(&LLFloaterPathfindingLinksets::handleApplyEdit, this, _1, _2)); } else diff --git a/indra/newview/llfloaterpathfindinglinksets.h b/indra/newview/llfloaterpathfindinglinksets.h index d371f36ac3..6538308122 100644 --- a/indra/newview/llfloaterpathfindinglinksets.h +++ b/indra/newview/llfloaterpathfindinglinksets.h @@ -84,6 +84,7 @@ private: LLSD buildLinksetUseScrollListData(const std::string &pLabel, S32 pValue) const; bool isShowUnmodifiablePhantomWarning(LLPathfindingLinkset::ELinksetUse pLinksetUse) const; + bool isShowPhantomToggleWarning(LLPathfindingLinkset::ELinksetUse pLinksetUse) const; bool isShowCannotBeVolumeWarning(LLPathfindingLinkset::ELinksetUse pLinksetUse) const; void updateStateOnEditFields(); diff --git a/indra/newview/llpathfindinglinkset.cpp b/indra/newview/llpathfindinglinkset.cpp index 779db5512e..50b76378f5 100644 --- a/indra/newview/llpathfindinglinkset.cpp +++ b/indra/newview/llpathfindinglinkset.cpp @@ -149,6 +149,11 @@ bool LLPathfindingLinkset::isShowUnmodifiablePhantomWarning(ELinksetUse pLinkset return (!isModifiable() && (isPhantom() != isPhantom(pLinksetUse))); } +bool LLPathfindingLinkset::isShowPhantomToggleWarning(ELinksetUse pLinksetUse) const +{ + return (isModifiable() && (isPhantom() != isPhantom(pLinksetUse))); +} + bool LLPathfindingLinkset::isShowCannotBeVolumeWarning(ELinksetUse pLinksetUse) const { return (!canBeVolume() && ((pLinksetUse == kMaterialVolume) || (pLinksetUse == kExclusionVolume))); diff --git a/indra/newview/llpathfindinglinkset.h b/indra/newview/llpathfindinglinkset.h index 98675fccc4..308a3a1e0f 100644 --- a/indra/newview/llpathfindinglinkset.h +++ b/indra/newview/llpathfindinglinkset.h @@ -72,6 +72,7 @@ public: inline S32 getWalkabilityCoefficientD() const {return mWalkabilityCoefficientD;}; bool isShowUnmodifiablePhantomWarning(ELinksetUse pLinksetUse) const; + bool isShowPhantomToggleWarning(ELinksetUse pLinksetUse) const; bool isShowCannotBeVolumeWarning(ELinksetUse pLinksetUse) const; LLSD encodeAlteredFields(ELinksetUse pLinksetUse, S32 pA, S32 pB, S32 pC, S32 pD) const; diff --git a/indra/newview/llpathfindinglinksetlist.cpp b/indra/newview/llpathfindinglinksetlist.cpp index 746fa342a1..b886e46765 100644 --- a/indra/newview/llpathfindinglinksetlist.cpp +++ b/indra/newview/llpathfindinglinksetlist.cpp @@ -113,6 +113,20 @@ bool LLPathfindingLinksetList::isShowUnmodifiablePhantomWarning(LLPathfindingLin return isShowWarning; } +bool LLPathfindingLinksetList::isShowPhantomToggleWarning(LLPathfindingLinkset::ELinksetUse pLinksetUse) const +{ + bool isShowWarning = false; + + for (const_iterator objectIter = begin(); !isShowWarning && (objectIter != end()); ++objectIter) + { + const LLPathfindingObjectPtr objectPtr = objectIter->second; + const LLPathfindingLinkset *linkset = dynamic_cast<const LLPathfindingLinkset *>(objectPtr.get()); + isShowWarning = linkset->isShowPhantomToggleWarning(pLinksetUse); + } + + return isShowWarning; +} + bool LLPathfindingLinksetList::isShowCannotBeVolumeWarning(LLPathfindingLinkset::ELinksetUse pLinksetUse) const { bool isShowWarning = false; diff --git a/indra/newview/llpathfindinglinksetlist.h b/indra/newview/llpathfindinglinksetlist.h index 77c6358640..1d38e4c11a 100644 --- a/indra/newview/llpathfindinglinksetlist.h +++ b/indra/newview/llpathfindinglinksetlist.h @@ -43,6 +43,7 @@ public: LLSD encodeTerrainFields(LLPathfindingLinkset::ELinksetUse pLinksetUse, S32 pA, S32 pB, S32 pC, S32 pD) const; bool isShowUnmodifiablePhantomWarning(LLPathfindingLinkset::ELinksetUse pLinksetUse) const; + bool isShowPhantomToggleWarning(LLPathfindingLinkset::ELinksetUse pLinksetUse) const; bool isShowCannotBeVolumeWarning(LLPathfindingLinkset::ELinksetUse pLinksetUse) const; void determinePossibleStates(BOOL &pCanBeWalkable, BOOL &pCanBeStaticObstacle, BOOL &pCanBeDynamicObstacle, diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 13f073a1c2..9974ffbb52 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -8075,9 +8075,26 @@ The site at '<nolink>[HOST_NAME]</nolink>' in realm ' <notification icon="alertmodal.tga" - name="PathfindingLinksets_SetLinksetUseMismatchOnRestricted" + name="PathfindingLinksets_WarnOnPhantom" type="alertmodal"> - Some selected linksets cannot be set to be '[REQUESTED_TYPE]' because of permission restrictions on the linkset. These linksets will be set to be '[RESTRICTED_TYPE]' instead. +Some selected linksets will have the Phantom flag toggled. + +Do you wish to continue? + <tag>confirm</tag> + <usetemplate + ignoretext="Some selected linksets phantom flag will be toggled." + name="okcancelignore" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="PathfindingLinksets_MismatchOnRestricted" + type="alertmodal"> +Some selected linksets cannot be set to be '[REQUESTED_TYPE]' because of permission restrictions on the linkset. These linksets will be set to be '[RESTRICTED_TYPE]' instead. + +Do you wish to continue? <tag>confirm</tag> <usetemplate ignoretext="Some selected linksets cannot be set because of permission restrictions on the linkset." @@ -8088,9 +8105,11 @@ The site at '<nolink>[HOST_NAME]</nolink>' in realm ' <notification icon="alertmodal.tga" - name="PathfindingLinksets_SetLinksetUseMismatchOnVolume" + name="PathfindingLinksets_MismatchOnVolume" type="alertmodal"> - Some selected linksets cannot be set to be '[REQUESTED_TYPE]' because the shape is non-convex. +Some selected linksets cannot be set to be '[REQUESTED_TYPE]' because the shape is non-convex. + +Do you wish to continue? <tag>confirm</tag> <usetemplate ignoretext="Some selected linksets cannot be set because the shape is non-convex" @@ -8101,10 +8120,47 @@ The site at '<nolink>[HOST_NAME]</nolink>' in realm ' <notification icon="alertmodal.tga" - name="PathfindingLinksets_SetLinksetUseMismatchOnRestrictedAndVolume" + name="PathfindingLinksets_WarnOnPhantom_MismatchOnRestricted" + type="alertmodal"> +Some selected linksets will have the Phantom flag toggled. + +Some selected linksets cannot be set to be '[REQUESTED_TYPE]' because of permission restrictions on the linkset. These linksets will be set to be '[RESTRICTED_TYPE]' instead. + +Do you wish to continue? + <tag>confirm</tag> + <usetemplate + ignoretext="Some selected linksets phantom flag will be toggled and others cannot be set because of permission restrictions on the linkset." + name="okcancelignore" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="PathfindingLinksets_WarnOnPhantom_MismatchOnVolume" + type="alertmodal"> +Some selected linksets will have the Phantom flag toggled. + +Some selected linksets cannot be set to be '[REQUESTED_TYPE]' because the shape is non-convex. + +Do you wish to continue? + <tag>confirm</tag> + <usetemplate + ignoretext="Some selected linksets phantom flag will be toggled and others cannot be set because the shape is non-convex" + name="okcancelignore" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" + name="PathfindingLinksets_MismatchOnRestricted_MismatchOnVolume" type="alertmodal"> - Some selected linksets cannot be set to be '[REQUESTED_TYPE]' because of permission restrictions on the linkset. These linksets will be set to be '[RESTRICTED_TYPE]' instead. - Some selected linksets cannot be set to be '[REQUESTED_TYPE]' because the shape is non-convex. These linksets' use types will not change. +Some selected linksets cannot be set to be '[REQUESTED_TYPE]' because of permission restrictions on the linkset. These linksets will be set to be '[RESTRICTED_TYPE]' instead. + +Some selected linksets cannot be set to be '[REQUESTED_TYPE]' because the shape is non-convex. These linksets' use types will not change. + +Do you wish to continue? <tag>confirm</tag> <usetemplate ignoretext="Some selected linksets cannot be set because of permission restrictions on the linkset and because the shape is non-convex." @@ -8115,6 +8171,25 @@ The site at '<nolink>[HOST_NAME]</nolink>' in realm ' <notification icon="alertmodal.tga" + name="PathfindingLinksets_WarnOnPhantom_MismatchOnRestricted_MismatchOnVolume" + type="alertmodal"> +Some selected linksets will have the Phantom flag toggled. + +Some selected linksets cannot be set to be '[REQUESTED_TYPE]' because of permission restrictions on the linkset. These linksets will be set to be '[RESTRICTED_TYPE]' instead. + +Some selected linksets cannot be set to be '[REQUESTED_TYPE]' because the shape is non-convex. These linksets' use types will not change. + +Do you wish to continue? + <tag>confirm</tag> + <usetemplate + ignoretext="Some selected linksets phantom flag will be toggled and others cannot be set because of permission restrictions on the linkset and because the shape is non-convex." + name="okcancelignore" + notext="Cancel" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" name="PathfindingLinksets_ChangeToFlexiblePath" type="alertmodal"> The selected object affects the navmesh. Changing it to a Flexible Path will remove it from the navmesh. |