本文整理汇总了C++中LLColorSwatchCtrl::set方法的典型用法代码示例。如果您正苦于以下问题:C++ LLColorSwatchCtrl::set方法的具体用法?C++ LLColorSwatchCtrl::set怎么用?C++ LLColorSwatchCtrl::set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLColorSwatchCtrl
的用法示例。
在下文中一共展示了LLColorSwatchCtrl::set方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: postBuild
BOOL mfdKeywordFloater::postBuild(void)
{
setCanMinimize(false);
childSetAction("Meta7Keywords_save",onClickSave,this);
childSetAction("Meta7Keywords_cancel",onClickCancel,this);
childSetValue("Meta7Keywords_Alert",gSavedPerAccountSettings.getBOOL("Meta7KeywordOn"));
childSetValue("Meta7Keywords_Entries",gSavedPerAccountSettings.getString("Meta7Keywords"));
childSetValue("Meta7Keywords_IM",gSavedPerAccountSettings.getBOOL("Meta7KeywordInIM"));
childSetValue("Meta7Keywords_GroupChat",gSavedPerAccountSettings.getBOOL("Meta7KeywordInGroup"));
childSetValue("Meta7Keywords_LocalChat",gSavedPerAccountSettings.getBOOL("Meta7KeywordInChat"));
childSetValue("Meta7Keywords_IRC",gSavedPerAccountSettings.getBOOL("Meta7KeywordInIRC"));
childSetValue("Meta7Keywords_Highlight",gSavedPerAccountSettings.getBOOL("Meta7KeywordChangeColor"));
//childSetValue("Meta7Keywords_Color",gSavedPerAccountSettings.getLLSD("Meta7KeywordColor"));
childSetValue("Meta7Keywords_PlaySound",gSavedPerAccountSettings.getBOOL("Meta7KeywordPlaySound"));
childSetValue("Meta7Keywords_SoundUUID",gSavedPerAccountSettings.getString("Meta7KeywordSound"));
LLColorSwatchCtrl* colorctrl = getChild<LLColorSwatchCtrl>("Meta7Keywords_Color");
colorctrl->set(LLColor4(gSavedPerAccountSettings.getColor4("Meta7KeywordColor")),TRUE);
return true;
}
示例2: syncMenu
void LLFloaterEnvSettings::syncMenu()
{
LLSliderCtrl* sldr;
sldr = getChild<LLSliderCtrl>("EnvTimeSlider");
// sync the clock
F32 val = (F32)LLWLParamManager::instance()->mAnimator.getDayTime();
std::string timeStr = timeToString(val);
LLTextBox* textBox;
textBox = getChild<LLTextBox>("EnvTimeText");
textBox->setValue(timeStr);
// sync time slider which starts at 6 AM
val -= 0.25;
if(val < 0)
{
val++;
}
sldr->setValue(val);
// sync cloud coverage
bool err;
childSetValue("EnvCloudSlider", LLWLParamManager::instance()->mCurParams.getFloat("cloud_shadow", err));
LLWaterParamManager * param_mgr = LLWaterParamManager::instance();
// sync water params
LLColor4 col = param_mgr->getFogColor();
LLColorSwatchCtrl* colCtrl = getChild<LLColorSwatchCtrl>("EnvWaterColor");
col.mV[3] = 1.0f;
colCtrl->set(col);
childSetValue("EnvWaterFogSlider", param_mgr->mFogDensity.mExp);
param_mgr->setDensitySliderValue(param_mgr->mFogDensity.mExp);
// turn off Use Estate Time button if it's already being used
if(LLWLParamManager::instance()->mAnimator.mUseLindenTime)
{
childDisable("EnvUseEstateTimeButton");
} else {
childEnable("EnvUseEstateTimeButton");
}
if(!gPipeline.canUseVertexShaders())
{
childDisable("EnvWaterColor");
childDisable("EnvWaterColorText");
//childDisable("EnvAdvancedWaterButton");
}
else
{
childEnable("EnvWaterColor");
childEnable("EnvWaterColorText");
//childEnable("EnvAdvancedWaterButton");
}
// only allow access to these if they are using windlight
if(!gPipeline.canUseWindLightShaders())
{
childDisable("EnvCloudSlider");
childDisable("EnvCloudText");
//childDisable("EnvAdvancedSkyButton");
}
else
{
childEnable("EnvCloudSlider");
childEnable("EnvCloudText");
//childEnable("EnvAdvancedSkyButton");
}
}
示例3: getState
void LLPanelFace::getState()
{
LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getFirstObject();
if( objectp
&& objectp->getPCode() == LL_PCODE_VOLUME
&& objectp->permModify())
{
BOOL editable = objectp->permModify() && !objectp->isPermanentEnforced();
// only turn on auto-adjust button if there is a media renderer and the media is loaded
getChildView("textbox autofix")->setEnabled(editable);
getChildView("button align")->setEnabled(editable);
//if ( LLMediaEngine::getInstance()->getMediaRenderer () )
// if ( LLMediaEngine::getInstance()->getMediaRenderer ()->isLoaded () )
// {
//
// //mLabelTexAutoFix->setEnabled ( editable );
//
// //mBtnAutoFix->setEnabled ( editable );
// }
S32 selected_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount();
BOOL single_volume = (LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME ))
&& (selected_count == 1);
getChildView("copytextures")->setEnabled(single_volume && editable);
getChildView("pastetextures")->setEnabled(editable);
getChildView("textbox params")->setEnabled(single_volume && editable);
getChildView("button apply")->setEnabled(editable);
bool identical;
LLTextureCtrl* texture_ctrl = getChild<LLTextureCtrl>("texture control");
// Texture
{
LLUUID id;
struct f1 : public LLSelectedTEGetFunctor<LLUUID>
{
LLUUID get(LLViewerObject* object, S32 te_index)
{
LLUUID id;
LLViewerTexture* image = object->getTEImage(te_index);
if (image) id = image->getID();
if (!id.isNull() && LLViewerMedia::textureHasMedia(id))
{
LLTextureEntry *te = object->getTE(te_index);
if (te)
{
LLViewerTexture* tex = te->getID().notNull() ? gTextureList.findImage(te->getID()) : NULL ;
if(!tex)
{
tex = LLViewerFetchedTexture::sDefaultImagep;
}
if (tex)
{
id = tex->getID();
}
}
}
return id;
}
} func;
identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, id );
if(LLViewerMedia::textureHasMedia(id))
{
getChildView("textbox autofix")->setEnabled(editable);
getChildView("button align")->setEnabled(editable);
}
if (identical)
{
// All selected have the same texture
if(texture_ctrl)
{
texture_ctrl->setTentative( FALSE );
texture_ctrl->setEnabled( editable );
texture_ctrl->setImageAssetID( id );
}
}
else
{
if(texture_ctrl)
{
if( id.isNull() )
{
// None selected
texture_ctrl->setTentative( FALSE );
texture_ctrl->setEnabled( FALSE );
texture_ctrl->setImageAssetID( LLUUID::null );
}
else
{
// Tentative: multiple selected with different textures
texture_ctrl->setTentative( TRUE );
texture_ctrl->setEnabled( editable );
texture_ctrl->setImageAssetID( id );
}
//.........这里部分代码省略.........
示例4: getState
void LLPanelFace::getState()
{
LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getFirstObject();
LLCalc* calcp = LLCalc::getInstance();
if( objectp
&& objectp->getPCode() == LL_PCODE_VOLUME
&& objectp->permModify())
{
BOOL editable = objectp->permModify();
// only turn on auto-adjust button if there is a media renderer and the media is loaded
childSetEnabled("textbox autofix",FALSE);
//mLabelTexAutoFix->setEnabled ( FALSE );
childSetEnabled("button align",FALSE);
//mBtnAutoFix->setEnabled ( FALSE );
//if ( LLMediaEngine::getInstance()->getMediaRenderer () )
// if ( LLMediaEngine::getInstance()->getMediaRenderer ()->isLoaded () )
// {
//
// //mLabelTexAutoFix->setEnabled ( editable );
//
// //mBtnAutoFix->setEnabled ( editable );
// }
childSetEnabled("button apply",editable);
bool identical;
LLTextureCtrl* texture_ctrl = getChild<LLTextureCtrl>("texture control");
// Texture
{
LLUUID id;
struct f1 : public LLSelectedTEGetFunctor<LLUUID>
{
LLUUID get(LLViewerObject* object, S32 te)
{
LLViewerImage* image = object->getTEImage(te);
return image ? image->getID() : LLUUID::null;
}
} func;
identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, id );
if (identical)
{
// All selected have the same texture
if(texture_ctrl)
{
texture_ctrl->setTentative( FALSE );
texture_ctrl->setEnabled( editable );
texture_ctrl->setImageAssetID( id );
}
}
else
{
if(texture_ctrl)
{
if( id.isNull() )
{
// None selected
texture_ctrl->setTentative( FALSE );
texture_ctrl->setEnabled( FALSE );
texture_ctrl->setImageAssetID( LLUUID::null );
}
else
{
// Tentative: multiple selected with different textures
texture_ctrl->setTentative( TRUE );
texture_ctrl->setEnabled( editable );
texture_ctrl->setImageAssetID( id );
}
}
}
if(LLViewerMedia::textureHasMedia(id))
{
childSetEnabled("textbox autofix",editable);
childSetEnabled("button align",editable);
}
}
LLAggregatePermissions texture_perms;
if(texture_ctrl)
{
// texture_ctrl->setValid( editable );
if (LLSelectMgr::getInstance()->selectGetAggregateTexturePermissions(texture_perms))
{
BOOL can_copy =
texture_perms.getValue(PERM_COPY) == LLAggregatePermissions::AP_EMPTY ||
texture_perms.getValue(PERM_COPY) == LLAggregatePermissions::AP_ALL;
BOOL can_transfer =
texture_perms.getValue(PERM_TRANSFER) == LLAggregatePermissions::AP_EMPTY ||
texture_perms.getValue(PERM_TRANSFER) == LLAggregatePermissions::AP_ALL;
texture_ctrl->setCanApplyImmediately(can_copy && can_transfer);
}
else
{
//.........这里部分代码省略.........
示例5: refresh
// Update controls based on current settings
void LLPrefsAscentChat::refresh()
{
//Chat --------------------------------------------------------------------------------
// time format combobox
LLComboBox* combo = getChild<LLComboBox>("time_format_combobox");
if (combo)
{
combo->setCurrentByIndex(mTimeFormat);
}
// date format combobox
combo = getChild<LLComboBox>("date_format_combobox");
if (combo)
{
combo->setCurrentByIndex(mDateFormat);
}
childSetValue("AscentInstantMessageResponseAnyone", mIMResponseAnyone);
childSetValue("AscentInstantMessageResponseFriends", mIMResponseFriends);
childSetValue("AscentInstantMessageResponseMuted", mIMResponseMuted);
childSetValue("AscentInstantMessageShowOnTyping", mIMShowOnTyping);
childSetValue("AscentInstantMessageShowResponded", mIMShowResponded);
childSetValue("AscentInstantMessageResponseRepeat", mIMResponseRepeat);
childSetValue("AscentInstantMessageResponseItem", mIMResponseItem);
LLWString auto_response = utf8str_to_wstring( gSavedPerAccountSettings.getString("AscentInstantMessageResponse") );
LLWStringUtil::replaceChar(auto_response, '^', '\n');
LLWStringUtil::replaceChar(auto_response, '%', ' ');
childSetText("im_response", wstring_to_utf8str(auto_response));
//Text Options ------------------------------------------------------------------------
combo = getChild<LLComboBox>("SpellBase");
if (combo != NULL)
{
combo->removeall();
std::vector<std::string> names = glggHunSpell->getDicts();
for (int i = 0; i < (int)names.size(); i++)
{
combo->add(names[i]);
}
combo->setSimple(gSavedSettings.getString("SpellBase"));
}
combo = getChild<LLComboBox>("EmSpell_Avail");
if (combo != NULL)
{
combo->removeall();
combo->add("");
std::vector<std::string> names = glggHunSpell->getAvailDicts();
for (int i = 0; i < (int)names.size(); i++)
{
combo->add(names[i]);
}
combo->setSimple(std::string(""));
}
combo = getChild<LLComboBox>("EmSpell_Installed");
if (combo != NULL)
{
combo->removeall();
combo->add("");
std::vector<std::string> names = glggHunSpell->getInstalledDicts();
for (int i = 0; i < (int)names.size(); i++)
{
combo->add(names[i]);
}
combo->setSimple(std::string(""));
}
childSetEnabled("KeywordsList", mKeywordsOn);
childSetEnabled("KeywordsInChat", mKeywordsOn);
childSetEnabled("KeywordsInIM", mKeywordsOn);
childSetEnabled("KeywordsChangeColor", mKeywordsOn);
childSetEnabled("KeywordsColor", mKeywordsOn);
childSetEnabled("KeywordsPlaySound", mKeywordsOn);
childSetEnabled("KeywordsSound", mKeywordsOn);
childSetValue("KeywordsOn", mKeywordsOn);
childSetValue("KeywordsList", mKeywordsList);
childSetValue("KeywordsInChat", mKeywordsInChat);
childSetValue("KeywordsInIM", mKeywordsInIM);
childSetValue("KeywordsChangeColor", mKeywordsChangeColor);
LLColorSwatchCtrl* colorctrl = getChild<LLColorSwatchCtrl>("KeywordsColor");
colorctrl->set(LLColor4(mKeywordsColor),TRUE);
childSetValue("KeywordsPlaySound", mKeywordsPlaySound);
childSetValue("KeywordsSound", mKeywordsSound);
//.........这里部分代码省略.........
示例6: getState
void LLPanelVolume::getState( )
{
LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getFirstRootObject();
LLViewerObject* root_objectp = objectp;
if(!objectp)
{
objectp = LLSelectMgr::getInstance()->getSelection()->getFirstObject();
// *FIX: shouldn't we just keep the child?
if (objectp)
{
LLViewerObject* parentp = objectp->getRootEdit();
if (parentp)
{
root_objectp = parentp;
}
else
{
root_objectp = objectp;
}
}
}
LLVOVolume *volobjp = NULL;
if ( objectp && (objectp->getPCode() == LL_PCODE_VOLUME))
{
volobjp = (LLVOVolume *)objectp;
}
if( !objectp )
{
//forfeit focus
if (gFocusMgr.childHasKeyboardFocus(this))
{
gFocusMgr.setKeyboardFocus(NULL);
}
// Disable all text input fields
clearCtrls();
return;
}
LLUUID owner_id;
std::string owner_name;
LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name);
// BUG? Check for all objects being editable?
BOOL editable = root_objectp->permModify() && !root_objectp->isPermanentEnforced();
BOOL single_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME )
&& LLSelectMgr::getInstance()->getSelection()->getObjectCount() == 1;
// Select Single Message
if (single_volume)
{
getChildView("edit_object")->setVisible(true);
getChildView("edit_object")->setEnabled(true);
getChildView("select_single")->setVisible(false);
}
else
{
getChildView("edit_object")->setVisible(false);
getChildView("select_single")->setVisible(true);
getChildView("select_single")->setEnabled(true);
}
// Light properties
BOOL is_light = volobjp && volobjp->getIsLight();
getChild<LLUICtrl>("Light Checkbox Ctrl")->setValue(is_light);
getChildView("Light Checkbox Ctrl")->setEnabled(editable && single_volume && volobjp);
if (is_light && editable && single_volume)
{
getChildView("label color")->setEnabled(true);
//mLabelColor ->setEnabled( TRUE );
LLColorSwatchCtrl* LightColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch");
if(LightColorSwatch)
{
LightColorSwatch->setEnabled( TRUE );
LightColorSwatch->setValid( TRUE );
LightColorSwatch->set(volobjp->getLightBaseColor());
}
childSetEnabled("label texture",true);
LLTextureCtrl* LightTextureCtrl = getChild<LLTextureCtrl>("light texture control");
if (LightTextureCtrl)
{
LightTextureCtrl->setEnabled(TRUE);
LightTextureCtrl->setValid(TRUE);
LightTextureCtrl->setImageAssetID(volobjp->getLightTextureID());
}
getChildView("Light Intensity")->setEnabled(true);
getChildView("Light Radius")->setEnabled(true);
getChildView("Light Falloff")->setEnabled(true);
getChildView("Light FOV")->setEnabled(true);
getChildView("Light Focus")->setEnabled(true);
getChildView("Light Ambiance")->setEnabled(true);
//.........这里部分代码省略.........
示例7: getState
void LLPanelFace::getState()
{
LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getFirstObject();
if( objectp
&& objectp->getPCode() == LL_PCODE_VOLUME
&& objectp->permModify())
{
BOOL editable = objectp->permModify();
// only turn on auto-adjust button if there is a media renderer and the media is loaded
childSetEnabled("textbox autofix",FALSE);
//mLabelTexAutoFix->setEnabled ( FALSE );
childSetEnabled("button align",FALSE);
//mBtnAutoFix->setEnabled ( FALSE );
if(LLViewerMedia::hasMedia())
{
childSetEnabled("textbox autofix",editable);
childSetEnabled("button align",editable);
}
//if ( LLMediaEngine::getInstance()->getMediaRenderer () )
// if ( LLMediaEngine::getInstance()->getMediaRenderer ()->isLoaded () )
// {
//
// //mLabelTexAutoFix->setEnabled ( editable );
//
// //mBtnAutoFix->setEnabled ( editable );
// }
childSetEnabled("button apply",editable);
bool identical;
LLTextureCtrl* texture_ctrl = getChild<LLTextureCtrl>("texture control");
// Texture
{
LLUUID id;
struct f1 : public LLSelectedTEGetFunctor<LLUUID>
{
LLUUID get(LLViewerObject* object, S32 te)
{
LLViewerImage* image = object->getTEImage(te);
return image ? image->getID() : LLUUID::null;
}
} func;
identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, id );
if (identical)
{
// All selected have the same texture
if(texture_ctrl)
{
texture_ctrl->setTentative( FALSE );
texture_ctrl->setEnabled( editable );
texture_ctrl->setImageAssetID( id );
}
}
else
{
if(texture_ctrl)
{
if( id.isNull() )
{
// None selected
texture_ctrl->setTentative( FALSE );
texture_ctrl->setEnabled( FALSE );
texture_ctrl->setImageAssetID( LLUUID::null );
}
else
{
// Tentative: multiple selected with different textures
texture_ctrl->setTentative( TRUE );
texture_ctrl->setEnabled( editable );
texture_ctrl->setImageAssetID( id );
}
}
}
}
LLAggregatePermissions texture_perms;
if(texture_ctrl)
{
// texture_ctrl->setValid( editable );
if (LLSelectMgr::getInstance()->selectGetAggregateTexturePermissions(texture_perms))
{
BOOL can_copy =
texture_perms.getValue(PERM_COPY) == LLAggregatePermissions::AP_EMPTY ||
texture_perms.getValue(PERM_COPY) == LLAggregatePermissions::AP_ALL;
BOOL can_transfer =
texture_perms.getValue(PERM_TRANSFER) == LLAggregatePermissions::AP_EMPTY ||
texture_perms.getValue(PERM_TRANSFER) == LLAggregatePermissions::AP_ALL;
texture_ctrl->setCanApplyImmediately(can_copy && can_transfer);
}
else
{
texture_ctrl->setCanApplyImmediately(FALSE);
}
}
//.........这里部分代码省略.........
示例8: getState
void LLPanelVolume::getState( )
{
LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getFirstRootObject();
LLViewerObject* root_objectp = objectp;
if(!objectp)
{
objectp = LLSelectMgr::getInstance()->getSelection()->getFirstObject();
// *FIX: shouldn't we just keep the child?
if (objectp)
{
LLViewerObject* parentp = objectp->getRootEdit();
if (parentp)
{
root_objectp = parentp;
}
else
{
root_objectp = objectp;
}
}
}
LLVOVolume *volobjp = NULL;
if ( objectp && (objectp->getPCode() == LL_PCODE_VOLUME))
{
volobjp = (LLVOVolume *)objectp;
}
if( !objectp )
{
//forfeit focus
if (gFocusMgr.childHasKeyboardFocus(this))
{
gFocusMgr.setKeyboardFocus(NULL);
}
// Disable all text input fields
clearCtrls();
return;
}
BOOL owners_identical;
LLUUID owner_id;
std::string owner_name;
owners_identical = LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name);
// BUG? Check for all objects being editable?
BOOL editable = root_objectp->permModify();
BOOL single_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME )
&& LLSelectMgr::getInstance()->getSelection()->getObjectCount() == 1;
// Select Single Message
if (single_volume)
{
getChildView("edit_object")->setVisible(true);
getChildView("edit_object")->setEnabled(true);
getChildView("select_single")->setVisible(false);
}
else
{
getChildView("edit_object")->setVisible(false);
getChildView("select_single")->setVisible(true);
getChildView("select_single")->setEnabled(true);
}
// Light properties
BOOL is_light = volobjp && volobjp->getIsLight();
getChild<LLUICtrl>("Light Checkbox Ctrl")->setValue(is_light);
getChildView("Light Checkbox Ctrl")->setEnabled(editable && single_volume && volobjp);
if (is_light && editable && single_volume)
{
getChildView("label color")->setEnabled(true);
//mLabelColor ->setEnabled( TRUE );
LLColorSwatchCtrl* LightColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch");
if(LightColorSwatch)
{
LightColorSwatch->setEnabled( TRUE );
LightColorSwatch->setValid( TRUE );
LightColorSwatch->set(volobjp->getLightBaseColor());
}
LLTextureCtrl* LightTextureCtrl = getChild<LLTextureCtrl>("light texture control");
if (LightTextureCtrl)
{
LightTextureCtrl->setEnabled(TRUE);
LightTextureCtrl->setValid(TRUE);
LightTextureCtrl->setImageAssetID(volobjp->getLightTextureID());
}
getChildView("Light Intensity")->setEnabled(true);
getChildView("Light Radius")->setEnabled(true);
getChildView("Light Falloff")->setEnabled(true);
getChildView("Light FOV")->setEnabled(true);
getChildView("Light Focus")->setEnabled(true);
getChildView("Light Ambiance")->setEnabled(true);
//.........这里部分代码省略.........
示例9: syncMenu
void LLFloaterWater::syncMenu()
{
bool err;
LLWaterParamManager * param_mgr = LLWaterParamManager::instance();
LLWaterParamSet & current_params = param_mgr->mCurParams;
LLComboBox* comboBox = getChild<LLComboBox>("WaterPresetsCombo");
if (comboBox->getSelectedItemLabel() != current_params.mName)
{
comboBox->setSimple(current_params.mName);
}
// blue horizon
param_mgr->mFogColor = current_params.getVector4(param_mgr->mFogColor.mName, err);
LLColor4 col = param_mgr->getFogColor();
childSetValue("WaterGlow", col.mV[3]);
col.mV[3] = 1.0f;
LLColorSwatchCtrl* colCtrl = sWaterMenu->getChild<LLColorSwatchCtrl>("WaterFogColor");
colCtrl->set(col);
// fog and wavelets
param_mgr->mFogDensity.mExp =
log(current_params.getFloat(param_mgr->mFogDensity.mName, err)) /
log(param_mgr->mFogDensity.mBase);
param_mgr->setDensitySliderValue(param_mgr->mFogDensity.mExp);
childSetValue("WaterFogDensity", param_mgr->mFogDensity.mExp);
param_mgr->mUnderWaterFogMod.mX =
current_params.getFloat(param_mgr->mUnderWaterFogMod.mName, err);
childSetValue("WaterUnderWaterFogMod", param_mgr->mUnderWaterFogMod.mX);
param_mgr->mNormalScale = current_params.getVector3(param_mgr->mNormalScale.mName, err);
childSetValue("WaterNormalScaleX", param_mgr->mNormalScale.mX);
childSetValue("WaterNormalScaleY", param_mgr->mNormalScale.mY);
childSetValue("WaterNormalScaleZ", param_mgr->mNormalScale.mZ);
// Fresnel
param_mgr->mFresnelScale.mX = current_params.getFloat(param_mgr->mFresnelScale.mName, err);
childSetValue("WaterFresnelScale", param_mgr->mFresnelScale.mX);
param_mgr->mFresnelOffset.mX = current_params.getFloat(param_mgr->mFresnelOffset.mName, err);
childSetValue("WaterFresnelOffset", param_mgr->mFresnelOffset.mX);
// Scale Above/Below
param_mgr->mScaleAbove.mX = current_params.getFloat(param_mgr->mScaleAbove.mName, err);
childSetValue("WaterScaleAbove", param_mgr->mScaleAbove.mX);
param_mgr->mScaleBelow.mX = current_params.getFloat(param_mgr->mScaleBelow.mName, err);
childSetValue("WaterScaleBelow", param_mgr->mScaleBelow.mX);
// blur mult
param_mgr->mBlurMultiplier.mX = current_params.getFloat(param_mgr->mBlurMultiplier.mName, err);
childSetValue("WaterBlurMult", param_mgr->mBlurMultiplier.mX);
// wave directions
param_mgr->mWave1Dir = current_params.getVector2(param_mgr->mWave1Dir.mName, err);
childSetValue("WaterWave1DirX", param_mgr->mWave1Dir.mX);
childSetValue("WaterWave1DirY", param_mgr->mWave1Dir.mY);
param_mgr->mWave2Dir = current_params.getVector2(param_mgr->mWave2Dir.mName, err);
childSetValue("WaterWave2DirX", param_mgr->mWave2Dir.mX);
childSetValue("WaterWave2DirY", param_mgr->mWave2Dir.mY);
LLTextureCtrl* textCtrl = sWaterMenu->getChild<LLTextureCtrl>("WaterNormalMap");
textCtrl->setImageAssetID(param_mgr->getNormalMapID());
}
示例10: getState
void LLPanelVolume::getState( )
{
LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getFirstRootObject();
LLViewerObject* root_objectp = objectp;
if(!objectp)
{
objectp = LLSelectMgr::getInstance()->getSelection()->getFirstObject();
// *FIX: shouldn't we just keep the child?
if (objectp)
{
LLViewerObject* parentp = objectp->getRootEdit();
if (parentp)
{
root_objectp = parentp;
}
else
{
root_objectp = objectp;
}
}
}
LLVOVolume *volobjp = NULL;
if ( objectp && (objectp->getPCode() == LL_PCODE_VOLUME))
{
volobjp = (LLVOVolume *)objectp;
}
if( !objectp )
{
//forfeit focus
if (gFocusMgr.childHasKeyboardFocus(this))
{
gFocusMgr.setKeyboardFocus(NULL);
}
// Disable all text input fields
clearCtrls();
return;
}
BOOL owners_identical;
LLUUID owner_id;
std::string owner_name;
owners_identical = LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name);
// BUG? Check for all objects being editable?
BOOL editable = root_objectp->permModify();
BOOL single_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME )
&& LLSelectMgr::getInstance()->getSelection()->getObjectCount() == 1;
// Select Single Message
if (single_volume)
{
childSetVisible("edit_object",true);
childSetEnabled("edit_object",true);
childSetVisible("select_single",false);
}
else
{
childSetVisible("edit_object",false);
childSetVisible("select_single",true);
childSetEnabled("select_single",true);
}
// Light properties
BOOL is_light = volobjp && volobjp->getIsLight();
childSetValue("Light Checkbox Ctrl",is_light);
childSetEnabled("Light Checkbox Ctrl",editable && single_volume && volobjp);
if (is_light && editable && single_volume)
{
childSetEnabled("label color",true);
//mLabelColor ->setEnabled( TRUE );
LLColorSwatchCtrl* LightColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch");
if(LightColorSwatch)
{
LightColorSwatch->setEnabled( TRUE );
LightColorSwatch->setValid( TRUE );
LightColorSwatch->set(volobjp->getLightBaseColor());
}
childSetEnabled("label texture",true);
LLTextureCtrl* LightTextureCtrl = getChild<LLTextureCtrl>("light texture control");
if (LightTextureCtrl)
{
LightTextureCtrl->setEnabled(TRUE);
LightTextureCtrl->setValid(TRUE);
LightTextureCtrl->setImageAssetID(volobjp->getLightTextureID());
}
childSetEnabled("Light Intensity",true);
childSetEnabled("Light Radius",true);
childSetEnabled("Light Falloff",true);
childSetEnabled("Light FOV",true);
childSetEnabled("Light Focus",true);
childSetEnabled("Light Ambiance",true);
//.........这里部分代码省略.........
示例11: draw
void lggBeamColorMapFloater::draw()
{
//set the color of the preview thing
LLColorSwatchCtrl* colorctrl = getChild<LLColorSwatchCtrl>("BeamColor_Preview");
LLColor4 bColor = LLColor4(lggBeamMaps::beamColorFromData(myData));
colorctrl->set(bColor,TRUE);
//Try draw rectangle attach beam
LLRect swatch_rect;
LLButton* createButton = empanel->getChild<LLButton>("BeamColor_new");
createButton->localRectToOtherView(createButton->getLocalRect(), &swatch_rect, this);
LLRect local_rect = getLocalRect();
if (gFocusMgr.childHasKeyboardFocus(this) && empanel->isInVisibleChain() && mContextConeOpacity > 0.001f)
{
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
LLGLEnable(GL_CULL_FACE);
gGL.begin(LLRender::QUADS);
{
F32 r = bColor.mV[0];
F32 g = bColor.mV[1];
F32 b = bColor.mV[2];
gGL.color4f(r, g, b, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity);
gGL.vertex2i(swatch_rect.mLeft, swatch_rect.mTop);
gGL.vertex2i(swatch_rect.mRight, swatch_rect.mTop);
gGL.color4f(r, g, b, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity);
gGL.vertex2i(local_rect.mRight, local_rect.mTop);
gGL.vertex2i(local_rect.mLeft, local_rect.mTop);
gGL.color4f(r, g, b, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity);
gGL.vertex2i(local_rect.mLeft, local_rect.mTop);
gGL.vertex2i(local_rect.mLeft, local_rect.mBottom);
gGL.color4f(r, g, b, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity);
gGL.vertex2i(swatch_rect.mLeft, swatch_rect.mBottom);
gGL.vertex2i(swatch_rect.mLeft, swatch_rect.mTop);
gGL.color4f(r, g, b, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity);
gGL.vertex2i(local_rect.mRight, local_rect.mBottom);
gGL.vertex2i(local_rect.mRight, local_rect.mTop);
gGL.color4f(r, g, b, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity);
gGL.vertex2i(swatch_rect.mRight, swatch_rect.mTop);
gGL.vertex2i(swatch_rect.mRight, swatch_rect.mBottom);
gGL.color4f(r, g, b, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity);
gGL.vertex2i(local_rect.mLeft, local_rect.mBottom);
gGL.vertex2i(local_rect.mRight, local_rect.mBottom);
gGL.color4f(r, g, b, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity);
gGL.vertex2i(swatch_rect.mRight, swatch_rect.mBottom);
gGL.vertex2i(swatch_rect.mLeft, swatch_rect.mBottom);
}
gGL.end();
}
static LLCachedControl<F32> opacity(gSavedSettings, "PickerContextOpacity");
mContextConeOpacity = lerp(mContextConeOpacity, opacity, LLCriticalDamp::getInterpolant(CONTEXT_FADE_TIME));
//Draw Base Stuff
LLFloater::draw();
//Draw hues and pointers at color
gGL.pushMatrix();
F32 r, g, b;
LLColor4 output;
for (int i = 0;i <= 720;i++)
{
int hi =i%360;
hslToRgb1((hi/360.0f), 1.0f, 0.5f, r, g, b);
output.set(r, g, b);
gl_line_2d(
convertHueToX(i),201,
convertHueToX(i),277,output);
}
S32 X1 = convertHueToX(myData.startHue);
S32 X2 = convertHueToX(myData.endHue);
LLFontGL* font = LLFontGL::getFontSansSerifSmall();
gGL.color4fv(LLColor4::white.mV);
gl_circle_2d(X1,238,9.0f,(S32)30,false);
gGL.color4fv(LLColor4::black.mV);
gl_circle_2d(X1,238,8.0f,(S32)30,false);
gGL.color4fv(LLColor4::white.mV);
gl_circle_2d(X1,238,7.0f,(S32)30,false);
gl_line_2d(X1+1,210,X1+1,266,LLColor4::white);
gl_line_2d(X1-1,210,X1-1,266,LLColor4::white);
gl_line_2d(X1,210,X1,266,LLColor4::black);
gl_line_2d(X1-25,238+1,X1+25,238+1,LLColor4::white);
gl_line_2d(X1-25,238-1,X1+25,238-1,LLColor4::white);
gl_line_2d(X1-25,238,X1+25,238,LLColor4::black);
font->renderUTF8(
"Start Hue", 0,
//.........这里部分代码省略.........
示例12: refresh
// Update controls based on current settings
void LLPrefsAscentChat::refresh()
{
//Chat --------------------------------------------------------------------------------
// time format combobox
LLComboBox* combo = getChild<LLComboBox>("time_format_combobox");
if (combo)
{
combo->setCurrentByIndex(mTimeFormat);
}
// date format combobox
combo = getChild<LLComboBox>("date_format_combobox");
if (combo)
{
combo->setCurrentByIndex(mDateFormat);
}
//Antispam ------------------------------------------------------------------------
// sensitivity tuners
childSetEnabled("spammsg_checkbox", mEnableAS);
childSetEnabled("antispamtime", mEnableAS);
childSetEnabled("antispamamount", mEnableAS);
childSetEnabled("antispamsoundmulti", mEnableAS);
childSetEnabled("antispamsoundpreloadmulti", mEnableAS);
childSetEnabled("antispamnewlines", mEnableAS);
childSetEnabled("Notify On Spam", mEnableAS);
// dialog blocking tuners
childSetEnabled("Block All Dialogs From", !mBlockDialogSpam);
childSetEnabled("Alerts", !mBlockDialogSpam);
childSetEnabled("Friendship Offers", !mBlockDialogSpam);
childSetEnabled("Group Invites", !mBlockDialogSpam);
childSetEnabled("Group Fee Invites", !mBlockDialogSpam && !mBlockGroupInviteSpam);
childSetEnabled("Group Notices", !mBlockDialogSpam);
childSetEnabled("Item Offers", !mBlockDialogSpam);
childSetEnabled("Scripts", !mBlockDialogSpam);
childSetEnabled("Teleport Offers", !mBlockDialogSpam);
//Text Options ------------------------------------------------------------------------
combo = getChild<LLComboBox>("SpellBase");
if (combo != NULL)
{
combo->removeall();
std::vector<std::string> names = glggHunSpell->getDicts();
for (int i = 0; i < (int)names.size(); i++)
{
combo->add(names[i]);
}
combo->setSimple(gSavedSettings.getString("SpellBase"));
}
combo = getChild<LLComboBox>("EmSpell_Avail");
if (combo != NULL)
{
combo->removeall();
combo->add("");
std::vector<std::string> names = glggHunSpell->getAvailDicts();
for (int i = 0; i < (int)names.size(); i++)
{
combo->add(names[i]);
}
combo->setSimple(std::string(""));
}
combo = getChild<LLComboBox>("EmSpell_Installed");
if (combo != NULL)
{
combo->removeall();
combo->add("");
std::vector<std::string> names = glggHunSpell->getInstalledDicts();
for (int i = 0; i < (int)names.size(); i++)
{
combo->add(names[i]);
}
combo->setSimple(std::string(""));
}
childSetEnabled("KeywordsList", mKeywordsOn);
childSetEnabled("KeywordsInChat", mKeywordsOn);
childSetEnabled("KeywordsInIM", mKeywordsOn);
childSetEnabled("KeywordsChangeColor", mKeywordsOn);
childSetEnabled("KeywordsColor", mKeywordsOn);
childSetEnabled("KeywordsPlaySound", mKeywordsOn);
childSetEnabled("KeywordsSound", mKeywordsOn);
childSetValue("KeywordsOn", mKeywordsOn);
childSetValue("KeywordsList", mKeywordsList);
childSetValue("KeywordsInChat", mKeywordsInChat);
childSetValue("KeywordsInIM", mKeywordsInIM);
//.........这里部分代码省略.........