本文整理汇总了C++中LLSD::asBoolean方法的典型用法代码示例。如果您正苦于以下问题:C++ LLSD::asBoolean方法的具体用法?C++ LLSD::asBoolean怎么用?C++ LLSD::asBoolean使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLSD
的用法示例。
在下文中一共展示了LLSD::asBoolean方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updatePhoenixPlayChatAnimation
void LLNearbyChatBar::updatePhoenixPlayChatAnimation(const LLSD &data)
{
PhoenixPlayChatAnimation = data.asBoolean();
}
示例2: handleRenderDynamicLODChanged
static bool handleRenderDynamicLODChanged(const LLSD& newvalue)
{
LLPipeline::sDynamicLOD = newvalue.asBoolean();
return true;
}
示例3: handleAuditTextureChanged
static bool handleAuditTextureChanged(const LLSD& newvalue)
{
gAuditTexture = newvalue.asBoolean();
return true;
}
示例4: handleRenderAvatarMouselookChanged
static bool handleRenderAvatarMouselookChanged(const LLSD& newvalue)
{
LLVOAvatar::sVisibleInFirstPerson = newvalue.asBoolean();
return true;
}
示例5: handleAnisotropicChanged
static bool handleAnisotropicChanged(const LLSD& newvalue)
{
LLImageGL::sGlobalUseAnisotropic = newvalue.asBoolean();
LLImageGL::dirtyTexOptions();
return true;
}
示例6: updateChatVisible
bool updateChatVisible(const LLSD &data)
{
LLOverlayBar::sChatVisible = data.asBoolean();
return true;
}
示例7: updateControl
// we've switched controls, or doing per-frame update, so update spinners, etc.
void LLFloaterSettingsDebug::updateControl(LLControlVariable* controlp)
{
LLSpinCtrl* spinner1 = getChild<LLSpinCtrl>("val_spinner_1");
LLSpinCtrl* spinner2 = getChild<LLSpinCtrl>("val_spinner_2");
LLSpinCtrl* spinner3 = getChild<LLSpinCtrl>("val_spinner_3");
LLSpinCtrl* spinner4 = getChild<LLSpinCtrl>("val_spinner_4");
LLColorSwatchCtrl* color_swatch = getChild<LLColorSwatchCtrl>("val_color_swatch");
if (!spinner1 || !spinner2 || !spinner3 || !spinner4 || !color_swatch)
{
llwarns << "Could not find all desired controls by name"
<< llendl;
return;
}
spinner1->setVisible(FALSE);
spinner2->setVisible(FALSE);
spinner3->setVisible(FALSE);
spinner4->setVisible(FALSE);
color_swatch->setVisible(FALSE);
getChildView("val_text")->setVisible( FALSE);
mComment->setText(LLStringUtil::null);
if (controlp)
{
eControlType type = controlp->type();
//hide combo box only for non booleans, otherwise this will result in the combo box closing every frame
getChildView("boolean_combo")->setVisible( type == TYPE_BOOLEAN);
mComment->setText(controlp->getComment());
spinner1->setMaxValue(F32_MAX);
spinner2->setMaxValue(F32_MAX);
spinner3->setMaxValue(F32_MAX);
spinner4->setMaxValue(F32_MAX);
spinner1->setMinValue(-F32_MAX);
spinner2->setMinValue(-F32_MAX);
spinner3->setMinValue(-F32_MAX);
spinner4->setMinValue(-F32_MAX);
if (!spinner1->hasFocus())
{
spinner1->setIncrement(0.1f);
}
if (!spinner2->hasFocus())
{
spinner2->setIncrement(0.1f);
}
if (!spinner3->hasFocus())
{
spinner3->setIncrement(0.1f);
}
if (!spinner4->hasFocus())
{
spinner4->setIncrement(0.1f);
}
LLSD sd = controlp->get();
switch(type)
{
case TYPE_U32:
spinner1->setVisible(TRUE);
spinner1->setLabel(std::string("value")); // Debug, don't translate
if (!spinner1->hasFocus())
{
spinner1->setValue(sd);
spinner1->setMinValue((F32)U32_MIN);
spinner1->setMaxValue((F32)U32_MAX);
spinner1->setIncrement(1.f);
spinner1->setPrecision(0);
}
break;
case TYPE_S32:
spinner1->setVisible(TRUE);
spinner1->setLabel(std::string("value")); // Debug, don't translate
if (!spinner1->hasFocus())
{
spinner1->setValue(sd);
spinner1->setMinValue((F32)S32_MIN);
spinner1->setMaxValue((F32)S32_MAX);
spinner1->setIncrement(1.f);
spinner1->setPrecision(0);
}
break;
case TYPE_F32:
spinner1->setVisible(TRUE);
spinner1->setLabel(std::string("value")); // Debug, don't translate
if (!spinner1->hasFocus())
{
spinner1->setPrecision(3);
spinner1->setValue(sd);
}
break;
case TYPE_BOOLEAN:
if (!getChild<LLUICtrl>("boolean_combo")->hasFocus())
{
if (sd.asBoolean())
{
getChild<LLUICtrl>("boolean_combo")->setValue(LLSD("true"));
//.........这里部分代码省略.........
示例8: updateChatVisible
bool LLOverlayBar::updateChatVisible(const LLSD &data)
{
mChatBar->getParent()->setVisible(data.asBoolean());
return true;
}
示例9: updateAORemoteVisible
bool LLOverlayBar::updateAORemoteVisible(const LLSD &data)
{
mAORemoteContainer->setVisible(data.asBoolean());
return true;
}
示例10: handleAllowLargeSounds
static bool handleAllowLargeSounds(const LLSD& newvalue)
{
if(gAudiop)
gAudiop->setAllowLargeSounds(newvalue.asBoolean());
return true;
}
示例11: setValue
void LLRadioCtrl::setValue(const LLSD& value)
{
LLCheckBoxCtrl::setValue(value);
mButton->setTabStop(value.asBoolean());
}
示例12: updateFSUseNearbyChatConsole
void LLNearbyChatHandler::updateFSUseNearbyChatConsole(const LLSD &data)
{
FSUseNearbyChatConsole = data.asBoolean();
}
示例13: format_impl
S32 LLSDXMLFormatter::format_impl(const LLSD& data, std::ostream& ostr, U32 options, U32 level) const
{
S32 format_count = 1;
std::string pre;
std::string post;
if (options & LLSDFormatter::OPTIONS_PRETTY)
{
for (U32 i = 0; i < level; i++)
{
pre += " ";
}
post = "\n";
}
switch(data.type())
{
case LLSD::TypeMap:
if (0 == data.size())
{
ostr << pre << "<map />" << post;
}
else
{
ostr << pre << "<map>" << post;
LLSD::map_const_iterator iter = data.beginMap();
LLSD::map_const_iterator end = data.endMap();
for (; iter != end; ++iter)
{
ostr << pre << "<key>" << escapeString((*iter).first) << "</key>" << post;
format_count += format_impl((*iter).second, ostr, options, level + 1);
}
ostr << pre << "</map>" << post;
}
break;
case LLSD::TypeArray:
if (0 == data.size())
{
ostr << pre << "<array />" << post;
}
else
{
ostr << pre << "<array>" << post;
LLSD::array_const_iterator iter = data.beginArray();
LLSD::array_const_iterator end = data.endArray();
for(; iter != end; ++iter)
{
format_count += format_impl(*iter, ostr, options, level + 1);
}
ostr << pre << "</array>" << post;
}
break;
case LLSD::TypeUndefined:
ostr << pre << "<undef />" << post;
break;
case LLSD::TypeBoolean:
ostr << pre << "<boolean>";
if (mBoolAlpha || (ostr.flags() & std::ios::boolalpha))
{
ostr << (data.asBoolean() ? "true" : "false");
}
else
{
ostr << (data.asBoolean() ? 1 : 0);
}
ostr << "</boolean>" << post;
break;
case LLSD::TypeInteger:
ostr << pre << "<integer>" << data.asInteger() << "</integer>" << post;
break;
case LLSD::TypeReal:
ostr << pre << "<real>";
if (mRealFormat.empty())
{
ostr << data.asReal();
}
else
{
formatReal(data.asReal(), ostr);
}
ostr << "</real>" << post;
break;
case LLSD::TypeUUID:
if (data.asUUID().isNull())
{
ostr << pre << "<uuid />" << post;
}
else
{
ostr << pre << "<uuid>" << data.asUUID() << "</uuid>" << post;
}
break;
case LLSD::TypeString:
//.........这里部分代码省略.........
示例14: updateControl
//.........这里部分代码省略.........
if (!spinner1->hasFocus())
{
spinner1->setValue(sd);
spinner1->setMinValue((F32)U32_MIN);
spinner1->setMaxValue((F32)U32_MAX);
spinner1->setIncrement(1.f);
spinner1->setPrecision(0);
}
break;
case TYPE_S32:
spinner1->setVisible(TRUE);
spinner1->setLabel(std::string("value")); // Debug, don't translate
if (!spinner1->hasFocus())
{
spinner1->setValue(sd);
spinner1->setMinValue((F32)S32_MIN);
spinner1->setMaxValue((F32)S32_MAX);
spinner1->setIncrement(1.f);
spinner1->setPrecision(0);
}
break;
case TYPE_F32:
spinner1->setVisible(TRUE);
spinner1->setLabel(std::string("value")); // Debug, don't translate
if (!spinner1->hasFocus())
{
spinner1->setPrecision(3);
spinner1->setValue(sd);
}
break;
case TYPE_BOOLEAN:
if (!getChild<LLUICtrl>("boolean_combo")->hasFocus())
{
if (sd.asBoolean())
{
getChild<LLUICtrl>("boolean_combo")->setValue(LLSD("true"));
}
else
{
getChild<LLUICtrl>("boolean_combo")->setValue(LLSD(""));
}
}
break;
case TYPE_STRING:
getChildView("val_text")->setVisible( TRUE);
if (!getChild<LLUICtrl>("val_text")->hasFocus())
{
getChild<LLUICtrl>("val_text")->setValue(sd);
}
break;
case TYPE_VEC3:
{
LLVector3 v;
v.setValue(sd);
spinner1->setVisible(TRUE);
spinner1->setLabel(std::string("X"));
spinner2->setVisible(TRUE);
spinner2->setLabel(std::string("Y"));
spinner3->setVisible(TRUE);
spinner3->setLabel(std::string("Z"));
if (!spinner1->hasFocus())
{
spinner1->setPrecision(3);
spinner1->setValue(v[VX]);
}
if (!spinner2->hasFocus())
示例15: handleShowXUINamesChanged
bool handleShowXUINamesChanged(const LLSD& newvalue)
{
LLUI::sShowXUINames = newvalue.asBoolean();
return true;
}