Bug between ProgressTimer and NodeRGBA.

in NodeRGBA, we can setCascadeOpacityEnabled* to make all its children effect by this opacity value as well assetCascadeColorEnabled(true).
Problem is: ProgressTimer extends from NodeRGBA, but the Sprite in ProgressTimer
is not its child**,
so the CascadeOpacity and CascadeColor**don’t work at all* for the Sprite in ProgressTimer.

void CCScale9Sprite::updateDisplayedOpacity(GLubyte parentOpacity)
{
    CCNodeRGBA::updateDisplayedOpacity(parentOpacity);
    setOpacity(parentOpacity);
}

void CCScale9Sprite::updateDisplayedColor(const cocos2d::ccColor3B &color)
{
    CCNodeRGBA::updateDisplayedColor(color);
    setColor(color);
}

Scale9Sprite get the same problem.
the code above is such a bad idea.

Maybe I get a solution:
add a “linkChildren” array for CCNodeRGBA.
linkChild means they are not the children of the node, but their color and opacity depends on the node.
and the node become “linkParent” of the linkChildren

eg:
Scale9Sprite:
make all the CCRGBAProtocol children of *scale9Image be the linkChildren of the scale9sprite
ProgressTimer:
make mSprite be the linkChildren of the ProgressTimer
rewrite CCNodeRGBA:setColor and updateDisplayColor like:
<pre>
void CCNodeRGBA::setColor
{
*displayedColor = realColor = color;
// code add begin
if { // it is not controled by
cascadeColorEnabled
ccColor3B parentColor = ccWHITE;
CCRGBAProtocol parent = dynamic_cast<CCRGBAProtocol>;
if
{
parentColor = parent~~>getDisplayedColor;
}
updateDisplayedColor;
return; // do return!
}
// code add end
if
{
ccColor3B parentColor = ccWHITE;
CCRGBAProtocol *parent = dynamic_cast<CCRGBAProtocol
>;
if )
{
parentColor = parent~~>getDisplayedColor;
}
updateDisplayedColor;
}
}
void CCNodeRGBA::updateDisplayedColor
{
displayedColor.r =realColor.r parentColor.r/255.0;
*displayedColor.g =*realColor.g * parentColor.g/255.0;
*displayedColor.b =*realColor.b * parentColor.b/255.0;

// code add begin
{// it is not controled by _cascadeColorEnabled
CCObject obj = NULL;
CCARRAY_FOREACH
{
CCRGBAProtocol
item = dynamic_cast<CCRGBAProtocol*>(obj);
if (item)
{
item~~>updateDisplayedColor;
}
}
}
// code add end
if
{
CCObject obj = NULL;
CCARRAY_FOREACH
{
CCRGBAProtocol
item = dynamic_cast<CCRGBAProtocol*>;
if
{
item~~>updateDisplayedColor(_displayedColor);
}
}
}
}

do the same work to Opacity, and some functions in ccprogresstimer and CCScale9Sprite can be removed! do tell me if there is better solution\~\~