remove children nodes
This commit is contained in:
@@ -1,15 +1,12 @@
|
||||
local t =
|
||||
Def.ActorFrame {
|
||||
children = {
|
||||
LoadActor("white.png") .. {
|
||||
OnCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;stretchto,SCREEN_LEFT,SCREEN_TOP,SCREEN_RIGHT,SCREEN_BOTTOM)
|
||||
},
|
||||
LoadActor("stepmania (dither).png") .. {
|
||||
File="stepmania (dither).png",
|
||||
InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;diffusealpha,0),
|
||||
OnCommand=cmd(linear,1;diffusealpha,1),
|
||||
}
|
||||
}
|
||||
local t = Def.ActorFrame {
|
||||
LoadActor("white.png") .. {
|
||||
OnCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;stretchto,SCREEN_LEFT,SCREEN_TOP,SCREEN_RIGHT,SCREEN_BOTTOM)
|
||||
};
|
||||
LoadActor("stepmania (dither).png") .. {
|
||||
File="stepmania (dither).png",
|
||||
InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;diffusealpha,0),
|
||||
OnCommand=cmd(linear,1;diffusealpha,1),
|
||||
};
|
||||
}
|
||||
|
||||
return t
|
||||
|
||||
@@ -118,7 +118,14 @@ local fontPath = THEME:GetPathF( "ScreenCredits", "titles" )
|
||||
local lineOn = cmd(zoom,0.5)
|
||||
local sectionOn = cmd(zoom,0.5;diffuse,1,.5,.5,1)
|
||||
local otherOn = cmd(zoom,0.5;diffuse,.5,.5,1,1)
|
||||
local children = {}
|
||||
local t = Def.ActorScroller {
|
||||
SecondsPerItem = 0.40;
|
||||
NumItemsToDraw = 40;
|
||||
TransformFunction = function( self, offset, itemIndex, numItems)
|
||||
self:y(30*offset)
|
||||
end;
|
||||
OnCommand = cmd(zoom,0.64;scrollwithpadding,12,0);
|
||||
}
|
||||
|
||||
local function AddLine( text, command )
|
||||
local t = Def.BitmapText {
|
||||
@@ -128,7 +135,7 @@ local function AddLine( text, command )
|
||||
OnCommand = command or lineOn;
|
||||
}
|
||||
-- XXX: Hack. Wrap in an ActorFrame so OnCommand works
|
||||
table.insert( children, WrapInActorFrame({t}) )
|
||||
table.insert( t, WrapInActorFrame({t}) )
|
||||
end
|
||||
|
||||
-- Add header and padding
|
||||
@@ -155,13 +162,4 @@ for i=1,13 do AddLine() end
|
||||
AddLine( "Join the StepMania team", otherOn )
|
||||
AddLine( "and help us out!" )
|
||||
|
||||
-- Wrap everything up in an ActorScroller
|
||||
return Def.ActorScroller {
|
||||
SecondsPerItem = 0.40;
|
||||
NumItemsToDraw = 40;
|
||||
TransformFunction = function( self, offset, itemIndex, numItems)
|
||||
self:y(30*offset)
|
||||
end;
|
||||
OnCommand = cmd(zoom,0.64;scrollwithpadding,12,0);
|
||||
children = children;
|
||||
}
|
||||
return t;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
local children = {
|
||||
local t = Def.ActorFrame {
|
||||
LoadActor( "song background scroller" ) .. {
|
||||
InitCommand = cmd(x,SCREEN_CENTER_X-160;y,SCREEN_CENTER_Y);
|
||||
};
|
||||
@@ -7,4 +7,4 @@ local children = {
|
||||
};
|
||||
}
|
||||
|
||||
return WrapInActorFrame( children )
|
||||
return t;
|
||||
|
||||
+10
-13
@@ -1,23 +1,20 @@
|
||||
local template = Def.ActorFrame {
|
||||
children = {
|
||||
Def.Sprite {
|
||||
OnCommand = cmd(LoadBackground,GetRandomSongBackground();scaletoclipped,312,232);
|
||||
};
|
||||
LoadActor( THEME:GetPathG("ScreenCredits", "background frame") );
|
||||
Def.Sprite {
|
||||
OnCommand = cmd(LoadBackground,GetRandomSongBackground();scaletoclipped,312,232);
|
||||
};
|
||||
LoadActor( THEME:GetPathG("ScreenCredits", "background frame") );
|
||||
}
|
||||
local children = {}
|
||||
|
||||
for i=1,10 do
|
||||
table.insert( children, template )
|
||||
end
|
||||
|
||||
return Def.ActorScroller {
|
||||
local t = Def.ActorScroller {
|
||||
SecondsPerItem = 4.25;
|
||||
NumItemsToDraw = 4;
|
||||
TransformFunction = function( self, offset, itemIndex, numItems )
|
||||
self:y(-240*offset)
|
||||
end;
|
||||
OnCommand = cmd(scrollwithpadding,2,3);
|
||||
children = children;
|
||||
}
|
||||
|
||||
for i=1,10 do
|
||||
table.insert( t, template );
|
||||
end
|
||||
|
||||
return t;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
local children =
|
||||
{
|
||||
local t = Def.ActorFrame {
|
||||
LoadActor("../_black.png") .. {
|
||||
OnCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;zoomtowidth,SCREEN_WIDTH;zoomtoheight,120;diffusealpha,0.7);
|
||||
};
|
||||
@@ -8,4 +7,4 @@ local children =
|
||||
};
|
||||
};
|
||||
|
||||
return Def.ActorFrame{ children=children };
|
||||
return t;
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
local children =
|
||||
{
|
||||
local t = Def.ActorFrame {
|
||||
LoadActor("gameover.png") .. {
|
||||
InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;diffusealpha,0);
|
||||
OnCommand=cmd(linear,0.3;diffusealpha,0.9;sleep,5);
|
||||
};
|
||||
};
|
||||
|
||||
return Def.ActorFrame{ children=children };
|
||||
return t;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
local children = {
|
||||
local t = Def.ActorFrame {
|
||||
Def.Quad {
|
||||
InitCommand=cmd(diffuse,color("#000000");stretchto,SCREEN_LEFT,SCREEN_TOP,SCREEN_RIGHT,SCREEN_BOTTOM);
|
||||
StartCommand=cmd(diffusealpha,0;sleep,1;linear,0.5;diffusealpha,1);
|
||||
@@ -11,4 +11,4 @@ local children = {
|
||||
FinishCommand=cmd(sleep,1;linear,0.5;diffusealpha,0);
|
||||
};
|
||||
};
|
||||
return Def.ActorFrame { children = children };
|
||||
return t;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
local children = {
|
||||
local t = Def.ActorFrame {
|
||||
LoadSongBackground() .. {
|
||||
OnCommand=cmd(diffusealpha,0;sleep,0.5;linear,0.5;diffusealpha,1);
|
||||
};
|
||||
@@ -6,53 +6,48 @@ local children = {
|
||||
-- Cleared
|
||||
Def.ActorFrame {
|
||||
Condition=GAMESTATE:GetPlayMode() ~= PLAY_MODE_BATTLE and GAMESTATE:GetPlayMode() ~= PLAY_MODE_RAVE and not GAMESTATE:IsDemonstration();
|
||||
children = {
|
||||
LoadActor("extra1") .. {
|
||||
Condition=GAMESTATE:IsExtraStage();
|
||||
StartTransitioningCommand=cmd(hide_if,not GAMESTATE:HasEarnedExtraStage());
|
||||
};
|
||||
LoadActor("extra2") .. {
|
||||
Condition=GAMESTATE:IsExtraStage2();
|
||||
StartTransitioningCommand=cmd(hide_if,not GAMESTATE:HasEarnedExtraStage());
|
||||
};
|
||||
LoadActor("cleared") .. {
|
||||
InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y);
|
||||
StartTransitioningCommand=cmd(hide_if,GAMESTATE:HasEarnedExtraStage());
|
||||
OnCommand=cmd(diffusealpha,0;sleep,1;linear,0.5;diffusealpha,1;sleep,2);
|
||||
};
|
||||
LoadActor("extra1") .. {
|
||||
Condition=GAMESTATE:IsExtraStage();
|
||||
StartTransitioningCommand=cmd(hide_if,not GAMESTATE:HasEarnedExtraStage());
|
||||
};
|
||||
LoadActor("extra2") .. {
|
||||
Condition=GAMESTATE:IsExtraStage2();
|
||||
StartTransitioningCommand=cmd(hide_if,not GAMESTATE:HasEarnedExtraStage());
|
||||
};
|
||||
LoadActor("cleared") .. {
|
||||
InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y);
|
||||
StartTransitioningCommand=cmd(hide_if,GAMESTATE:HasEarnedExtraStage());
|
||||
OnCommand=cmd(diffusealpha,0;sleep,1;linear,0.5;diffusealpha,1;sleep,2);
|
||||
};
|
||||
};
|
||||
-- Winner
|
||||
Def.ActorFrame {
|
||||
Condition=GAMESTATE:GetPlayMode() == PLAY_MODE_BATTLE or GAMESTATE:GetPlayMode() == PLAY_MODE_RAVE;
|
||||
children = {
|
||||
LoadActor("p1 win") .. {
|
||||
InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y);
|
||||
StartTransitioningCommand=cmd(hide_if,not GAMESTATE:IsWinner(PLAYER_1));
|
||||
OnCommand=cmd(diffusealpha,0;sleep,1.5;linear,0.5;diffusealpha,1;sleep,2);
|
||||
};
|
||||
LoadActor("p2 win") .. {
|
||||
InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y);
|
||||
StartTransitioningCommand=cmd(hide_if,not GAMESTATE:IsWinner(PLAYER_2));
|
||||
OnCommand=cmd(diffusealpha,0;sleep,1.5;linear,0.5;diffusealpha,1;sleep,2);
|
||||
};
|
||||
LoadActor("draw") .. {
|
||||
InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y);
|
||||
StartTransitioningCommand=cmd(hide_if,not GAMESTATE:IsDraw());
|
||||
OnCommand=cmd(diffusealpha,0;sleep,1.5;linear,0.5;diffusealpha,1;sleep,2);
|
||||
};
|
||||
LoadActor("p1 win") .. {
|
||||
InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y);
|
||||
StartTransitioningCommand=cmd(hide_if,not GAMESTATE:IsWinner(PLAYER_1));
|
||||
OnCommand=cmd(diffusealpha,0;sleep,1.5;linear,0.5;diffusealpha,1;sleep,2);
|
||||
};
|
||||
LoadActor("p2 win") .. {
|
||||
InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y);
|
||||
StartTransitioningCommand=cmd(hide_if,not GAMESTATE:IsWinner(PLAYER_2));
|
||||
OnCommand=cmd(diffusealpha,0;sleep,1.5;linear,0.5;diffusealpha,1;sleep,2);
|
||||
};
|
||||
LoadActor("draw") .. {
|
||||
InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y);
|
||||
StartTransitioningCommand=cmd(hide_if,not GAMESTATE:IsDraw());
|
||||
OnCommand=cmd(diffusealpha,0;sleep,1.5;linear,0.5;diffusealpha,1;sleep,2);
|
||||
};
|
||||
};
|
||||
|
||||
-- Demonstration
|
||||
Def.ActorFrame {
|
||||
Condition=GAMESTATE:IsDemonstration();
|
||||
children = {
|
||||
Def.Quad {
|
||||
InitCommand=cmd(stretchto,SCREEN_LEFT,SCREEN_TOP,SCREEN_RIGHT,SCREEN_BOTTOM;diffuse,color("0,0,0,1"));
|
||||
OnCommand=cmd(sleep,1.5;diffusealpha,0);
|
||||
};
|
||||
Def.Quad {
|
||||
InitCommand=cmd(stretchto,SCREEN_LEFT,SCREEN_TOP,SCREEN_RIGHT,SCREEN_BOTTOM;diffuse,color("0,0,0,1"));
|
||||
OnCommand=cmd(sleep,1.5;diffusealpha,0);
|
||||
};
|
||||
};
|
||||
};
|
||||
return Def.ActorFrame { children = children };
|
||||
|
||||
return t;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
local children = {
|
||||
local t = Def.ActorFrame {
|
||||
LoadActor(THEME:GetPathS("", "_extra1")) .. {
|
||||
StartTransitioningCommand=function(self)
|
||||
if GAMESTATE:HasEarnedExtraStage() then self:play() end
|
||||
@@ -23,4 +23,4 @@ local children = {
|
||||
};
|
||||
};
|
||||
|
||||
return Def.ActorFrame { children = children };
|
||||
return t;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
local children = {
|
||||
local t = Def.ActorFrame {
|
||||
LoadActor(THEME:GetPathS("", "_extra2")) .. {
|
||||
StartTransitioningCommand=function(self)
|
||||
if GAMESTATE:HasEarnedExtraStage() then self:play() end
|
||||
@@ -23,4 +23,4 @@ local children = {
|
||||
};
|
||||
};
|
||||
|
||||
return Def.ActorFrame { children = children };
|
||||
return t;
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
local children = { };
|
||||
local Def.ActorFrame {
|
||||
};
|
||||
|
||||
if GAMESTATE:IsExtraStage() then
|
||||
children[#children+1] = LoadActor("_extra score frame") .. {
|
||||
t[#t+1] = LoadActor("_extra score frame") .. {
|
||||
InitCommand=cmd(x,SCREEN_CENTER_X+0;y,SCREEN_CENTER_Y-208);
|
||||
OnCommand=cmd(addy,-100;sleep,0.5;linear,1;addy,100);
|
||||
OffCommand=cmd(linear,1;addy,-100);
|
||||
};
|
||||
else
|
||||
local sFile = GAMESTATE:GetPlayMode() == "PlayMode_Oni" and "_oni score frame" or "_score frame";
|
||||
children[#children+1] = LoadActor(sFile) .. {
|
||||
t[#t+1] = LoadActor(sFile) .. {
|
||||
InitCommand=cmd(x,SCREEN_CENTER_X+0;y,SCREEN_CENTER_Y+208);
|
||||
OnCommand=cmd(addy,100;linear,0.5;addy,-100);
|
||||
OffCommand=cmd(linear,0.5;addy,100);
|
||||
};
|
||||
end
|
||||
|
||||
return Def.ActorFrame { children = children };
|
||||
return t;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
local children = {
|
||||
local t = Def.ActorFrame {
|
||||
LoadActor("_warning") .. {
|
||||
InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;
|
||||
vertalign,top;
|
||||
@@ -10,4 +10,4 @@ local children = {
|
||||
};
|
||||
};
|
||||
|
||||
return Def.ActorFrame { children = children };
|
||||
return t;
|
||||
|
||||
@@ -88,8 +88,7 @@ local function Radar()
|
||||
return t;
|
||||
end
|
||||
|
||||
local children =
|
||||
{
|
||||
local t = Def.ActorFrame {
|
||||
LoadActor( "_banner mask" ) .. {
|
||||
InitCommand=cmd(y,SCREEN_CENTER_Y-84;blend,"BlendMode_NoEffect";zwrite,1);
|
||||
OnCommand=cmd(x,SCREEN_CENTER_X-180-SCREEN_WIDTH*0.6;bounceend,0.5;addx,SCREEN_WIDTH*0.6);
|
||||
@@ -391,4 +390,4 @@ local children =
|
||||
CurrentCourseChangedMessageCommand=cmd(playcommand,"Set");
|
||||
};
|
||||
};
|
||||
return Def.ActorFrame { children=children };
|
||||
return t;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
local children = {};
|
||||
local Def.ActorFrame {
|
||||
};
|
||||
for idx, diff in pairs(Difficulty) do -- 0, Difficulty_Beginner
|
||||
children[#children+1] = LoadActor( "_DifficultyDisplay 6x1" ) .. {
|
||||
t[#t+1] = LoadActor( "_DifficultyDisplay 6x1" ) .. {
|
||||
InitCommand=cmd(pause;setstate,Difficulty:Reverse()[diff]);
|
||||
ShowCommand=cmd(stoptweening;linear,0.1;diffusealpha,1);
|
||||
HideCommand=cmd(stoptweening;linear,0.1;diffusealpha,0);
|
||||
@@ -18,6 +19,4 @@ for idx, diff in pairs(Difficulty) do -- 0, Difficulty_Beginner
|
||||
};
|
||||
end
|
||||
|
||||
return Def.ActorFrame {
|
||||
children = children
|
||||
};
|
||||
return t;
|
||||
|
||||
Reference in New Issue
Block a user