Ejemplo n.º 1
0
// static
bool PanelRadar::callbackBanFromEstate(const LLSD& notification, const LLSD& response)
{
	S32 option = LLNotification::getSelectedOption(notification, response);
	if (option == 0)
	{
		LLPanelEstateInfo::sendEstateAccessDelta(ESTATE_ACCESS_BANNED_AGENT_ADD | ESTATE_ACCESS_ALLOWED_AGENT_REMOVE | ESTATE_ACCESS_NO_REPLY, notification["payload"]["avatar_id"].asUUID());
	}
	else if (option == 1)
	{
		LLViewerRegion* regionp = gAgent.getRegion();
		if (regionp)
		{
			U32 flags = ESTATE_ACCESS_BANNED_AGENT_ADD | ESTATE_ACCESS_ALLOWED_AGENT_REMOVE | ESTATE_ACCESS_NO_REPLY;
			if (regionp->getOwner() == gAgent.getID() || gAgent.isGodlike())
			{
				flags |= ESTATE_ACCESS_APPLY_TO_ALL_ESTATES;
			}
			else if (regionp->isEstateManager())
			{
				flags |= ESTATE_ACCESS_APPLY_TO_MANAGED_ESTATES;
			}
			LLPanelEstateInfo::sendEstateAccessDelta(flags, notification["payload"]["avatar_id"].asUUID());
		}
	}
	return false;
}
Ejemplo n.º 2
0
// static
bool LLEnvManagerNew::canEditRegionSettings()
{
	LLViewerRegion* region = gAgent.getRegion();
	BOOL owner_or_god = gAgent.isGodlike() || (region && region->getOwner() == gAgent.getID());
	BOOL owner_or_god_or_manager = owner_or_god || (region && region->isEstateManager());

	LL_DEBUGS("Windlight") << "Can edit region settings: " << (bool) owner_or_god_or_manager << LL_ENDL;
	return owner_or_god_or_manager;
}
Ejemplo n.º 3
0
// public
void LLPanelLandInfo::refresh()
{
	LLParcel *parcel = LLViewerParcelMgr::getInstance()->getParcelSelection()->getParcel();
	LLViewerRegion *regionp = LLViewerParcelMgr::getInstance()->getSelectionRegion();

	if (!parcel || !regionp)
	{
		// nothing selected, disable panel
		childSetVisible("label_area_price",false);
		childSetVisible("label_area",false);

		//mTextPrice->setText(LLStringUtil::null);
		childSetText("textbox price",LLStringUtil::null);

		childSetEnabled("button buy land",FALSE);
		childSetEnabled("button abandon land",FALSE);
		childSetEnabled("button subdivide land",FALSE);
		childSetEnabled("button join land",FALSE);
		childSetEnabled("button about land",FALSE);
	}
	else
	{
		// something selected, hooray!
		const LLUUID& owner_id = parcel->getOwnerID();
		const LLUUID& auth_buyer_id = parcel->getAuthorizedBuyerID();

		BOOL is_public = parcel->isPublic();
		BOOL is_for_sale = parcel->getForSale()
			&& ((parcel->getSalePrice() > 0) || (auth_buyer_id.notNull()));
		BOOL can_buy = (is_for_sale
						&& (owner_id != gAgent.getID())
						&& ((gAgent.getID() == auth_buyer_id)
							|| (auth_buyer_id.isNull())));
			
		if (is_public && !LLViewerParcelMgr::getInstance()->getParcelSelection()->getMultipleOwners())
		{
			getChildView("button buy land")->setEnabled(TRUE);
		}
		else
		{
			getChildView("button buy land")->setEnabled(can_buy);
		}

		BOOL owner_release = LLViewerParcelMgr::isParcelOwnedByAgent(parcel, GP_LAND_RELEASE);
		BOOL owner_divide =  LLViewerParcelMgr::isParcelOwnedByAgent(parcel, GP_LAND_DIVIDE_JOIN);

		BOOL manager_releaseable = ( gAgent.canManageEstate()
								  && (parcel->getOwnerID() == regionp->getOwner()) );
		
		BOOL manager_divideable = ( gAgent.canManageEstate()
								&& ((parcel->getOwnerID() == regionp->getOwner()) || owner_divide) );

		childSetEnabled("button abandon land",owner_release || manager_releaseable || gAgent.isGodlike());

		// only mainland sims are subdividable by owner
		if (regionp->getRegionFlag(REGION_FLAGS_ALLOW_PARCEL_CHANGES))
		{
			childSetEnabled("button subdivide land",owner_divide || manager_divideable || gAgent.isGodlike());
		}
		else
		{
			childSetEnabled("button subdivide land",manager_divideable || gAgent.isGodlike());
		}
		
		// To join land, must have something selected,
		// not just a single unit of land,
		// you must own part of it,
		// and it must not be a whole parcel.
		if (LLViewerParcelMgr::getInstance()->getSelectedArea() > PARCEL_UNIT_AREA
			//&& LLViewerParcelMgr::getInstance()->getSelfCount() > 1
			&& !LLViewerParcelMgr::getInstance()->getParcelSelection()->getWholeParcelSelected())
		{
			childSetEnabled("button join land",TRUE);
		}
		else
		{
			lldebugs << "Invalid selection for joining land" << llendl;
			childSetEnabled("button join land",FALSE);
		}

		childSetEnabled("button about land",TRUE);

		// show pricing information
		S32 area;
		S32 claim_price;
		S32 rent_price;
		BOOL for_sale;
		F32 dwell;
		LLViewerParcelMgr::getInstance()->getDisplayInfo(&area,
								   &claim_price,
								   &rent_price,
								   &for_sale,
								   &dwell);
		if(is_public || (is_for_sale && LLViewerParcelMgr::getInstance()->getParcelSelection()->getWholeParcelSelected()))
		{
			childSetTextArg("label_area_price","[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol());
			childSetTextArg("label_area_price","[PRICE]", llformat("%d",claim_price));
			childSetTextArg("label_area_price","[AREA]", llformat("%d",area));
			childSetVisible("label_area_price",true);
			childSetVisible("label_area",false);
		}
		else
		{
			childSetVisible("label_area_price",false);
			childSetTextArg("label_area","[AREA]", llformat("%d",area));
			childSetVisible("label_area",true);
		}
	}
}