Themekit handled.

...yeah, I can't replicate the IFFE in pure lua.
This commit is contained in:
Jason Felds
2013-07-01 22:08:27 -04:00
parent ca1b8cb942
commit 9982e3369e
5 changed files with 100 additions and 51 deletions
@@ -10,7 +10,9 @@ local function CreateStepDisplay(pn)
end
local t = Def.StepsDisplay {
InitCommand=cmd(Load,"StepsDisplay",GAMESTATE:GetPlayerState(pn););
InitCommand=function(self)
self:Load("StepsDisplay", GAMESTATE:GetPlayerState(pn));
end;
};
if pn == PLAYER_1 then
@@ -27,17 +29,24 @@ end
for pn in ivalues(PlayerNumber) do
local MetricsName = "StepsDisplay" .. PlayerNumberToString(pn);
t[#t+1] = CreateStepDisplay(pn) .. {
InitCommand=function(self) self:player(pn); self:name(MetricsName); ActorUtil.LoadAllCommandsAndSetXY(self,Var "LoadingScreen"); end;
InitCommand=function(self)
self:player(pn);
self:name(MetricsName);
ActorUtil.LoadAllCommandsAndSetXY(self,Var "LoadingScreen");
end;
PlayerJoinedMessageCommand=function(self, params)
if params.Player == pn then
self:visible(true);
(cmd(zoom,0;bounceend,0.3;zoom,1))(self);
self:zoom(0);
self:bounceend(0.3);
self:zoom(1);
end;
end;
PlayerUnjoinedMessageCommand=function(self, params)
if params.Player == pn then
self:visible(true);
(cmd(bouncebegin,0.3;zoom,0))(self);
self:bouncebegin(0.3);
self:zoom(0);
end;
end;
};
@@ -1,61 +1,75 @@
local t = Def.ActorFrame {};
--
--[[ local tGridSizeMajor = { 32, 32 };
local tGridSizeMinor = { 16, 16 };
local function CreateDebugGrid()
local t = Def.ActorFrame {};
local numX = math.ceil(SCREEN_WIDTH/tGridSizeMajor[1])
local numY = math.ceil(SCREEN_HEIGHT/tGridSizeMajor[2])
local offset = ( math.ceil(SCREEN_WIDTH/tGridSizeMajor[1]) - SCREEN_WIDTH ) + SCREEN_WIDTH;
for a=1,numY do
for b=1,numX do
t[#t+1] = Def.Quad {
InitCommand=cmd(x,b*tGridSizeMajor[1]-(tGridSizeMajor[1]/2);y,a*tGridSizeMajor[2]-(tGridSizeMajor[2]/2));
OnCommand=cmd(zoomto,tGridSizeMajor[1]-2,tGridSizeMajor[2]-2;diffuse,color("1,1,1,0.25"));
};
end;
end;
return t
end --]]
--
t[#t+1] = Def.ActorFrame {
InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y);
InitCommand=function(self)
self:x(SCREEN_CENTER_X);
self:y(SCREEN_CENTER_Y);
end;
LoadActor("VOL1-29-NTSC") .. {
InitCommand=cmd(scaletoclipped,SCREEN_WIDTH,SCREEN_HEIGHT);
OnCommand=cmd(diffusealpha,0.75);
InitCommand=function(self)
self:scaletoclipped(SCREEN_WIDTH, SCREEN_HEIGHT);
end;
OnCommand=function(self)
self:diffusealpha(0.75);
end;
};
};
--
local bShow = 0;
t[#t+1] = Def.ActorFrame {
InitCommand=cmd(visible,false);
InitCommand=function(self)
self:visible(false);
end;
ToggleConsoleDisplayMessageCommand=function(self)
bShow = 1 - bShow;
self:visible( bShow == 1 );
end;
-- Grid
LoadActor("_32") .. {
InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;zoomto,SCREEN_WIDTH,SCREEN_HEIGHT;customtexturerect,0,0,SCREEN_WIDTH/32,SCREEN_HEIGHT/32);
OnCommand=cmd(diffuse,color("0,0,0,0.5"));
InitCommand=function(self)
self:x(SCREEN_CENTER_X);
self:y(SCREEN_CENTER_Y);
self:zoomto(SCREEN_WIDTH, SCREEN_HEIGHT);
self:customtexturerect(0, 0, SCREEN_WIDTH / 32, SCREEN_HEIGHT / 32);
end;
OnCommand=function(self)
self:diffuse(color("0,0,0,0.5"));
end;
};
LoadActor("_16") .. {
InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;zoomto,SCREEN_WIDTH,SCREEN_HEIGHT;customtexturerect,0,0,SCREEN_WIDTH/16,SCREEN_HEIGHT/16);
OnCommand=cmd(diffuse,color("1,1,1,0.125"));
InitCommand=function(self)
self:x(SCREEN_CENTER_X);
self:y(SCREEN_CENTER_Y);
self:zoomto(SCREEN_WIDTH, SCREEN_HEIGHT);
self:customtexturerect(0, 0, SCREEN_WIDTH / 16, SCREEN_HEIGHT / 16);
end;
OnCommand=function(self)
self:diffuse(color("1,1,1,0.125"));
end;
};
--[[ LoadActor("_8") .. {
InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;zoomto,SCREEN_WIDTH,SCREEN_HEIGHT;customtexturerect,0,0,SCREEN_WIDTH/8,SCREEN_HEIGHT/8);
OnCommand=cmd(diffuse,color("#00BFE833"));
}; --]]
-- Left
Def.Quad {
InitCommand=cmd(horizalign,left;x,SCREEN_LEFT;y,SCREEN_CENTER_Y;zoomto,16,SCREEN_HEIGHT);
OnCommand=cmd(diffuse,color("0,0,0,0.5"));
InitCommand=function(self)
self:horizalign(left);
self:x(SCREEN_LEFT);
self:y(SCREEN_CENTER_Y)
self:zoomto(16, SCREEN_HEIGHT);
end;
OnCommand=function(self)
self:diffuse(color("0,0,0,0.5"));
end;
};
-- Right
Def.Quad {
InitCommand=cmd(horizalign,right;x,SCREEN_RIGHT;y,SCREEN_CENTER_Y;zoomto,16,SCREEN_HEIGHT);
OnCommand=cmd(diffuse,color("0,0,0,0.5"));
InitCommand=function(self)
self:horizalign(right);
self:x(SCREEN_RIGHT);
self:y(SCREEN_CENTER_Y)
self:zoomto(16, SCREEN_HEIGHT);
end;
OnCommand=function(self)
self:diffuse(color("0,0,0,0.5"));
end;
};
};
--
@@ -6,7 +6,9 @@ local t = Def.ActorFrame {};
t[#t+1] = StandardDecorationFromFileOptional("Header","Header");
-- Text displayed at the top of the screen
t[#t+1] = StandardDecorationFromFileOptional("TextHeader","TextHeader") .. {
BeginCommand=cmd(playcommand,"Set");
BeginCommand=function(self)
self:playcommand("Set");
end;
SetCommand=function(self)
local sText = '_';
if SCREENMAN:GetTopScreen() then
@@ -1,14 +1,27 @@
local t = Def.ActorFrame {
InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y);
InitCommand=function(self)
self:x(SCREEN_CENTER_X);
self:y(SCREEN_CENTER_Y);
end;
};
--
t[#t+1] = LoadActor("grid") .. {
InitCommand=cmd(zoomto,SCREEN_WIDTH,SCREEN_HEIGHT;customtexturerect,0,0,SCREEN_WIDTH/16,SCREEN_HEIGHT/16);
OnCommand=cmd(diffuse,color("0,0,0,0.125"));
InitCommand=function(self)
self:zoomto(SCREEN_WIDTH, SCREEN_HEIGHT);
self:customtexturerect(0, 0, SCREEN_WIDTH / 16, SCREEN_HEIGHT / 16);
end;
OnCommand=function(self)
self:diffuse(color("0,0,0,0.125"));
end;
};
t[#t+1] = LoadActor("grid") .. {
InitCommand=cmd(zoomto,SCREEN_WIDTH,SCREEN_HEIGHT;customtexturerect,0,0,SCREEN_WIDTH/32,SCREEN_HEIGHT/32);
OnCommand=cmd(diffuse,color("0,0,0,0.25"));
InitCommand=function(self)
self:zoomto(SCREEN_WIDTH, SCREEN_HEIGHT);
self:customtexturerect(0, 0, SCREEN_WIDTH / 32, SCREEN_HEIGHT / 32);
end;
OnCommand=function(self)
self:diffuse(color("0,0,0,0.25"));
end;
};
--
return t
+17 -6
View File
@@ -7,13 +7,24 @@ function TextBannerAfterSet(self,param)
local Subtitle=self:GetChild("Subtitle");
local Artist=self:GetChild("Artist");
if Subtitle:GetText() == "" then
(cmd(maxwidth,mainMaxWidth;y,-8;zoom,1;))(Title);
(cmd(visible,false))(Subtitle);
(cmd(zoom,0.66;maxwidth,artistMaxWidth;y,8))(Artist);
Title:maxwidth(mainMaxWidth);
Title:y(-8);
Title:zoom(1);
Subtitle:visible(false);
Artist:zoom(0.66);
Artist:maxwidth(artistMaxWidth);
Artist:y(8);
else
-- subtitle below
(cmd(maxwidth,mainMaxWidth*1.25;y,-11;zoom,0.75;))(Title);
(cmd(visible,true;zoom,0.6;y,0;maxwidth,subMaxWidth))(Subtitle);
(cmd(zoom,0.6;maxwidth,artistMaxWidth;y,10))(Artist);
Title:maxwidth(mainMaxWidth * 1.25);
Title:y(-11);
Title:zoom(0.75);
Subtitle:visible(true);
Subtitle:zoom(0.6);
Subtitle:y(0);
Subtitle:maxwidth(subMaxWidth);
Artist:zoom(0.6);
Artist:maxwidth(artistMaxWidth);
Artist:y(10);
end
end