コード例 #1
0
void LLLocationInputCtrl::refreshMaturityIcon()
{
	// Updating maturity rating icon.
	LLViewerRegion* region = gAgent.getRegion();
	if (!region)
		return;

	U8 sim_access = region->getSimAccess();
	switch(sim_access)
	{
	case SIM_ACCESS_PG:
		mMaturityIcon->setValue(mIconMaturityGeneral->getName());
		mMaturityIcon->setVisible(TRUE);
		break;

	case SIM_ACCESS_ADULT:
		mMaturityIcon->setValue(mIconMaturityAdult->getName());
		mMaturityIcon->setVisible(TRUE);
		break;

	default:
		mMaturityIcon->setVisible(FALSE);
	}

	if (mMaturityIcon->getVisible())
	{
		positionMaturityIcon();
	}
}
コード例 #2
0
void LLLocationInputCtrl::refreshMaturityButton()
{
	// Updating maturity rating icon.
	LLViewerRegion* region = gAgent.getRegion();
	if (!region)
		return;

	bool button_visible = true;
	LLPointer<LLUIImage> rating_image = NULL;
	std::string rating_tooltip;

	U8 sim_access = region->getSimAccess();
	switch(sim_access)
	{
	case SIM_ACCESS_PG:
		rating_image = mIconMaturityGeneral;
		rating_tooltip = LLTrans::getString("LocationCtrlGeneralIconTooltip");
		break;

	case SIM_ACCESS_ADULT:
		rating_image = mIconMaturityAdult;
		rating_tooltip = LLTrans::getString("LocationCtrlAdultIconTooltip");
		break;

	case SIM_ACCESS_MATURE:
		rating_image = mIconMaturityModerate;
		rating_tooltip = LLTrans::getString("LocationCtrlModerateIconTooltip");
		break;

	default:
		button_visible = false;
		break;
	}

	mMaturityButton->setVisible(button_visible);
	mMaturityButton->setToolTip(rating_tooltip);
	if(rating_image)
	{
		mMaturityButton->setImageUnselected(rating_image);
		mMaturityButton->setImagePressed(rating_image);
	}
	if (mMaturityButton->getVisible())
	{
		positionMaturityButton();
	}
}
コード例 #3
0
void LLPanelClassified::setDefaultAccessCombo()
{
	// PG regions should have PG classifieds. AO should have mature.

	LLViewerRegion *regionp = gAgent.getRegion();

	switch( regionp->getSimAccess() )
	{
		case SIM_ACCESS_PG:	
			mMatureCombo->setCurrentByIndex(PG_CONTENT);
			break;
		case SIM_ACCESS_ADULT:
			mMatureCombo->setCurrentByIndex(MATURE_CONTENT);
			break;
		default:
			// You are free to move about the cabin.
			break;
	}
}
コード例 #4
0
void LLFloaterBuyLandUI::updateCovenantInfo()
{
	LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion();
	if(!region) return;

	U8 sim_access = region->getSimAccess();
	std::string rating = LLViewerRegion::accessToString(sim_access);
	
	LLTextBox* region_name = getChild<LLTextBox>("region_name_text");
	if (region_name)
	{
		std::string region_name_txt = region->getName() + " ("+rating +")";
		region_name->setText(region_name_txt);

		LLIconCtrl* rating_icon = getChild<LLIconCtrl>("rating_icon");
		LLRect rect = rating_icon->getRect();
		S32 region_name_width = llmin(region_name->getRect().getWidth(), region_name->getTextBoundingRect().getWidth());
		S32 icon_left_pad = region_name->getRect().mLeft + region_name_width + ICON_PAD;
		region_name->setToolTip(region_name->getText());
		rating_icon->setRect(rect.setOriginAndSize(icon_left_pad, rect.mBottom, rect.getWidth(), rect.getHeight()));

		switch(sim_access)
		{
		case SIM_ACCESS_PG:
			rating_icon->setValue(getString("icon_PG"));
			break;

		case SIM_ACCESS_ADULT:
			rating_icon->setValue(getString("icon_R"));
			break;

		default:
			rating_icon->setValue(getString("icon_M"));
		}
	}

	LLTextBox* region_type = getChild<LLTextBox>("region_type_text");
	if (region_type)
	{
		region_type->setText(region->getLocalizedSimProductName());
		region_type->setToolTip(region->getLocalizedSimProductName());
	}
	
	LLTextBox* resellable_clause = getChild<LLTextBox>("resellable_clause");
	if (resellable_clause)
	{
		if (region->getRegionFlags() & REGION_FLAGS_BLOCK_LAND_RESELL)
		{
			resellable_clause->setText(getString("can_not_resell"));
		}
		else
		{
			resellable_clause->setText(getString("can_resell"));
		}
	}
	
	LLTextBox* changeable_clause = getChild<LLTextBox>("changeable_clause");
	if (changeable_clause)
	{
		if (region->getRegionFlags() & REGION_FLAGS_ALLOW_PARCEL_CHANGES)
		{
			changeable_clause->setText(getString("can_change"));
		}
		else
		{
			changeable_clause->setText(getString("can_not_change"));
		}
	}

	LLCheckBoxCtrl* check = getChild<LLCheckBoxCtrl>("agree_covenant");
	if(check)
	{
		check->set(false);
		check->setEnabled(true);
		check->setCommitCallback(onChangeAgreeCovenant, this);
	}

	LLTextBox* box = getChild<LLTextBox>("covenant_text");
	if(box)
	{
		box->setVisible(FALSE);
	}
	
	// send EstateCovenantInfo message
	LLMessageSystem *msg = gMessageSystem;
	msg->newMessage("EstateCovenantRequest");
	msg->nextBlockFast(_PREHASH_AgentData);
	msg->addUUIDFast(_PREHASH_AgentID,	gAgent.getID());
	msg->addUUIDFast(_PREHASH_SessionID,gAgent.getSessionID());
	msg->sendReliable(region->getHost());
}
コード例 #5
0
void LLFloaterBuyLandUI::updateCovenantInfo()
{
	LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion();
	if(!region) return;

	U8 sim_access = region->getSimAccess();
	std::string rating = LLViewerRegion::accessToString(sim_access);
	
	LLTextBox* region_name = getChild<LLTextBox>("region_name_text");
	if (region_name)
	{
		std::string region_name_txt = region->getName() + " ("+rating +")";
		region_name->setText(region_name_txt);
		region_name->setToolTip(region_name->getText());
	}

	LLTextBox* region_type = getChild<LLTextBox>("region_type_text");
	if (region_type)
	{
		region_type->setText(region->getLocalizedSimProductName());
		region_type->setToolTip(region->getLocalizedSimProductName());
	}
	
	LLTextBox* resellable_clause = getChild<LLTextBox>("resellable_clause");
	if (resellable_clause)
	{
		if (region->getRegionFlags() & REGION_FLAGS_BLOCK_LAND_RESELL)
		{
			resellable_clause->setText(getString("can_not_resell"));
		}
		else
		{
			resellable_clause->setText(getString("can_resell"));
		}
	}
	
	LLTextBox* changeable_clause = getChild<LLTextBox>("changeable_clause");
	if (changeable_clause)
	{
		if (region->getRegionFlags() & REGION_FLAGS_ALLOW_PARCEL_CHANGES)
		{
			changeable_clause->setText(getString("can_change"));
		}
		else
		{
			changeable_clause->setText(getString("can_not_change"));
		}
	}

	LLCheckBoxCtrl* check = getChild<LLCheckBoxCtrl>("agree_covenant");
	if(check)
	{
		check->set(false);
		check->setEnabled(true);
		check->setCommitCallback(boost::bind(&LLFloaterBuyLandUI::onChangeAgreeCovenant,_1,(void*)this));
	}

	LLTextBox* box = getChild<LLTextBox>("covenant_text");
	if(box)
	{
		box->setVisible(FALSE);
	}
	
	// send EstateCovenantInfo message
	LLMessageSystem *msg = gMessageSystem;
	msg->newMessage("EstateCovenantRequest");
	msg->nextBlockFast(_PREHASH_AgentData);
	msg->addUUIDFast(_PREHASH_AgentID,	gAgent.getID());
	msg->addUUIDFast(_PREHASH_SessionID,gAgent.getSessionID());
	msg->sendReliable(region->getHost());
}