void LLDriverParam::updateCrossDrivenParams(LLWearableType::EType driven_type)
{
	bool needs_update = (getWearableType()==driven_type);

	// if the driver has a driven entry for the passed-in wearable type, we need to refresh the value
	for( entry_list_t::iterator iter = mDriven.begin(); iter != mDriven.end(); iter++ )
	{
		LLDrivenEntry* driven = &(*iter);
		if (driven && driven->mParam && driven->mParam->getCrossWearable() && driven->mParam->getWearableType() == driven_type)
		{
			needs_update = true;
		}
	}


	if (needs_update)
	{
		LLWearableType::EType driver_type = (LLWearableType::EType)getWearableType();
		
		// If we've gotten here, we've added a new wearable of type "type"
		// Thus this wearable needs to get updates from the driver wearable.
		// The call to setVisualParamWeight seems redundant, but is necessary
		// as the number of driven wearables has changed since the last update. -Nyx
		LLWearable *wearable = mAvatarAppearance->getWearableData()->getTopWearable(driver_type);
		if (wearable)
		{
			wearable->setVisualParamWeight(mID, wearable->getVisualParamWeight(mID));
		}
	}
}
Пример #2
0
BOOL LLTexLayerParamAlpha::getSkip() const
{
	if (!mTexLayer)
	{
		return TRUE;
	}

	const LLVOAvatar *avatar = mTexLayer->getTexLayerSet()->getAvatar();

	if (((LLTexLayerParamAlphaInfo *)getInfo())->mSkipIfZeroWeight)
	{
		F32 effective_weight = (avatar->getSex() & getSex()) ? mCurWeight : getDefaultWeight();
		if (is_approx_zero(effective_weight)) 
		{
			return TRUE;
		}
	}

	LLWearableType::EType type = (LLWearableType::EType)getWearableType();
	if ((type != LLWearableType::WT_INVALID) && !avatar->isWearingWearableType(type))
	{
		return TRUE;
	}

	return FALSE;
}
Пример #3
0
	void updateCreateWearableLabel(LLMenuGL* menu, const LLUUID& item_id)
	{
		LLMenuItemGL* menu_item = menu->getChild<LLMenuItemGL>("create_new");
		LLWearableType::EType w_type = getWearableType(item_id);

		// Hide the "Create new <WEARABLE_TYPE>" if it's irrelevant.
		if (w_type == LLWearableType::WT_NONE)
		{
			menu_item->setVisible(FALSE);
			return;
		}

		// Set proper label for the "Create new <WEARABLE_TYPE>" menu item.
		std::string new_label = LLTrans::getString("create_new_" + LLWearableType::getTypeName(w_type));
		menu_item->setLabel(new_label);
	}
Пример #4
0
	void createNew(const LLUUID& item_id)
	{
		LLAgentWearables::createWearable(getWearableType(item_id), true);
	}