More work on accordions, let params do lluiimages like upstream

This commit is contained in:
Inusaito Sayori
2015-09-30 20:05:40 -04:00
parent ed701f9c88
commit bc0709b9c6
4 changed files with 168 additions and 11 deletions

View File

@@ -152,3 +152,48 @@ void LLUIImage::onImageLoaded()
}
}
namespace LLInitParam
{
void ParamValue<LLUIImage*>::updateValueFromBlock()
{
// The keyword "none" is specifically requesting a null image
// do not default to current value. Used to overwrite template images.
if (name() == "none")
{
updateValue(NULL);
return;
}
LLUIImage* imagep = LLRender2D::getUIImage(name());
if (imagep)
{
updateValue(imagep);
}
}
void ParamValue<LLUIImage*>::updateBlockFromValue(bool make_block_authoritative)
{
if (getValue() == NULL)
{
name.set("none", make_block_authoritative);
}
else
{
name.set(getValue()->getName(), make_block_authoritative);
}
}
bool ParamCompare<LLUIImage*, false>::equals(
LLUIImage* const &a,
LLUIImage* const &b)
{
// force all LLUIImages for XML UI export to be "non-default"
if (!a && !b)
return false;
else
return (a == b);
}
}