diff options
Diffstat (limited to 'indra')
-rwxr-xr-x | indra/newview/lltoolbrush.cpp | 57 | ||||
-rwxr-xr-x | indra/newview/lltoolbrush.h | 8 | ||||
-rwxr-xr-x | indra/newview/llviewerparcelmgr.cpp | 6 | ||||
-rwxr-xr-x | indra/newview/skins/default/xui/en/notifications.xml | 8 |
4 files changed, 64 insertions, 15 deletions
diff --git a/indra/newview/lltoolbrush.cpp b/indra/newview/lltoolbrush.cpp index 56f0f8be25..e3eb8ba7af 100755 --- a/indra/newview/lltoolbrush.cpp +++ b/indra/newview/lltoolbrush.cpp @@ -52,7 +52,7 @@ #include "llworld.h" #include "llappviewer.h" #include "llparcel.h" - +#include "roles_constants.h" #include "llglheaders.h" const std::string REGION_BLOCKS_TERRAFORM_MSG = "This region does not allow terraforming.\n" @@ -239,9 +239,9 @@ void LLToolBrushLand::modifyLandInSelectionGlobal() iter != mLastAffectedRegions.end(); ++iter) { LLViewerRegion* regionp = *iter; - if (!canTerraform(regionp)) + if (!canTerraformRegion(regionp)) { - alertNoTerraform(regionp); + alertNoTerraformRegion(regionp); return; } } @@ -376,12 +376,17 @@ BOOL LLToolBrushLand::handleMouseDown(S32 x, S32 y, MASK mask) LLRegionPosition region_position( spot ); LLViewerRegion* regionp = region_position.getRegion(); - if (!canTerraform(regionp)) + if (!canTerraformRegion(regionp)) { - alertNoTerraform(regionp); + alertNoTerraformRegion(regionp); return TRUE; } + if (!canTerraformParcel(regionp)) + { + alertNoTerraformParcel(); + } + LLVector3 pos_region = region_position.getPositionRegion(); U32 grids = regionp->getLand().mGridsPerEdge; S32 i = llclamp( (S32)pos_region.mV[VX], 0, (S32)grids ); @@ -408,6 +413,16 @@ BOOL LLToolBrushLand::handleHover( S32 x, S32 y, MASK mask ) mMouseY = y; mGotHover = TRUE; gViewerWindow->setCursor(UI_CURSOR_TOOLLAND); + + LLVector3d spot; + if( gViewerWindow->mousePointOnLandGlobal( mMouseX, mMouseY, &spot ) ) + { + + spot.mdV[VX] = floor( spot.mdV[VX] + 0.5 ); + spot.mdV[VY] = floor( spot.mdV[VY] + 0.5 ); + + LLViewerParcelMgr::getInstance()->setHoverParcel(spot); + } return TRUE; } @@ -653,7 +668,7 @@ void LLToolBrushLand::redo() }*/ // static -bool LLToolBrushLand::canTerraform(LLViewerRegion* regionp) const +bool LLToolBrushLand::canTerraformRegion(LLViewerRegion* regionp) const { if (!regionp) return false; if (regionp->canManageEstate()) return true; @@ -661,7 +676,22 @@ bool LLToolBrushLand::canTerraform(LLViewerRegion* regionp) const } // static -void LLToolBrushLand::alertNoTerraform(LLViewerRegion* regionp) +bool LLToolBrushLand::canTerraformParcel(LLViewerRegion* regionp) const +{ + LLParcel* selected_parcel = LLViewerParcelMgr::getInstance()->getHoverParcel(); + bool is_terraform_allowed = false; + if (selected_parcel) + { + BOOL owner_release = LLViewerParcelMgr::isParcelOwnedByAgent(selected_parcel, GP_LAND_ALLOW_EDIT_LAND); + is_terraform_allowed = ( gAgent.canManageEstate() || (selected_parcel->getOwnerID() == regionp->getOwner()) || owner_release); + } + + return is_terraform_allowed; +} + + +// static +void LLToolBrushLand::alertNoTerraformRegion(LLViewerRegion* regionp) { if (!regionp) return; @@ -671,6 +701,19 @@ void LLToolBrushLand::alertNoTerraform(LLViewerRegion* regionp) } +// static +void LLToolBrushLand::alertNoTerraformParcel() +{ + LLParcel* selected_parcel = LLViewerParcelMgr::getInstance()->getHoverParcel(); + if (selected_parcel) + { + LLSD args; + args["PARCEL"] = selected_parcel->getName(); + LLNotificationsUtil::add("ParcelNoTerraforming", args); + } + +} + ///============================================================================ /// Local function definitions ///============================================================================ diff --git a/indra/newview/lltoolbrush.h b/indra/newview/lltoolbrush.h index 1c7f198900..2ec6911de9 100755 --- a/indra/newview/lltoolbrush.h +++ b/indra/newview/lltoolbrush.h @@ -81,10 +81,14 @@ protected: const LLVector3& pos_world); // Does region allow terraform, or are we a god? - bool canTerraform(LLViewerRegion* regionp) const; + bool canTerraformRegion(LLViewerRegion* regionp) const; + + bool canTerraformParcel(LLViewerRegion* regionp) const; // Modal dialog that you can't terraform the region - void alertNoTerraform(LLViewerRegion* regionp); + void alertNoTerraformRegion(LLViewerRegion* regionp); + + void alertNoTerraformParcel(); protected: F32 mStartingZ; diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index 0e5cffb1e5..7c94442f09 100755 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -1321,12 +1321,6 @@ void LLViewerParcelMgr::setHoverParcel(const LLVector3d& pos) static U32 last_west, last_south; - // only request parcel info when tooltip is shown - if (!gSavedSettings.getBOOL("ShowLandHoverTip")) - { - return; - } - // only request parcel info if position has changed outside of the // last parcel grid step U32 west_parcel_step = (U32) floor( pos.mdV[VX] / PARCEL_GRID_STEP_METERS ); diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 0230019eb2..46d7c5e6ad 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -1389,6 +1389,14 @@ Graphics Quality can be raised in Preferences > Graphics. The region [REGION] does not allow terraforming. <tag>fail</tag> </notification> + + <notification + icon="alertmodal.tga" + name="ParcelNoTerraforming" + type="notify"> +You are not allowed to terraform parcel [PARCEL]. + <tag>fail</tag> + </notification> <notification icon="alertmodal.tga" |