From b76f036bf6af7ae3e1b8ffb2edeee21911256820 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Fri, 23 Mar 2012 14:22:35 -0700 Subject: PATH-199: Alert the user if he/she attempts to terraform while in Frozen mode. --- indra/newview/lltoolbrush.cpp | 19 +++++++++++++++++++ indra/newview/lltoolbrush.h | 3 +++ indra/newview/skins/default/xui/en/notifications.xml | 8 ++++++++ 3 files changed, 30 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/lltoolbrush.cpp b/indra/newview/lltoolbrush.cpp index aba43a9715..51cc697d7a 100644 --- a/indra/newview/lltoolbrush.cpp +++ b/indra/newview/lltoolbrush.cpp @@ -52,6 +52,7 @@ #include "llworld.h" #include "llappviewer.h" #include "llparcel.h" +#include "llpathfindingmanager.h" #include "llglheaders.h" @@ -244,6 +245,12 @@ void LLToolBrushLand::modifyLandInSelectionGlobal() alertNoTerraform(regionp); return; } + + if (!LLPathfindingManager::getInstance()->isAllowAlterPermanent()) + { + alertNoTerraformWhileFrozen(); + return; + } } for(region_list_t::iterator iter = mLastAffectedRegions.begin(); @@ -382,6 +389,12 @@ BOOL LLToolBrushLand::handleMouseDown(S32 x, S32 y, MASK mask) return TRUE; } + if (!LLPathfindingManager::getInstance()->isAllowAlterPermanent()) + { + alertNoTerraformWhileFrozen(); + return TRUE; + } + LLVector3 pos_region = region_position.getPositionRegion(); U32 grids = regionp->getLand().mGridsPerEdge; S32 i = llclamp( (S32)pos_region.mV[VX], 0, (S32)grids ); @@ -671,6 +684,12 @@ void LLToolBrushLand::alertNoTerraform(LLViewerRegion* regionp) } +// static +void LLToolBrushLand::alertNoTerraformWhileFrozen() +{ + LLNotificationsUtil::add("RegionNoTerraformingWhileFrozen"); +} + ///============================================================================ /// Local function definitions ///============================================================================ diff --git a/indra/newview/lltoolbrush.h b/indra/newview/lltoolbrush.h index 1c7f198900..416cdf429c 100644 --- a/indra/newview/lltoolbrush.h +++ b/indra/newview/lltoolbrush.h @@ -86,6 +86,9 @@ protected: // Modal dialog that you can't terraform the region void alertNoTerraform(LLViewerRegion* regionp); + // Modal dialog that you can't terraform in frozen mode + void alertNoTerraformWhileFrozen(); + protected: F32 mStartingZ; S32 mMouseX; diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 5d6cefbcfb..f6c29cc191 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -1276,6 +1276,14 @@ The region [REGION] does not allow terraforming. fail + + You cannot terraform land while in Frozen mode. Please switch to Unfrozen mode from the menu option Build->Pathfinding->Basic Setup. + fail + +