Hooray lua! Functions in functions = yay. :D
This commit is contained in:
@@ -28,26 +28,21 @@ local function CreateStops(Player)
|
|||||||
local stops = timingData:GetStops();
|
local stops = timingData:GetStops();
|
||||||
local delays = timingData:GetDelays();
|
local delays = timingData:GetDelays();
|
||||||
|
|
||||||
for i=1,#delays do
|
local function CreateLine(beat, secs, firstShadow, firstDiffuse, secondShadow, firstEffect, secondEffect)
|
||||||
local data = split("=",delays[i]);
|
|
||||||
local beat = data[1];
|
|
||||||
local secs = data[2];
|
|
||||||
local beatTime = timingData:GetElapsedTimeFromBeat(beat);
|
local beatTime = timingData:GetElapsedTimeFromBeat(beat);
|
||||||
if beatTime < 0 then beatTime = 0; end;
|
if beatTime < 0 then beatTime = 0; end;
|
||||||
|
return Def.ActorFrame {
|
||||||
delayFrame[#delayFrame+1] = Def.ActorFrame {
|
|
||||||
Def.Quad {
|
Def.Quad {
|
||||||
InitCommand=function(self)
|
InitCommand=function(self)
|
||||||
--self:diffuse(HSVA(192,1,0.8,0.8));
|
|
||||||
self:shadowlength(0);
|
self:shadowlength(0);
|
||||||
self:shadowcolor( color("#FFFF0077") );
|
self:shadowcolor(color(firstShadow));
|
||||||
-- set width
|
-- set width
|
||||||
self:zoomto(math.max((secs/songLen)*fFrameWidth, 1), fFrameHeight);
|
self:zoomto(math.max((secs/songLen)*fFrameWidth, 1), fFrameHeight);
|
||||||
-- find location
|
-- find location
|
||||||
self:x((scale(beatTime,firstBeatSecs,lastBeatSecs,-fFrameWidth/2,fFrameWidth/2)));
|
self:x((scale(beatTime,firstBeatSecs,lastBeatSecs,-fFrameWidth/2,fFrameWidth/2)));
|
||||||
end;
|
end;
|
||||||
OnCommand=function(self)
|
OnCommand=function(self)
|
||||||
self:diffuse(Color("Yellow"));
|
self:diffuse(Color(firstDiffuse));
|
||||||
self:sleep(beatTime+1);
|
self:sleep(beatTime+1);
|
||||||
self:linear(2);
|
self:linear(2);
|
||||||
self:diffusealpha(0);
|
self:diffusealpha(0);
|
||||||
@@ -57,7 +52,7 @@ local function CreateStops(Player)
|
|||||||
InitCommand=function(self)
|
InitCommand=function(self)
|
||||||
--self:diffuse(HSVA(192,1,0.8,0.8));
|
--self:diffuse(HSVA(192,1,0.8,0.8));
|
||||||
self:shadowlength(0);
|
self:shadowlength(0);
|
||||||
self:shadowcolor( color("#FFFF0077") );
|
self:shadowcolor(color(secondShadow));
|
||||||
-- set width
|
-- set width
|
||||||
self:zoomto(math.max((secs/songLen)*fFrameWidth, 1),fFrameHeight);
|
self:zoomto(math.max((secs/songLen)*fFrameWidth, 1),fFrameHeight);
|
||||||
-- find location
|
-- find location
|
||||||
@@ -66,8 +61,8 @@ local function CreateStops(Player)
|
|||||||
OnCommand=function(self)
|
OnCommand=function(self)
|
||||||
self:diffusealpha(1);
|
self:diffusealpha(1);
|
||||||
self:diffuseshift();
|
self:diffuseshift();
|
||||||
self:effectcolor1(Color("Green"));
|
self:effectcolor1(Color(firstEffect));
|
||||||
self:effectcolor2(Color("Red"));
|
self:effectcolor2(Color(secondEffect));
|
||||||
self:effectclock('beat');
|
self:effectclock('beat');
|
||||||
self:effectperiod(1/8);
|
self:effectperiod(1/8);
|
||||||
--
|
--
|
||||||
@@ -81,57 +76,14 @@ local function CreateStops(Player)
|
|||||||
};
|
};
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
for i=1,#delays do
|
||||||
|
local data = split("=",delays[i]);
|
||||||
|
delayFrame[#delayFrame+1] = CreateLine(data[1], data[2], "#FFFF0077", "Yellow", "#FFFF0077", "Green", "Red");
|
||||||
|
end;
|
||||||
|
|
||||||
for i=1,#stops do
|
for i=1,#stops do
|
||||||
local data = split("=",stops[i]);
|
local data = split("=",stops[i]);
|
||||||
local beat = data[1];
|
stopFrame[#stopFrame+1] = CreateLine(data[1], data[2], "#FFFFFF77", "White", "#FFFFFF77", "Orange", "Red");
|
||||||
local secs = data[2];
|
|
||||||
local beatTime = timingData:GetElapsedTimeFromBeat(beat);
|
|
||||||
if beatTime < 0 then beatTime = 0; end;
|
|
||||||
|
|
||||||
stopFrame[#stopFrame+1] = Def.ActorFrame {
|
|
||||||
Def.Quad {
|
|
||||||
InitCommand=function(self)
|
|
||||||
--self:diffuse(HSVA(192,1,0.8,0.8));
|
|
||||||
self:shadowlength(0);
|
|
||||||
self:shadowcolor( color("#FFFFFF77") );
|
|
||||||
-- set width
|
|
||||||
self:zoomto( math.max((secs/songLen)*fFrameWidth, 1), fFrameHeight );
|
|
||||||
-- find location
|
|
||||||
self:x( ( scale(beatTime, firstBeatSecs,lastBeatSecs, -fFrameWidth/2,fFrameWidth/2) ) );
|
|
||||||
end;
|
|
||||||
OnCommand=function(self)
|
|
||||||
self:diffuse(Color("White"));
|
|
||||||
self:sleep(beatTime+1);
|
|
||||||
self:linear(2);
|
|
||||||
self:diffusealpha(0);
|
|
||||||
end;
|
|
||||||
};
|
|
||||||
Def.Quad {
|
|
||||||
InitCommand=function(self)
|
|
||||||
--self:diffuse(HSVA(192,1,0.8,0.8));
|
|
||||||
self:shadowlength(0);
|
|
||||||
self:shadowcolor( color("#FFFFFF77") );
|
|
||||||
-- set width
|
|
||||||
self:zoomto( math.max((secs/songLen)*fFrameWidth, 1), fFrameHeight );
|
|
||||||
-- find location
|
|
||||||
self:x( ( scale(beatTime, firstBeatSecs,lastBeatSecs, -fFrameWidth/2,fFrameWidth/2) ) );
|
|
||||||
end;
|
|
||||||
OnCommand=function(self)
|
|
||||||
self:diffusealpha(1);
|
|
||||||
self:diffuseshift();
|
|
||||||
self:effectcolor1(Color("Orange"));
|
|
||||||
self:effectcolor2(Color("Red"));
|
|
||||||
self:effectclock('beat');
|
|
||||||
self:effectperiod(1/8);
|
|
||||||
--
|
|
||||||
self:diffusealpha(0);
|
|
||||||
self:sleep(beatTime+1);
|
|
||||||
self:diffusealpha(1);
|
|
||||||
self:linear(4);
|
|
||||||
self:diffusealpha(0);
|
|
||||||
end;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
bars[#bars+1] = stopFrame;
|
bars[#bars+1] = stopFrame;
|
||||||
|
|||||||
Reference in New Issue
Block a user