-- 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=cmd(Load,"StepsDisplay",GAMESTATE:GetPlayerState(pn);); }; 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); (cmd(zoom,0;bounceend,0.3;zoom,1))(self); end; end; PlayerUnjoinedMessageCommand=function(self, params) if params.Player == pn then self:visible(true); (cmd(bouncebegin,0.3;zoom,0))(self); end; end; }; end return t