本文整理汇总了C++中LLViewerParcelMgr::getAgentParcel方法的典型用法代码示例。如果您正苦于以下问题:C++ LLViewerParcelMgr::getAgentParcel方法的具体用法?C++ LLViewerParcelMgr::getAgentParcel怎么用?C++ LLViewerParcelMgr::getAgentParcel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLViewerParcelMgr
的用法示例。
在下文中一共展示了LLViewerParcelMgr::getAgentParcel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateParcelIcons
void LLStatusBar::updateParcelIcons()
{
LLViewerParcelMgr* vpm = LLViewerParcelMgr::getInstance();
LLViewerRegion* agent_region = gAgent.getRegion();
LLParcel* agent_parcel = vpm->getAgentParcel();
if (!agent_region || !agent_parcel)
return;
if (gSavedSettings.getBOOL("NavBarShowParcelProperties"))
{
LLParcel* current_parcel;
LLViewerRegion* selection_region = vpm->getSelectionRegion();
LLParcel* selected_parcel = vpm->getParcelSelection()->getParcel();
// If agent is in selected parcel we use its properties because
// they are updated more often by LLViewerParcelMgr than agent parcel properties.
// See LLViewerParcelMgr::processParcelProperties().
// This is needed to reflect parcel restrictions changes without having to leave
// the parcel and then enter it again. See EXT-2987
if (selected_parcel && selected_parcel->getLocalID() == agent_parcel->getLocalID()
&& selection_region == agent_region)
{
current_parcel = selected_parcel;
}
else
{
current_parcel = agent_parcel;
}
bool allow_voice = vpm->allowAgentVoice(agent_region, current_parcel);
bool allow_fly = vpm->allowAgentFly(agent_region, current_parcel);
bool allow_push = vpm->allowAgentPush(agent_region, current_parcel);
bool allow_build = vpm->allowAgentBuild(current_parcel); // true when anyone is allowed to build. See EXT-4610.
bool allow_scripts = vpm->allowAgentScripts(agent_region, current_parcel);
bool allow_damage = vpm->allowAgentDamage(agent_region, current_parcel);
//bool has_pwl = KCWindlightInterface::instance().WLset;
// Most icons are "block this ability"
mParcelIcon[VOICE_ICON]->setVisible( !allow_voice );
mParcelIcon[FLY_ICON]->setVisible( !allow_fly );
mParcelIcon[PUSH_ICON]->setVisible( !allow_push );
mParcelIcon[BUILD_ICON]->setVisible( !allow_build );
mParcelIcon[SCRIPTS_ICON]->setVisible( !allow_scripts );
mParcelIcon[DAMAGE_ICON]->setVisible( allow_damage );
mDamageText->setVisible(allow_damage);
//mPWLBtn->setVisible(has_pwl);
//mPWLBtn->setEnabled(has_pwl);
layoutParcelIcons();
}
else
{
for (S32 i = 0; i < ICON_COUNT; ++i)
{
mParcelIcon[i]->setVisible(false);
}
mDamageText->setVisible(false);
}
}
示例2: refreshParcelIcons
void LLLocationInputCtrl::refreshParcelIcons()
{
// Our "cursor" moving right to left
S32 x = mAddLandmarkBtn->getRect().mLeft;
LLViewerParcelMgr* vpm = LLViewerParcelMgr::getInstance();
LLViewerRegion* agent_region = gAgent.getRegion();
LLParcel* agent_parcel = vpm->getAgentParcel();
if (!agent_region || !agent_parcel)
return;
mForSaleBtn->setVisible(vpm->canAgentBuyParcel(agent_parcel, false));
x = layout_widget(mForSaleBtn, x);
if (gSavedSettings.getBOOL("NavBarShowParcelProperties"))
{
LLParcel* current_parcel;
LLViewerRegion* selection_region = vpm->getSelectionRegion();
LLParcel* selected_parcel = vpm->getParcelSelection()->getParcel();
// If agent is in selected parcel we use its properties because
// they are updated more often by LLViewerParcelMgr than agent parcel properties.
// See LLViewerParcelMgr::processParcelProperties().
// This is needed to reflect parcel restrictions changes without having to leave
// the parcel and then enter it again. See EXT-2987
if (selected_parcel && selected_parcel->getLocalID() == agent_parcel->getLocalID()
&& selection_region == agent_region)
{
current_parcel = selected_parcel;
}
else
{
current_parcel = agent_parcel;
}
bool allow_voice = vpm->allowAgentVoice(agent_region, current_parcel);
bool allow_fly = vpm->allowAgentFly(agent_region, current_parcel);
bool allow_push = vpm->allowAgentPush(agent_region, current_parcel);
bool allow_build = vpm->allowAgentBuild(current_parcel); // true when anyone is allowed to build. See EXT-4610.
bool allow_scripts = vpm->allowAgentScripts(agent_region, current_parcel);
bool allow_damage = vpm->allowAgentDamage(agent_region, current_parcel);
// Most icons are "block this ability"
mParcelIcon[VOICE_ICON]->setVisible( !allow_voice );
mParcelIcon[FLY_ICON]->setVisible( !allow_fly );
mParcelIcon[PUSH_ICON]->setVisible( !allow_push );
mParcelIcon[BUILD_ICON]->setVisible( !allow_build );
mParcelIcon[SCRIPTS_ICON]->setVisible( !allow_scripts );
mParcelIcon[DAMAGE_ICON]->setVisible( allow_damage );
mDamageText->setVisible(allow_damage);
// Padding goes to left of both landmark star and for sale btn
x -= mAddLandmarkHPad;
// Slide the parcel icons rect from right to left, adjusting rectangles
for (S32 i = 0; i < ICON_COUNT; ++i)
{
x = layout_widget(mParcelIcon[i], x);
x -= mIconHPad;
}
x = layout_widget(mDamageText, x);
x -= mIconHPad;
}
else
{
for (S32 i = 0; i < ICON_COUNT; ++i)
{
mParcelIcon[i]->setVisible(false);
}
mDamageText->setVisible(false);
}
if (mTextEntry)
{
S32 left_pad, right_pad;
mTextEntry->getTextPadding(&left_pad, &right_pad);
right_pad = mTextEntry->getRect().mRight - x;
mTextEntry->setTextPadding(left_pad, right_pad);
}
}