PDA

View Full Version : Global Int attribs_mychange


The Cool Dude
11th May 2005, 10:37
why does is the line Global Int attribs_mychange; in attribs.m? what does it do?

krckoorascic
12th May 2005, 10:21
whell when you wanna set some attrib value you'll do like this:

att.onDataChanged()
{
if (attribs_mychange) return;
attribs_mychange = 1;
someAttribute.setData("0");
attribs_mychange = 0;
}

someAttribute.onDataChanged()
{
if (attribs_mychange) return;
attribs_mychange = 1;
att.setData("0");
attribs_mychange = 0;
}

as you see, in att.onDataChanged(), is set value for someAttribute, but before that attribs_mychange flag is set to 1, attribs_mychange is used becouse in someAttribute.onDataChanged() there is line:

att.setData("0");

which will returns us to att.onDataChaged() and it will loop for ever (well, not forever, soon winamp is crashed :D)
and thats way attribs_mychange flag is used, as you see first line in both events is:

if (attribs_mychange) return;

so, lines after this one are executed ONLY if attribs_mychange is set to 0 (false) thats mean when user clicks on menu or button with that cfgattrib is toggled...

The Cool Dude
13th May 2005, 07:23
but then all attribs wont work after that.

krckoorascic
13th May 2005, 11:20
what you mean?

The Cool Dude
14th May 2005, 09:02
attribs_mychange will be 1 so none of the attribs will work after that unless the skin is refreshed.

The Cool Dude
14th May 2005, 09:09
attribs_mychange will be 1 so none of the attribs will work after that unless the skin is refreshed.

krckoorascic
14th May 2005, 22:48
noup,
you see attribs_mychange = 0; ? that resets flag to false.
you MUST reset flag when you finished changing data or non of attribs wont work

The Cool Dude
16th May 2005, 04:44
oh yeah correct i didnt see that. thanks!