void LLNearbyChatBar::updatePhoenixPlayChatAnimation(const LLSD &data) { PhoenixPlayChatAnimation = data.asBoolean(); }
static bool handleRenderDynamicLODChanged(const LLSD& newvalue) { LLPipeline::sDynamicLOD = newvalue.asBoolean(); return true; }
static bool handleAuditTextureChanged(const LLSD& newvalue) { gAuditTexture = newvalue.asBoolean(); return true; }
static bool handleRenderAvatarMouselookChanged(const LLSD& newvalue) { LLVOAvatar::sVisibleInFirstPerson = newvalue.asBoolean(); return true; }
static bool handleAnisotropicChanged(const LLSD& newvalue) { LLImageGL::sGlobalUseAnisotropic = newvalue.asBoolean(); LLImageGL::dirtyTexOptions(); return true; }
bool updateChatVisible(const LLSD &data) { LLOverlayBar::sChatVisible = data.asBoolean(); return true; }
// 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")); } 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()) { spinner2->setPrecision(3); spinner2->setValue(v[VY]); } if (!spinner3->hasFocus()) { spinner3->setPrecision(3); spinner3->setValue(v[VZ]); } break; } case TYPE_VEC3D: { LLVector3d 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()) { spinner2->setPrecision(3); spinner2->setValue(v[VY]); } if (!spinner3->hasFocus()) { spinner3->setPrecision(3); spinner3->setValue(v[VZ]); } break; } case TYPE_RECT: { LLRect r; r.setValue(sd); spinner1->setVisible(TRUE); spinner1->setLabel(std::string("Left")); spinner2->setVisible(TRUE); spinner2->setLabel(std::string("Right")); spinner3->setVisible(TRUE); spinner3->setLabel(std::string("Bottom")); spinner4->setVisible(TRUE); spinner4->setLabel(std::string("Top")); if (!spinner1->hasFocus()) { spinner1->setPrecision(0); spinner1->setValue(r.mLeft); } if (!spinner2->hasFocus()) { spinner2->setPrecision(0); spinner2->setValue(r.mRight); } if (!spinner3->hasFocus()) { spinner3->setPrecision(0); spinner3->setValue(r.mBottom); } if (!spinner4->hasFocus()) { spinner4->setPrecision(0); spinner4->setValue(r.mTop); } spinner1->setMinValue((F32)S32_MIN); spinner1->setMaxValue((F32)S32_MAX); spinner1->setIncrement(1.f); spinner2->setMinValue((F32)S32_MIN); spinner2->setMaxValue((F32)S32_MAX); spinner2->setIncrement(1.f); spinner3->setMinValue((F32)S32_MIN); spinner3->setMaxValue((F32)S32_MAX); spinner3->setIncrement(1.f); spinner4->setMinValue((F32)S32_MIN); spinner4->setMaxValue((F32)S32_MAX); spinner4->setIncrement(1.f); break; } case TYPE_COL4: { LLColor4 clr; clr.setValue(sd); color_swatch->setVisible(TRUE); // only set if changed so color picker doesn't update if(clr != LLColor4(color_swatch->getValue())) { color_swatch->set(LLColor4(sd), TRUE, FALSE); } spinner4->setVisible(TRUE); spinner4->setLabel(std::string("Alpha")); if (!spinner4->hasFocus()) { spinner4->setPrecision(3); spinner4->setMinValue(0.0); spinner4->setMaxValue(1.f); spinner4->setValue(clr.mV[VALPHA]); } break; } case TYPE_COL3: { LLColor3 clr; clr.setValue(sd); color_swatch->setVisible(TRUE); color_swatch->setValue(sd); break; } default: mComment->setText(std::string("unknown")); break; } } }
bool LLOverlayBar::updateChatVisible(const LLSD &data) { mChatBar->getParent()->setVisible(data.asBoolean()); return true; }
bool LLOverlayBar::updateAORemoteVisible(const LLSD &data) { mAORemoteContainer->setVisible(data.asBoolean()); return true; }
static bool handleAllowLargeSounds(const LLSD& newvalue) { if(gAudiop) gAudiop->setAllowLargeSounds(newvalue.asBoolean()); return true; }
void LLRadioCtrl::setValue(const LLSD& value) { LLCheckBoxCtrl::setValue(value); mButton->setTabStop(value.asBoolean()); }
void LLNearbyChatHandler::updateFSUseNearbyChatConsole(const LLSD &data) { FSUseNearbyChatConsole = data.asBoolean(); }
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: if (data.asString().empty()) ostr << pre << "<string />" << post; else ostr << pre << "<string>" << escapeString(data.asString()) <<"</string>" << post; break; case LLSD::TypeDate: ostr << pre << "<date>" << data.asDate() << "</date>" << post; break; case LLSD::TypeURI: ostr << pre << "<uri>" << escapeString(data.asString()) << "</uri>" << post; break; case LLSD::TypeBinary: { LLSD::Binary buffer = data.asBinary(); if (buffer.empty()) { ostr << pre << "<binary />" << post; } else { // *FIX: memory inefficient. // *TODO: convert to use LLBase64 ostr << pre << "<binary encoding=\"base64\">"; int b64_buffer_length = apr_base64_encode_len(buffer.size()); char* b64_buffer = new char[b64_buffer_length]; b64_buffer_length = apr_base64_encode_binary(b64_buffer, &buffer[0], buffer.size()); ostr.write(b64_buffer, b64_buffer_length - 1); delete[] b64_buffer; ostr << "</binary>" << post; } break; } default: // *NOTE: This should never happen. ostr << pre << "<undef />" << post; break; } return format_count; }
// 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) { // [RLVa:KB] - Checked: 2011-05-28 (RLVa-1.4.0a) | Modified: RLVa-1.4.0a // If "HideFromEditor" was toggled while the floater is open then we need to manually disable access to the control // NOTE: this runs per-frame so there's no need to explictly handle onCommitSettings() or onClickDefault() bool fEnable = !controlp->isHiddenFromSettingsEditor(); spinner1->setEnabled(fEnable); spinner2->setEnabled(fEnable); spinner3->setEnabled(fEnable); spinner4->setEnabled(fEnable); color_swatch->setEnabled(fEnable); childSetEnabled("val_text", fEnable); childSetEnabled("boolean_combo", fEnable); childSetEnabled("default_btn", fEnable); // [/RLVa:KB] 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")); } 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()) { spinner2->setPrecision(3); spinner2->setValue(v[VY]); } if (!spinner3->hasFocus()) { spinner3->setPrecision(3); spinner3->setValue(v[VZ]); } break; } case TYPE_VEC3D: { LLVector3d 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()) { spinner2->setPrecision(3); spinner2->setValue(v[VY]); } if (!spinner3->hasFocus()) { spinner3->setPrecision(3); spinner3->setValue(v[VZ]); } break; } case TYPE_RECT: { LLRect r; r.setValue(sd); spinner1->setVisible(TRUE); spinner1->setLabel(std::string("Left")); spinner2->setVisible(TRUE); spinner2->setLabel(std::string("Right")); spinner3->setVisible(TRUE); spinner3->setLabel(std::string("Bottom")); spinner4->setVisible(TRUE); spinner4->setLabel(std::string("Top")); if (!spinner1->hasFocus()) { spinner1->setPrecision(0); spinner1->setValue(r.mLeft); } if (!spinner2->hasFocus()) { spinner2->setPrecision(0); spinner2->setValue(r.mRight); } if (!spinner3->hasFocus()) { spinner3->setPrecision(0); spinner3->setValue(r.mBottom); } if (!spinner4->hasFocus()) { spinner4->setPrecision(0); spinner4->setValue(r.mTop); } spinner1->setMinValue((F32)S32_MIN); spinner1->setMaxValue((F32)S32_MAX); spinner1->setIncrement(1.f); spinner2->setMinValue((F32)S32_MIN); spinner2->setMaxValue((F32)S32_MAX); spinner2->setIncrement(1.f); spinner3->setMinValue((F32)S32_MIN); spinner3->setMaxValue((F32)S32_MAX); spinner3->setIncrement(1.f); spinner4->setMinValue((F32)S32_MIN); spinner4->setMaxValue((F32)S32_MAX); spinner4->setIncrement(1.f); break; } case TYPE_COL4: { LLColor4 clr; clr.setValue(sd); color_swatch->setVisible(TRUE); // only set if changed so color picker doesn't update if(clr != LLColor4(color_swatch->getValue())) { color_swatch->set(LLColor4(sd), TRUE, FALSE); } spinner4->setVisible(TRUE); spinner4->setLabel(std::string("Alpha")); if (!spinner4->hasFocus()) { spinner4->setPrecision(3); spinner4->setMinValue(0.0); spinner4->setMaxValue(1.f); spinner4->setValue(clr.mV[VALPHA]); } break; } case TYPE_COL3: { LLColor3 clr; clr.setValue(sd); color_swatch->setVisible(TRUE); color_swatch->setValue(sd); break; } default: mComment->setText(std::string("unknown")); break; } } }
bool handleShowXUINamesChanged(const LLSD& newvalue) { LLUI::sShowXUINames = newvalue.asBoolean(); return true; }
bool toggle_show_favorites_panel(const LLSD& newvalue) { LLNavigationBar::getInstance()->showFavoritesPanel(newvalue.asBoolean()); return true; }
void LLFilterSD2XMLRPC::streamOut(std::ostream& ostr, const LLSD& sd) { ostr << "<value>"; switch(sd.type()) { case LLSD::TypeMap: { #if LL_SPEW_STREAM_OUT_DEBUGGING llinfos << "streamOut(map) BEGIN" << llendl; #endif ostr << "<struct>"; if(ostr.fail()) { llinfos << "STREAM FAILURE writing struct" << llendl; } LLSD::map_const_iterator it = sd.beginMap(); LLSD::map_const_iterator end = sd.endMap(); for(; it != end; ++it) { ostr << "<member><name>" << xml_escape_string((*it).first) << "</name>"; streamOut(ostr, (*it).second); if(ostr.fail()) { llinfos << "STREAM FAILURE writing '" << (*it).first << "' with sd type " << (*it).second.type() << llendl; } ostr << "</member>"; } ostr << "</struct>"; #if LL_SPEW_STREAM_OUT_DEBUGGING llinfos << "streamOut(map) END" << llendl; #endif break; } case LLSD::TypeArray: { #if LL_SPEW_STREAM_OUT_DEBUGGING llinfos << "streamOut(array) BEGIN" << llendl; #endif ostr << "<array><data>"; LLSD::array_const_iterator it = sd.beginArray(); LLSD::array_const_iterator end = sd.endArray(); for(; it != end; ++it) { streamOut(ostr, *it); if(ostr.fail()) { llinfos << "STREAM FAILURE writing array element sd type " << (*it).type() << llendl; } } #if LL_SPEW_STREAM_OUT_DEBUGGING llinfos << "streamOut(array) END" << llendl; #endif ostr << "</data></array>"; break; } case LLSD::TypeUndefined: // treat undefined as a bool with a false value. case LLSD::TypeBoolean: #if LL_SPEW_STREAM_OUT_DEBUGGING llinfos << "streamOut(bool)" << llendl; #endif ostr << "<boolean>" << (sd.asBoolean() ? "1" : "0") << "</boolean>"; break; case LLSD::TypeInteger: #if LL_SPEW_STREAM_OUT_DEBUGGING llinfos << "streamOut(int)" << llendl; #endif ostr << "<i4>" << sd.asInteger() << "</i4>"; break; case LLSD::TypeReal: #if LL_SPEW_STREAM_OUT_DEBUGGING llinfos << "streamOut(real)" << llendl; #endif ostr << "<double>" << sd.asReal() << "</double>"; break; case LLSD::TypeString: #if LL_SPEW_STREAM_OUT_DEBUGGING llinfos << "streamOut(string)" << llendl; #endif ostr << "<string>" << xml_escape_string(sd.asString()) << "</string>"; break; case LLSD::TypeUUID: #if LL_SPEW_STREAM_OUT_DEBUGGING llinfos << "streamOut(uuid)" << llendl; #endif // serialize it as a string ostr << "<string>" << sd.asString() << "</string>"; break; case LLSD::TypeURI: { #if LL_SPEW_STREAM_OUT_DEBUGGING llinfos << "streamOut(uri)" << llendl; #endif // serialize it as a string ostr << "<string>" << xml_escape_string(sd.asString()) << "</string>"; break; } case LLSD::TypeBinary: { #if LL_SPEW_STREAM_OUT_DEBUGGING llinfos << "streamOut(binary)" << llendl; #endif // this is pretty inefficient, but we'll deal with that // problem when it becomes one. ostr << "<base64>"; LLSD::Binary buffer = sd.asBinary(); if(!buffer.empty()) { // *TODO: convert to LLBase64 int b64_buffer_length = apr_base64_encode_len(buffer.size()); char* b64_buffer = new char[b64_buffer_length]; b64_buffer_length = apr_base64_encode_binary( b64_buffer, &buffer[0], buffer.size()); ostr.write(b64_buffer, b64_buffer_length - 1); delete[] b64_buffer; } ostr << "</base64>"; break; } case LLSD::TypeDate: #if LL_SPEW_STREAM_OUT_DEBUGGING llinfos << "streamOut(date)" << llendl; #endif // no need to escape this since it will be alpha-numeric. ostr << "<dateTime.iso8601>" << sd.asString() << "</dateTime.iso8601>"; break; default: // unhandled type llwarns << "Unhandled structured data type: " << sd.type() << llendl; break; } ostr << "</value>"; }
bool toggle_show_object_render_cost(const LLSD& newvalue) { LLFloaterTools::sShowObjectCost = newvalue.asBoolean(); return true; }
void LLButton::setValue(const LLSD& value ) { mToggleState = value.asBoolean(); }
static bool handleUseOcclusionChanged(const LLSD& newvalue) { LLPipeline::sUseOcclusion = (newvalue.asBoolean() && gGLManager.mHasOcclusionQuery && LLFeatureManager::getInstance()->isFeatureAvailable("UseOcclusion") && !gUseWireframe) ? 2 : 0; return true; }
// Checked: 2010-02-27 (RLVa-1.2.0a) | Added: RLVa-1.1.0i bool RlvSettings::onChangedSettingBOOL(const LLSD& sdValue, bool* pfSetting) { if (pfSetting) *pfSetting = sdValue.asBoolean(); return true; }
static bool handleRenderDebugPipelineChanged(const LLSD& newvalue) { gDebugPipeline = newvalue.asBoolean(); return true; }
static bool handleSetSelfInvisible( const LLSD& newvalue) { LLVOAvatarSelf::onChangeSelfInvisible( newvalue.asBoolean() ); return true; }
static bool handleDebugViewsChanged(const LLSD& newvalue) { LLView::sDebugRects = newvalue.asBoolean(); return true; }
static bool handleUploadBakedTexOldChanged(const LLSD& newvalue) { LLPipeline::sForceOldBakedUpload = newvalue.asBoolean(); return true; }
// 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>("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); childSetVisible("val_text", FALSE); mComment->setText(LLStringUtil::null); if (controlp) { // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.1d if (rlv_handler_t::isEnabled()) { // Don't allow changing DBG_WRITE debug settings under @setdebug=n bool fEnable = !( (gRlvHandler.hasBehaviour(RLV_BHVR_SETDEBUG)) && (RlvExtGetSet::getDebugSettingFlags(controlp->getName()) & RlvExtGetSet::DBG_WRITE) ); // Don't allow toggling "Basic Shaders" and/or "Atmopsheric Shaders" through the debug settings under @setenv=n fEnable &= !((gRlvHandler.hasBehaviour(RLV_BHVR_SETENV)) && (("VertexShaderEnable" == controlp->getName()) || ("WindLightUseAtmosShaders" == controlp->getName()))); #ifdef RLV_EXTENSION_STARTLOCATION // Don't allow toggling RLVaLoginLastLocation fEnable &= !(RLV_SETTING_LOGINLASTLOCATION == controlp->getName()); #endif // RLV_EXTENSION_STARTLOCATION // NOTE: this runs per-frame so there's no need to explictly handle onCommitSettings() or onClickDefault() spinner1->setEnabled(fEnable); spinner2->setEnabled(fEnable); spinner3->setEnabled(fEnable); spinner4->setEnabled(fEnable); color_swatch->setEnabled(fEnable); childSetEnabled("val_text", fEnable); childSetEnabled("boolean_combo", fEnable); childSetEnabled("default_btn", fEnable); } // [/RLVa:KB] controlp = controlp->getCOAActive(); eControlType type = controlp->type(); //hide combo box only for non booleans, otherwise this will result in the combo box closing every frame childSetVisible("boolean_combo", 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 (!childHasFocus("boolean_combo")) { if (sd.asBoolean()) { childSetValue("boolean_combo", LLSD("true")); } else { childSetValue("boolean_combo", LLSD("")); } } break; case TYPE_STRING: childSetVisible("val_text", TRUE); if (!childHasFocus("val_text")) { childSetValue("val_text", 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()) { spinner2->setPrecision(3); spinner2->setValue(v[VY]); } if (!spinner3->hasFocus()) { spinner3->setPrecision(3); spinner3->setValue(v[VZ]); } break; } case TYPE_VEC3D: { LLVector3d 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()) { spinner2->setPrecision(3); spinner2->setValue(v[VY]); } if (!spinner3->hasFocus()) { spinner3->setPrecision(3); spinner3->setValue(v[VZ]); } break; } case TYPE_RECT: { LLRect r; r.setValue(sd); spinner1->setVisible(TRUE); spinner1->setLabel(std::string("Left")); spinner2->setVisible(TRUE); spinner2->setLabel(std::string("Right")); spinner3->setVisible(TRUE); spinner3->setLabel(std::string("Bottom")); spinner4->setVisible(TRUE); spinner4->setLabel(std::string("Top")); if (!spinner1->hasFocus()) { spinner1->setPrecision(0); spinner1->setValue(r.mLeft); } if (!spinner2->hasFocus()) { spinner2->setPrecision(0); spinner2->setValue(r.mRight); } if (!spinner3->hasFocus()) { spinner3->setPrecision(0); spinner3->setValue(r.mBottom); } if (!spinner4->hasFocus()) { spinner4->setPrecision(0); spinner4->setValue(r.mTop); } spinner1->setMinValue((F32)S32_MIN); spinner1->setMaxValue((F32)S32_MAX); spinner1->setIncrement(1.f); spinner2->setMinValue((F32)S32_MIN); spinner2->setMaxValue((F32)S32_MAX); spinner2->setIncrement(1.f); spinner3->setMinValue((F32)S32_MIN); spinner3->setMaxValue((F32)S32_MAX); spinner3->setIncrement(1.f); spinner4->setMinValue((F32)S32_MIN); spinner4->setMaxValue((F32)S32_MAX); spinner4->setIncrement(1.f); break; } case TYPE_COL4: { LLColor4 clr; clr.setValue(sd); color_swatch->setVisible(TRUE); // only set if changed so color picker doesn't update if(clr != LLColor4(color_swatch->getValue())) { color_swatch->set(LLColor4(sd), TRUE, FALSE); } spinner4->setVisible(TRUE); spinner4->setLabel(std::string("Alpha")); if (!spinner4->hasFocus()) { spinner4->setPrecision(3); spinner4->setMinValue(0.0); spinner4->setMaxValue(1.f); spinner4->setValue(clr.mV[VALPHA]); } break; } case TYPE_COL3: { LLColor3 clr; clr.setValue(sd); color_swatch->setVisible(TRUE); color_swatch->setValue(sd); break; } case TYPE_COL4U: { LLColor4U clr; clr.setValue(sd); color_swatch->setVisible(TRUE); if(LLColor4(clr) != LLColor4(color_swatch->getValue())) { color_swatch->set(LLColor4(clr), TRUE, FALSE); } spinner4->setVisible(TRUE); spinner4->setLabel(std::string("Alpha")); if(!spinner4->hasFocus()) { spinner4->setPrecision(0); spinner4->setValue(clr.mV[VALPHA]); } spinner4->setMinValue(0); spinner4->setMaxValue(255); spinner4->setIncrement(1.f); break; } default: mComment->setText(std::string("unknown")); break; } } }
static bool handleRenderUseImpostorsChanged(const LLSD& newvalue) { LLVOAvatar::sUseImpostors = newvalue.asBoolean(); return true; }
void ensure_equals(const std::string& msg, const LLSD& actual, const LLSD& expected) { ensure_equals(msg + " type", actual.type(), expected.type()); switch (actual.type()) { case LLSD::TypeUndefined: return; case LLSD::TypeBoolean: ensure_equals(msg + " boolean", actual.asBoolean(), expected.asBoolean()); return; case LLSD::TypeInteger: ensure_equals(msg + " integer", actual.asInteger(), expected.asInteger()); return; case LLSD::TypeReal: ensure_equals(msg + " real", actual.asReal(), expected.asReal()); return; case LLSD::TypeString: ensure_equals(msg + " string", actual.asString(), expected.asString()); return; case LLSD::TypeUUID: ensure_equals(msg + " uuid", actual.asUUID(), expected.asUUID()); return; case LLSD::TypeDate: ensure_equals(msg + " date", actual.asDate(), expected.asDate()); return; case LLSD::TypeURI: ensure_equals(msg + " uri", actual.asURI(), expected.asURI()); return; case LLSD::TypeBinary: ensure_equals(msg + " binary", actual.asBinary(), expected.asBinary()); return; case LLSD::TypeMap: { ensure_equals(msg + " map size", actual.size(), expected.size()); LLSD::map_const_iterator actual_iter = actual.beginMap(); LLSD::map_const_iterator expected_iter = expected.beginMap(); while(actual_iter != actual.endMap()) { ensure_equals(msg + " map keys", actual_iter->first, expected_iter->first); ensure_equals(msg + "[" + actual_iter->first + "]", actual_iter->second, expected_iter->second); ++actual_iter; ++expected_iter; } return; } case LLSD::TypeArray: { ensure_equals(msg + " array size", actual.size(), expected.size()); for(int i = 0; i < actual.size(); ++i) { ensure_equals(msg + llformat("[%d]", i), actual[i], expected[i]); } return; } default: // should never get here, but compiler produces warning if we // don't cover this case, and at Linden warnings are fatal. throw failure(STRINGIZE("invalid type field " << actual.type())); } }
static bool handleRenderDebugGLChanged(const LLSD& newvalue) { gDebugGL = newvalue.asBoolean() || gDebugSession; gGL.clearErrors(); return true; }
void LLPanelPermissions::onCommitExport(const LLSD& param) { LLSelectMgr::getInstance()->selectionSetObjectPermissions(PERM_EVERYONE, param.asBoolean(), PERM_EXPORT); }