本文整理汇总了C++中LLViewerRegion::getRegionFlags方法的典型用法代码示例。如果您正苦于以下问题:C++ LLViewerRegion::getRegionFlags方法的具体用法?C++ LLViewerRegion::getRegionFlags怎么用?C++ LLViewerRegion::getRegionFlags使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLViewerRegion
的用法示例。
在下文中一共展示了LLViewerRegion::getRegionFlags方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateCovenantInfo
void LLFloaterBuyLandUI::updateCovenantInfo()
{
LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion();
if(!region) return;
LLTextBox* region_name = getChild<LLTextBox>("region_name_text");
if (region_name)
{
region_name->setText(region->getName());
}
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->setCallbackUserData(this);
check->setCommitCallback(onChangeAgreeCovenant);
}
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());
}
示例2: onClickScripts
static void onClickScripts(void*)
{
LLViewerRegion* region = gAgent.getRegion();
if(region && region->getRegionFlags() & REGION_FLAGS_ESTATE_SKIP_SCRIPTS)
{
LLNotifications::instance().add("ScriptsStopped");
}
else if(region && region->getRegionFlags() & REGION_FLAGS_SKIP_SCRIPTS)
{
LLNotifications::instance().add("ScriptsNotRunning");
}
else
{
LLNotifications::instance().add("NoOutsideScripts");
}
}
示例3: onClickScripts
// static
void LLStatusBar::onClickScripts(void*)
{
LLViewerRegion* region = gAgent.getRegion();
if(region && region->getRegionFlags() & REGION_FLAGS_ESTATE_SKIP_SCRIPTS)
{
LLNotifyBox::showXml("ScriptsStopped");
}
else if(region && region->getRegionFlags() & REGION_FLAGS_SKIP_SCRIPTS)
{
LLNotifyBox::showXml("ScriptsNotRunning");
}
else
{
LLNotifyBox::showXml("NoOutsideScripts");
}
}
示例4: onParcelIconClick
void LLPanelTopInfoBar::onParcelIconClick(EParcelIcon icon)
{
switch (icon)
{
case VOICE_ICON:
LLNotificationsUtil::add("NoVoice");
break;
case FLY_ICON:
LLNotificationsUtil::add("NoFly");
break;
case PUSH_ICON:
LLNotificationsUtil::add("PushRestricted");
break;
case BUILD_ICON:
LLNotificationsUtil::add("NoBuild");
break;
case SCRIPTS_ICON:
{
LLViewerRegion* region = gAgent.getRegion();
if(region && region->getRegionFlags() & REGION_FLAGS_ESTATE_SKIP_SCRIPTS)
{
LLNotificationsUtil::add("ScriptsStopped");
}
else if(region && region->getRegionFlags() & REGION_FLAGS_SKIP_SCRIPTS)
{
LLNotificationsUtil::add("ScriptsNotRunning");
}
else
{
LLNotificationsUtil::add("NoOutsideScripts");
}
break;
}
case DAMAGE_ICON:
LLNotificationsUtil::add("NotSafe");
break;
case SEE_AVATARS_ICON:
LLNotificationsUtil::add("SeeAvatars");
break;
case ICON_COUNT:
break;
// no default to get compiler warning when a new icon gets added
}
}
示例5: addDuplicate
// Used by the placer tool to add copies of the current selection.
// Inspired by add_object(). JC
BOOL LLToolPlacer::addDuplicate(S32 x, S32 y)
{
LLVector3 ray_start_region;
LLVector3 ray_end_region;
LLViewerRegion* regionp = NULL;
BOOL b_hit_land = FALSE;
S32 hit_face = -1;
LLViewerObject* hit_obj = NULL;
BOOL success = raycastForNewObjPos( x, y, &hit_obj, &hit_face, &b_hit_land, &ray_start_region, &ray_end_region, ®ionp );
if( !success )
{
make_ui_sound("UISndInvalidOp");
return FALSE;
}
if( hit_obj && (hit_obj->isAvatar() || hit_obj->isAttachment()) )
{
// Can't create objects on avatars or attachments
make_ui_sound("UISndInvalidOp");
return FALSE;
}
// Limit raycast to a single object.
// Speeds up server raycast + avoid problems with server ray hitting objects
// that were clipped by the near plane or culled on the viewer.
LLUUID ray_target_id;
if( hit_obj )
{
ray_target_id = hit_obj->getID();
}
else
{
ray_target_id.setNull();
}
gSelectMgr->selectDuplicateOnRay(ray_start_region,
ray_end_region,
b_hit_land, // suppress raycast
FALSE, // intersection
ray_target_id,
gSavedSettings.getBOOL("CreateToolCopyCenters"),
gSavedSettings.getBOOL("CreateToolCopyRotates"),
FALSE); // select copy
if (regionp
&& (regionp->getRegionFlags() & REGION_FLAGS_SANDBOX))
{
LLFirstUse::useSandbox();
}
return TRUE;
}
示例6: updateCovenantInfo
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());
}
示例7: addObject
BOOL LLToolPlacer::addObject( LLPCode pcode, S32 x, S32 y, U8 use_physics )
{
LLVector3 ray_start_region;
LLVector3 ray_end_region;
LLViewerRegion* regionp = NULL;
BOOL b_hit_land = FALSE;
S32 hit_face = -1;
LLViewerObject* hit_obj = NULL;
U8 state = 0;
BOOL success = raycastForNewObjPos( x, y, &hit_obj, &hit_face, &b_hit_land, &ray_start_region, &ray_end_region, ®ionp );
if( !success )
{
return FALSE;
}
if( hit_obj && (hit_obj->isAvatar() || hit_obj->isAttachment()) )
{
// Can't create objects on avatars or attachments
return FALSE;
}
if (NULL == regionp)
{
llwarns << "regionp was NULL; aborting function." << llendl;
return FALSE;
}
if (regionp->getRegionFlags() & REGION_FLAGS_SANDBOX)
{
LLFirstUse::useSandbox();
}
// Set params for new object based on its PCode.
LLQuaternion rotation;
LLVector3 scale = DEFAULT_OBJECT_SCALE;
U8 material = LL_MCODE_WOOD;
BOOL create_selected = FALSE;
LLVolumeParams volume_params;
switch (pcode)
{
case LL_PCODE_LEGACY_GRASS:
// Randomize size of grass patch
scale.setVec(10.f + ll_frand(20.f), 10.f + ll_frand(20.f), 1.f + ll_frand(2.f));
state = rand() % LLVOGrass::sMaxGrassSpecies;
break;
case LL_PCODE_LEGACY_TREE:
case LL_PCODE_TREE_NEW:
state = rand() % LLVOTree::sMaxTreeSpecies;
break;
case LL_PCODE_SPHERE:
case LL_PCODE_CONE:
case LL_PCODE_CUBE:
case LL_PCODE_CYLINDER:
case LL_PCODE_TORUS:
case LLViewerObject::LL_VO_SQUARE_TORUS:
case LLViewerObject::LL_VO_TRIANGLE_TORUS:
default:
create_selected = TRUE;
break;
}
// Play creation sound
if (gAudiop)
{
F32 volume = gSavedSettings.getBOOL("MuteUI") ? 0.f : gSavedSettings.getF32("AudioLevelUI");
gAudiop->triggerSound( LLUUID(gSavedSettings.getString("UISndObjectCreate")), gAgent.getID(), volume);
}
gMessageSystem->newMessageFast(_PREHASH_ObjectAdd);
gMessageSystem->nextBlockFast(_PREHASH_AgentData);
gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
gMessageSystem->addUUIDFast(_PREHASH_GroupID, gAgent.getGroupID());
gMessageSystem->nextBlockFast(_PREHASH_ObjectData);
gMessageSystem->addU8Fast(_PREHASH_Material, material);
U32 flags = 0; // not selected
if (use_physics)
{
flags |= FLAGS_USE_PHYSICS;
}
if (create_selected)
{
flags |= FLAGS_CREATE_SELECTED;
}
gMessageSystem->addU32Fast(_PREHASH_AddFlags, flags );
LLPCode volume_pcode; // ...PCODE_VOLUME, or the original on error
switch (pcode)
{
case LL_PCODE_SPHERE:
rotation.setQuat(90.f * DEG_TO_RAD, LLVector3::y_axis);
volume_params.setType( LL_PCODE_PROFILE_CIRCLE_HALF, LL_PCODE_PATH_CIRCLE );
volume_params.setBeginAndEndS( 0.f, 1.f );
volume_params.setBeginAndEndT( 0.f, 1.f );
//.........这里部分代码省略.........
示例8: refresh
//.........这里部分代码省略.........
if ((region && region->getBlockFly()) ||
(parcel && !parcel->getAllowFly()) )
{
// No Fly Zone
childGetRect( "no_fly", buttonRect );
childSetVisible( "no_fly", true );
r.setOriginAndSize( x, y, buttonRect.getWidth(), buttonRect.getHeight());
childSetRect( "no_fly", r );
x += buttonRect.getWidth();
}
else
{
// Fly Zone
childSetVisible("no_fly", false);
}
BOOL no_build = parcel && !parcel->getAllowModify();
if (no_build)
{
childSetVisible("no_build", TRUE);
childGetRect( "no_build", buttonRect );
// No Build Zone
r.setOriginAndSize( x, y, buttonRect.getWidth(), buttonRect.getHeight());
childSetRect( "no_build", r );
x += buttonRect.getWidth();
}
else
{
childSetVisible("no_build", FALSE);
}
BOOL no_scripts = FALSE;
if((region
&& ((region->getRegionFlags() & REGION_FLAGS_SKIP_SCRIPTS)
|| (region->getRegionFlags() & REGION_FLAGS_ESTATE_SKIP_SCRIPTS)))
|| (parcel && !parcel->getAllowOtherScripts()))
{
no_scripts = TRUE;
}
if (no_scripts)
{
// No scripts
childSetVisible("no_scripts", TRUE);
childGetRect( "no_scripts", buttonRect );
r.setOriginAndSize( x, y, buttonRect.getWidth(), buttonRect.getHeight());
childSetRect( "no_scripts", r );
x += buttonRect.getWidth();
}
else
{
// Yes scripts
childSetVisible("no_scripts", FALSE);
}
BOOL no_region_push = (region && region->getRestrictPushObject());
BOOL no_push = no_region_push || (parcel && parcel->getRestrictPushObject());
if (no_push)
{
childSetVisible("restrictpush", TRUE);
childGetRect( "restrictpush", buttonRect );
r.setOriginAndSize( x, y, buttonRect.getWidth(), buttonRect.getHeight());
childSetRect( "restrictpush", r );
x += buttonRect.getWidth();
}
else
{
示例9: refresh
// 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)
{
childSetEnabled("button buy land",TRUE);
}
else
{
childSetEnabled("button buy land",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->getRegionFlags() && 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","[PRICE]", llformat("%d",claim_price));
childSetTextArg("label_area_price","[AREA]", llformat("%d",area));
childSetVisible("label_area_price",true);
childSetVisible("label_area",false);
//.........这里部分代码省略.........
示例10: addObject
BOOL LLToolPlacer::addObject( LLPCode pcode, S32 x, S32 y, U8 use_physics )
{
LLVector3 ray_start_region;
LLVector3 ray_end_region;
LLViewerRegion* regionp = NULL;
BOOL b_hit_land = FALSE;
S32 hit_face = -1;
LLViewerObject* hit_obj = NULL;
U8 state = 0;
BOOL success = raycastForNewObjPos( x, y, &hit_obj, &hit_face, &b_hit_land, &ray_start_region, &ray_end_region, ®ionp );
if( !success )
{
return FALSE;
}
if( hit_obj && (hit_obj->isAvatar() || hit_obj->isAttachment()) )
{
// Can't create objects on avatars or attachments
return FALSE;
}
if (NULL == regionp)
{
llwarns << "regionp was NULL; aborting function." << llendl;
return FALSE;
}
if (regionp->getRegionFlags() & REGION_FLAGS_SANDBOX)
{
LLFirstUse::useSandbox();
}
// Set params for new object based on its PCode.
LLQuaternion rotation;
LLVector3 scale = LLVector3(
gSavedSettings.getF32("EmeraldBuildPrefs_Xsize"),
gSavedSettings.getF32("EmeraldBuildPrefs_Ysize"),
gSavedSettings.getF32("EmeraldBuildPrefs_Zsize"));
U8 material = LL_MCODE_WOOD;
if(gSavedSettings.getString("EmeraldBuildPrefs_Material")== "Stone") material = LL_MCODE_STONE;
if(gSavedSettings.getString("EmeraldBuildPrefs_Material")== "Metal") material = LL_MCODE_METAL;
if(gSavedSettings.getString("EmeraldBuildPrefs_Material")== "Wood") material = LL_MCODE_WOOD;
if(gSavedSettings.getString("EmeraldBuildPrefs_Material")== "Flesh") material = LL_MCODE_FLESH;
if(gSavedSettings.getString("EmeraldBuildPrefs_Material")== "Rubber") material = LL_MCODE_RUBBER;
if(gSavedSettings.getString("EmeraldBuildPrefs_Material")== "Plastic") material = LL_MCODE_PLASTIC;
BOOL create_selected = FALSE;
LLVolumeParams volume_params;
switch (pcode)
{
case LL_PCODE_LEGACY_GRASS:
// Randomize size of grass patch
scale.setVec(10.f + ll_frand(20.f), 10.f + ll_frand(20.f), 1.f + ll_frand(2.f));
state = rand() % LLVOGrass::sMaxGrassSpecies;
break;
case LL_PCODE_LEGACY_TREE:
case LL_PCODE_TREE_NEW:
state = rand() % LLVOTree::sMaxTreeSpecies;
break;
case LL_PCODE_SPHERE:
case LL_PCODE_CONE:
case LL_PCODE_CUBE:
case LL_PCODE_CYLINDER:
case LL_PCODE_TORUS:
case LLViewerObject::LL_VO_SQUARE_TORUS:
case LLViewerObject::LL_VO_TRIANGLE_TORUS:
default:
create_selected = TRUE;
break;
}
// Play creation sound
if (gAudiop)
{
gAudiop->triggerSound( LLUUID(gSavedSettings.getString("UISndObjectCreate")),
gAgent.getID(), 1.0f, LLAudioEngine::AUDIO_TYPE_UI);
}
gMessageSystem->newMessageFast(_PREHASH_ObjectAdd);
gMessageSystem->nextBlockFast(_PREHASH_AgentData);
gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
//MOYMOD 2009-05, If avatar is in land group/land owner group,
// it rezzes it with it to prevent autoreturn/whatever
if(gSavedSettings.getBOOL("mm_alwaysRezWithLandGroup")){
LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
if(gAgent.isInGroup(parcel->getGroupID())){
gMessageSystem->addUUIDFast(_PREHASH_GroupID, parcel->getGroupID());
}else if(gAgent.isInGroup(parcel->getOwnerID())){
gMessageSystem->addUUIDFast(_PREHASH_GroupID, parcel->getOwnerID());
}else gMessageSystem->addUUIDFast(_PREHASH_GroupID, gAgent.getGroupID());
}else gMessageSystem->addUUIDFast(_PREHASH_GroupID, gAgent.getGroupID());
//.........这里部分代码省略.........
示例11: refresh
//.........这里部分代码省略.........
// invisible if region doesn't allow damage
mBtnHealth->setVisible(FALSE);
mTextHealth->setVisible(FALSE);
}
if ((region && region->getBlockFly()) ||
(parcel && !parcel->getAllowFly()) )
{
// No Fly Zone
childGetRect( "fly", buttonRect );
mBtnFly->setVisible(TRUE);
r.setOriginAndSize( x, y-GRAPHIC_FUDGE, buttonRect.getWidth(), buttonRect.getHeight());
mBtnFly->setRect(r);
x += buttonRect.getWidth();
}
else
{
mBtnFly->setVisible(FALSE);
}
BOOL no_build = parcel && !parcel->getAllowModify();
mBtnBuild->setVisible( no_build );
if (no_build)
{
childGetRect( "build", buttonRect );
// No Build Zone
r.setOriginAndSize( x, y-GRAPHIC_FUDGE, buttonRect.getWidth(), buttonRect.getHeight());
mBtnBuild->setRect(r);
x += buttonRect.getWidth();
}
BOOL no_scripts = FALSE;
if((region
&& ((region->getRegionFlags() & REGION_FLAGS_SKIP_SCRIPTS)
|| (region->getRegionFlags() & REGION_FLAGS_ESTATE_SKIP_SCRIPTS)))
|| (parcel && !parcel->getAllowOtherScripts()))
{
no_scripts = TRUE;
}
mBtnScripts->setVisible( no_scripts );
if (no_scripts)
{
// No scripts
childGetRect( "scripts", buttonRect );
r.setOriginAndSize( x, y-GRAPHIC_FUDGE, buttonRect.getWidth(), buttonRect.getHeight());
mBtnScripts->setRect(r);
x += buttonRect.getWidth();
}
BOOL no_region_push = (region && region->getRestrictPushObject());
BOOL no_push = no_region_push || (parcel && parcel->getRestrictPushObject());
mBtnPush->setVisible( no_push );
if (no_push)
{
childGetRect( "restrictpush", buttonRect );
// No Push Zone
r.setOriginAndSize( x, y-GRAPHIC_FUDGE, buttonRect.getWidth(), buttonRect.getHeight());
mBtnPush->setRect(r);
x += buttonRect.getWidth();
}
BOOL canBuyLand = parcel
&& !parcel->isPublic()
&& gParcelMgr->canAgentBuyParcel(parcel, false);
mBtnBuyLand->setVisible(canBuyLand);
if (canBuyLand)
示例12: updateCovenantInfo
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());
}