Files
itgmania212121/Themes/themekit/BGAnimations/ScreenSelectMusic decorations.lua
T
Jason Felds 9982e3369e Themekit handled.
...yeah, I can't replicate the IFFE in pure lua.
2013-07-01 22:08:27 -04:00

55 lines
1.5 KiB
Lua

-- Loads up a slew of objects to load into the screen, like how 3.9 does.
-- I prefer to keep these optional, incase another screen wants to hide
-- these elements.
local t = LoadFallbackB();
--
local function CreateStepDisplay(pn)
local function set(self, player)
self:SetFromGameState( player );
end
local t = Def.StepsDisplay {
InitCommand=function(self)
self:Load("StepsDisplay", GAMESTATE:GetPlayerState(pn));
end;
};
if pn == PLAYER_1 then
t.CurrentStepsP1ChangedMessageCommand=function(self) set(self, pn); end;
t.CurrentTrailP1ChangedMessageCommand=function(self) set(self, pn); end;
else
t.CurrentStepsP2ChangedMessageCommand=function(self) set(self, pn); end;
t.CurrentTrailP2ChangedMessageCommand=function(self) set(self, pn); end;
end
return t;
end
-- Create StepsDisplay for each Player.
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;
PlayerJoinedMessageCommand=function(self, params)
if params.Player == pn then
self:visible(true);
self:zoom(0);
self:bounceend(0.3);
self:zoom(1);
end;
end;
PlayerUnjoinedMessageCommand=function(self, params)
if params.Player == pn then
self:visible(true);
self:bouncebegin(0.3);
self:zoom(0);
end;
end;
};
end
return t