MAINT-875 FIXED Display notification if user is not allowed to terraform hovered parcel.
parent
a23ec5ffa8
commit
190f66ab78
|
|
@ -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
|
||||
///============================================================================
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Reference in New Issue