Files
itgmania212121/Themes/default/Graphics/ScreenSelectMusic CourseContentsList.lua
T

95 lines
3.4 KiB
Lua
Raw Normal View History

2017-08-08 01:07:34 -06:00
-- Man, I hate this thing. I tried to do what I could with it, though.
-- I'm not really sure why this needs to be separate from the main CourseContentsList creation...
local transform = function(self,offsetFromCenter,itemIndex,numItems)
self:y( offsetFromCenter * 62 )
-- First condition is for making sure the items disappear before going past the banner.
-- Second condition is to make their transition from the bottom of the screen look a little smoother.
-- The exact numbers will likely need changing if "NumItemsToDraw" is changed.
if offsetFromCenter < -1 or offsetFromCenter > 5 then
self:diffusealpha(0)
-- And this is just so the objects don't look quite as "THERE" underneath the info pane and footer.
elseif offsetFromCenter < 0 or offsetFromCenter > 4 then
self:diffusealpha(0.6)
end
2014-08-25 20:40:03 -07:00
end
2017-08-08 01:07:34 -06:00
2011-03-17 01:47:30 -04:00
return Def.CourseContentsList {
2017-08-08 01:07:34 -06:00
MaxSongs = 999,
NumItemsToDraw = 12,
ShowCommand=cmd(bouncebegin,0.3;zoomy,1),
HideCommand=cmd(linear,0.3;zoomy,0),
2011-03-17 01:47:30 -04:00
SetCommand=function(self)
2017-08-08 01:07:34 -06:00
self:SetFromGameState()
self:SetCurrentAndDestinationItem(0)
self:SetPauseCountdownSeconds(1)
self:SetSecondsPauseBetweenItems( 0.25 )
self:SetTransformFromFunction(transform)
2014-08-16 20:55:57 -07:00
--
2017-08-08 01:07:34 -06:00
self:SetDestinationItem( math.max(0,self:GetNumItems() - 5) )
self:SetLoop(false)
self:SetMask(0,0)
end,
CurrentTrailP1ChangedMessageCommand=cmd(playcommand,"Set"),
CurrentTrailP2ChangedMessageCommand=cmd(playcommand,"Set"),
2011-03-17 01:47:30 -04:00
Display = Def.ActorFrame {
2017-08-08 01:07:34 -06:00
InitCommand=cmd(setsize,290,64),
2011-03-17 01:47:30 -04:00
LoadActor(THEME:GetPathG("CourseEntryDisplay","bar")) .. {
SetSongCommand=function(self, params)
if params.Difficulty then
2017-08-08 01:07:34 -06:00
self:diffuse(ColorLightTone(CustomDifficultyToColor(params.Difficulty)));
2011-03-17 01:47:30 -04:00
else
self:diffuse( color("#FFFFFF") );
end
2017-08-08 01:07:34 -06:00
-- These tweens were actually messing up the visibility of the scroller objects, so...
--(cmd(finishtweening;diffusealpha,0;sleep,0.125*params.Number;smooth,0.2;diffusealpha,1))(self);
end
},
2011-03-17 01:47:30 -04:00
Def.TextBanner {
2017-08-08 01:07:34 -06:00
InitCommand=cmd(x,-10;y,-1;Load,"TextBannerCourse";SetFromString,"", "", "", "", "", ""),
2011-03-17 01:47:30 -04:00
SetSongCommand=function(self, params)
if params.Song then
if GAMESTATE:GetCurrentCourse():GetDisplayFullTitle() == "Abomination" then
-- abomination hack
if PREFSMAN:GetPreference("EasterEggs") then
if params.Number % 2 ~= 0 then
-- turkey march
local artist = params.Song:GetDisplayArtist();
self:SetFromString( "Turkey", "", "", "", artist, "" );
else
self:SetFromSong( params.Song );
end;
else
self:SetFromSong( params.Song );
end;
else
self:SetFromSong( params.Song );
end;
2017-08-08 01:07:34 -06:00
self:diffuse(color("#000000"));
self:diffusealpha(0.8);
2013-07-18 18:02:01 -04:00
-- self:glow("1,1,1,0.5");
2011-03-17 01:47:30 -04:00
else
self:SetFromString( "??????????", "??????????", "", "", "", "" );
self:diffuse( color("#FFFFFF") );
2013-07-18 18:02:01 -04:00
-- self:glow("1,1,1,0");
2011-03-17 01:47:30 -04:00
end
2017-08-08 01:07:34 -06:00
--(cmd(finishtweening;diffusealpha,0;sleep,0.125*params.Number;smooth,0.2;diffusealpha,1;))(self);
end
},
2011-03-17 01:47:30 -04:00
LoadFont("CourseEntryDisplay","difficulty") .. {
2017-08-08 01:07:34 -06:00
Text="0",
InitCommand=cmd(x,210;y,0;zoom,0.75),
2011-03-17 01:47:30 -04:00
SetSongCommand=function(self, params)
if params.PlayerNumber ~= GAMESTATE:GetMasterPlayerNumber() then return end
self:settext( params.Meter );
2017-08-08 01:07:34 -06:00
self:diffuse(ColorDarkTone(CustomDifficultyToColor(params.Difficulty) ));
--(cmd(finishtweening;zoomy,0;sleep,0.125*params.Number;linear,0.125;zoom,1.1;linear,0.05;zoom,1))(self);
end
},
}
}