Rob H
February 5th, 2005, 01:05 PM
Ben (or anyone else),
Is there a way of supporting a looped frame within another looped frame so that you can still access both loop indexes from e.g. a bit of lua code?
The reason I want this is to be able to support a star rating for each DVD in LDJ, but I'm sure there would be other applications.
JLee's CCF has this code for a star button which is located in a looped frame :-
STATE:LUA:
val = NetRemote.GetVariable('MP.Rating');
if (val == '') then
return 0;
end;
return tonumber(val)>=<LoopIndex>;
Which is fine for a single cover, but I would want this to work on a DVD cover which is already in a loop.
I don't think this is currently possible in NR, but I think it would be useful. Something like a function outer() which would return the LoopIndex from the outer scope might be a way to do this - alternatively some form of subcripting on LoopIndex. I prefer the use of outer() since it would work even if the containing loop were placed inside yet another loop.
I have a feeling that the interim solution is going to be to have a bit of lua that sets the image to one of a selection of images each of which has an extra star in it.
Is there a way of supporting a looped frame within another looped frame so that you can still access both loop indexes from e.g. a bit of lua code?
The reason I want this is to be able to support a star rating for each DVD in LDJ, but I'm sure there would be other applications.
JLee's CCF has this code for a star button which is located in a looped frame :-
STATE:LUA:
val = NetRemote.GetVariable('MP.Rating');
if (val == '') then
return 0;
end;
return tonumber(val)>=<LoopIndex>;
Which is fine for a single cover, but I would want this to work on a DVD cover which is already in a loop.
I don't think this is currently possible in NR, but I think it would be useful. Something like a function outer() which would return the LoopIndex from the outer scope might be a way to do this - alternatively some form of subcripting on LoopIndex. I prefer the use of outer() since it would work even if the containing loop were placed inside yet another loop.
I have a feeling that the interim solution is going to be to have a bit of lua that sets the image to one of a selection of images each of which has an extra star in it.