DONE! All lua is future-proofed.

This commit is contained in:
Jason Felds
2013-07-05 22:17:42 -04:00
parent 0259af5c80
commit afd0dac0c1
44 changed files with 3017 additions and 1495 deletions
@@ -7,7 +7,9 @@ local function StepsDisplay(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
@@ -24,8 +26,13 @@ t[#t+1] = StandardDecorationFromFileOptional("AlternateHelpDisplay","AlternateHe
local function PercentScore(pn)
local t = LoadFont("Common normal")..{
InitCommand=cmd(zoom,0.625;shadowlength,1);
BeginCommand=cmd(playcommand,"Set");
InitCommand=function(self)
self:zoom(0.625);
self:shadowlength(1);
end;
BeginCommand=function(self)
self:playcommand("Set");
end;
SetCommand=function(self)
local SongOrCourse, StepsOrTrail;
if GAMESTATE:IsCourseMode() then
@@ -72,16 +79,28 @@ local function PercentScore(pn)
end;
self:settext(text);
end;
CurrentSongChangedMessageCommand=cmd(playcommand,"Set");
CurrentCourseChangedMessageCommand=cmd(playcommand,"Set");
CurrentSongChangedMessageCommand=function(self)
self:playcommand("Set");
end;
CurrentCourseChangedMessageCommand=function(self)
self:playcommand("Set");
end;
};
if pn == PLAYER_1 then
t.CurrentStepsP1ChangedMessageCommand=cmd(playcommand,"Set");
t.CurrentTrailP1ChangedMessageCommand=cmd(playcommand,"Set");
t.CurrentStepsP1ChangedMessageCommand=function(self)
self:playcommand("Set");
end;
t.CurrentTrailP1ChangedMessageCommand=function(self)
self:playcommand("Set");
end;
else
t.CurrentStepsP2ChangedMessageCommand=cmd(playcommand,"Set");
t.CurrentTrailP2ChangedMessageCommand=cmd(playcommand,"Set");
t.CurrentStepsP2ChangedMessageCommand=function(self)
self:playcommand("Set");
end;
t.CurrentTrailP2ChangedMessageCommand=function(self)
self:playcommand("Set");
end;
end
return t;
@@ -95,13 +114,16 @@ for pn in ivalues(PlayerNumber) do
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;
};
@@ -159,10 +181,18 @@ t[#t+1] = StandardDecorationFromFileOptional("SongTime","SongTime") .. {
end;
self:settext( SecondsToMSS(length) );
end;
CurrentSongChangedMessageCommand=cmd(playcommand,"Set");
CurrentCourseChangedMessageCommand=cmd(playcommand,"Set");
CurrentTrailP1ChangedMessageCommand=cmd(playcommand,"Set");
CurrentTrailP2ChangedMessageCommand=cmd(playcommand,"Set");
CurrentSongChangedMessageCommand=function(self)
self:playcommand("Set");
end;
CurrentCourseChangedMessageCommand=function(self)
self:playcommand("Set");
end;
CurrentTrailP1ChangedMessageCommand=function(self)
self:playcommand("Set");
end;
CurrentTrailP2ChangedMessageCommand=function(self)
self:playcommand("Set");
end;
}
if not GAMESTATE:IsCourseMode() then
@@ -198,20 +228,37 @@ if not GAMESTATE:IsCourseMode() then
end;
end;
t[#t+1] = Def.ActorFrame {
OnCommand=cmd(draworder,105;x,SCREEN_CENTER_X-76;y,SCREEN_CENTER_Y-72;zoomy,0;sleep,0.5;decelerate,0.25;zoomy,1;SetUpdateFunction,CDTitleUpdate);
OffCommand=cmd(bouncebegin,0.15;zoomx,0);
OnCommand=function(self)
self:draworder(105);
self:x(SCREEN_CENTER_X-76);
self:y(SCREEN_CENTER_Y-72);
self:zoomy(0);
self:sleep(0.5);
self:decelerate(0.25);
self:zoomy(1);
self:SetUpdateFunction(CDTitleUpdate);
end;
OffCommand=function(self)
self:bouncebegin(0.15);
self:zoomx(0);
end;
Def.Sprite {
Name="CDTitle";
InitCommand=cmd(y,19);
--OnCommand=cmd(draworder,106;shadowlength,1;zoom,0.75;diffusealpha,1;zoom,0;bounceend,0.35;zoom,0.75;spin;effectmagnitude,0,180,0);
InitCommand=function(self)
self:y(19);
end;
};
};
t[#t+1] = StandardDecorationFromFileOptional("NewSong","NewSong") .. {
-- ShowCommand=THEME:GetMetric(Var "LoadingScreen", "NewSongShowCommand" );
-- HideCommand=THEME:GetMetric(Var "LoadingScreen", "NewSongHideCommand" );
InitCommand=cmd(playcommand,"Set");
BeginCommand=cmd(playcommand,"Set");
CurrentSongChangedMessageCommand=cmd(playcommand,"Set");
InitCommand=function(self)
self:playcommand("Set");
end;
BeginCommand=function(self)
self:playcommand("Set");
end;
CurrentSongChangedMessageCommand=function(self)
self:playcommand("Set");
end;
SetCommand=function(self)
-- local pTargetProfile;
local sSong;
@@ -232,7 +279,9 @@ end;
if GAMESTATE:IsCourseMode() then
t[#t+1] = StandardDecorationFromFileOptional("NumCourseSongs","NumCourseSongs")..{
InitCommand=cmd(horizalign,right);
InitCommand=function(self)
self:horizalign(right);
end;
SetCommand=function(self)
local curSelection= nil;
local sAppend = "";
@@ -249,23 +298,23 @@ if GAMESTATE:IsCourseMode() then
self:visible(false);
end;
end;
CurrentCourseChangedMessageCommand=cmd(playcommand,"Set");
CurrentCourseChangedMessageCommand=function(self)
self:playcommand("Set");
end;
};
end
t[#t+1] = StandardDecorationFromFileOptional("DifficultyDisplay","DifficultyDisplay");
t[#t+1] = StandardDecorationFromFileOptional("SortOrderFrame","SortOrderFrame") .. {
--[[ BeginCommand=cmd(playcommand,"Set");
SortOrderChangedMessageCommand=cmd(playcommand,"Set";);
SetCommand=function(self)
local s = SortOrderToLocalizedString( GAMESTATE:GetSortOrder() );
self:settext( s );
self:playcommand("Sort");
end; --]]
};
t[#t+1] = StandardDecorationFromFileOptional("SortOrder","SortOrderText") .. {
BeginCommand=cmd(playcommand,"Set");
SortOrderChangedMessageCommand=cmd(playcommand,"Set";);
BeginCommand=function(self)
self:playcommand("Set");
end;
SortOrderChangedMessageCommand=function(self)
self:playcommand("Set");
end;
SetCommand=function(self)
local s = SortOrderToLocalizedString( GAMESTATE:GetSortOrder() );
self:settext( s );
@@ -285,10 +334,15 @@ t[#t+1] = StandardDecorationFromFileOptional("SongOptions","SongOptionsText") ..
-- Sounds
t[#t+1] = Def.ActorFrame {
LoadActor(THEME:GetPathS("_switch","up")) .. {
SelectMenuOpenedMessageCommand=cmd(stop;play);
SelectMenuOpenedMessageCommand=function(self)
self:playcommand("Set");
end;
};
LoadActor(THEME:GetPathS("_switch","down")) .. {
SelectMenuClosedMessageCommand=cmd(stop;play);
SelectMenuClosedMessageCommand=function(self)
self:stop();
self:play();
end;
};
};