From ede552add884251307cc5bbfaa387d6f1914255c Mon Sep 17 00:00:00 2001 From: Colby Klein Date: Sat, 5 Oct 2013 06:36:35 -0700 Subject: [PATCH] rsr: MusicWheel upgrades part 2 (Sourced from shakesoda/stepmania.) --- Themes/rsr/Graphics/MusicWheel highlight.lua | 30 +++++ .../MusicWheelItem Roulette NormalPart.lua | 18 --- ...cWheelItem SectionCollapsed NormalPart.lua | 18 --- ...icWheelItem SectionExpanded NormalPart.lua | 18 --- .../default.lua | 19 --- Themes/rsr/metrics.ini | 121 +++++++++++++++++- 6 files changed, 149 insertions(+), 75 deletions(-) create mode 100644 Themes/rsr/Graphics/MusicWheel highlight.lua diff --git a/Themes/rsr/Graphics/MusicWheel highlight.lua b/Themes/rsr/Graphics/MusicWheel highlight.lua new file mode 100644 index 0000000000..cc1cc249e7 --- /dev/null +++ b/Themes/rsr/Graphics/MusicWheel highlight.lua @@ -0,0 +1,30 @@ +local width = 330 +local height = 46 +local offset = -16 + +return Def.ActorFrame { + Def.Quad { + InitCommand=function(self) + self:setsize(4,SCREEN_HEIGHT) + self:x(-width/2+offset-2) + self:diffuse({0, 0, 0, 0.7}) + end + }, + Def.Quad { + InitCommand=function(self) + self:x(offset) + self:setsize(width,height) + self:blend('BlendMode_Add') + --self:thump() + self:diffuse({1, 0.8, 0.7, 0.1}) + self:effectclock('beat') + end, + CurrentSongChangedMessageCommand=function(self, params) + if not GAMESTATE:GetCurrentSong() then + self:stopeffect() + else + self:thump() + end + end + } +} \ No newline at end of file diff --git a/Themes/rsr/Graphics/MusicWheelItem Roulette NormalPart.lua b/Themes/rsr/Graphics/MusicWheelItem Roulette NormalPart.lua index fee0e98fd1..6bc43b361a 100644 --- a/Themes/rsr/Graphics/MusicWheelItem Roulette NormalPart.lua +++ b/Themes/rsr/Graphics/MusicWheelItem Roulette NormalPart.lua @@ -39,22 +39,4 @@ t[#t].InitCommand = function(self) self:texcoordvelocity(-0, 0.5) end --- bottom border -t[#t+1] = Def.Quad {} -t[#t].InitCommand = function(self) - self:x(offset+10) - self:y(math.ceil(height/2)+1) - self:setsize(width+20, 2) - self:diffuse({0.0, 0.0, 0.0, 0.8}) -end - --- left border -t[#t+1] = Def.Quad {} -t[#t].InitCommand = function(self) - self:x(-width/2+offset) - self:y(1) - self:setsize(2, height+2) - self:diffuse({0.0, 0.0, 0.0, 0.8}) -end - return t diff --git a/Themes/rsr/Graphics/MusicWheelItem SectionCollapsed NormalPart.lua b/Themes/rsr/Graphics/MusicWheelItem SectionCollapsed NormalPart.lua index 9c1faf949c..d1742b24e7 100644 --- a/Themes/rsr/Graphics/MusicWheelItem SectionCollapsed NormalPart.lua +++ b/Themes/rsr/Graphics/MusicWheelItem SectionCollapsed NormalPart.lua @@ -23,22 +23,4 @@ t[#t].InitCommand = function(self) self:diffuse({0, 0, 0, 0.6}) end --- bottom border -t[#t+1] = Def.Quad {} -t[#t].InitCommand = function(self) - self:x(offset+10) - self:y(math.ceil(height/2)+1) - self:setsize(width+20, 2) - self:diffuse({0.0, 0.0, 0.0, 0.8}) -end - --- left border -t[#t+1] = Def.Quad {} -t[#t].InitCommand = function(self) - self:x(-width/2+offset) - self:y(1) - self:setsize(2, height+2) - self:diffuse({0.0, 0.0, 0.0, 0.8}) -end - return t diff --git a/Themes/rsr/Graphics/MusicWheelItem SectionExpanded NormalPart.lua b/Themes/rsr/Graphics/MusicWheelItem SectionExpanded NormalPart.lua index 82f52ba244..362054fd73 100644 --- a/Themes/rsr/Graphics/MusicWheelItem SectionExpanded NormalPart.lua +++ b/Themes/rsr/Graphics/MusicWheelItem SectionExpanded NormalPart.lua @@ -23,22 +23,4 @@ t[#t].InitCommand = function(self) self:diffusetopedge({0.1, 0.1, 0.1, 0.6}) end --- bottom border -t[#t+1] = Def.Quad {} -t[#t].InitCommand = function(self) - self:x(offset+10) - self:y(math.ceil(height/2)+1) - self:setsize(width+20, 2) - self:diffuse({0.0, 0.0, 0.0, 0.8}) -end - --- left border -t[#t+1] = Def.Quad {} -t[#t].InitCommand = function(self) - self:x(-width/2+offset) - self:y(1) - self:setsize(2, height+2) - self:diffuse({0.0, 0.0, 0.0, 0.8}) -end - return t diff --git a/Themes/rsr/Graphics/MusicWheelItem Song NormalPart/default.lua b/Themes/rsr/Graphics/MusicWheelItem Song NormalPart/default.lua index a51290f5ee..19b261bd61 100644 --- a/Themes/rsr/Graphics/MusicWheelItem Song NormalPart/default.lua +++ b/Themes/rsr/Graphics/MusicWheelItem Song NormalPart/default.lua @@ -128,23 +128,4 @@ t[#t].SetMessageCommand = function(self, params) end end - --- bottom border -t[#t+1] = Def.Quad {} -t[#t].InitCommand = function(self) - self:x(offset+10) - self:y(math.ceil(height/2)+1) - self:setsize(width+20, 2) - self:diffuse({0.0, 0.0, 0.0, 0.8}) -end - --- left border -t[#t+1] = Def.Quad {} -t[#t].InitCommand = function(self) - self:x(-width/2+offset) - self:y(1) - self:setsize(2, height+2) - self:diffuse({0.0, 0.0, 0.0, 0.8}) -end - return t diff --git a/Themes/rsr/metrics.ini b/Themes/rsr/metrics.ini index 0c02360c0d..52d580b575 100644 --- a/Themes/rsr/metrics.ini +++ b/Themes/rsr/metrics.ini @@ -46,5 +46,122 @@ ScrollerColors="Exit:#ff0000" MusicWheelX=SCREEN_RIGHT-128-18 MusicWheelOnCommand=draworder,-1 [MusicWheel] -ItemTransformFunction=function(self,offsetFromCenter,itemIndex,numItems) self:x( (1-math.cos(offsetFromCenter/math.pi))*0 ); self:y( offsetFromCenter*48 ); end -NumWheelItems=13 \ No newline at end of file +ItemTransformFunction=function(self,offsetFromCenter,itemIndex,numItems) \ + self:x( (1-math.cos(offsetFromCenter/math.pi))*0 ) \ + self:y( offsetFromCenter*46 ) \ +end +NumWheelItems=13 + +[MusicWheelItem] +WheelNotifyIconX=-128-16+0.5 +WheelNotifyIconOnCommand=shadowlength,2; +SongNameX=-120 +CourseX=-120 +CourseOnCommand=maxwidth,208;horizalign,left +SectionExpandedX=-120 +SectionExpandedY=0 +SectionExpandedOnCommand=maxwidth,194;horizalign,left;shadowcolor,color("0.1,0.1,0.1,0.25") +SectionCollapsedX=-120 +SectionCollapsedY=0 +SectionCollapsedOnCommand=maxwidth,194;horizalign,left;shadowcolor,color("0.1,0.1,0.1,0.2") +SectionCountX=120 +SectionCountOnCommand=zoom,0.75;strokecolor,Color("Outline") +RouletteOnCommand=maxwidth,400;shadowlength,1;basezoom,0.75;rainbowscroll,true;pulse;effectmagnitude,1,1.125,1;effectperiod,3 +SortX=-132 +SortY=-2 +SortOnCommand=maxwidth,256;horizalign,left;shadowlength,1;shadowcolor,color("0,0,0,0.325") +ModeX=-132 +ModeY=-2 +ModeOnCommand=maxwidth,256;horizalign,left;strokecolor,Color("Outline") +GradeP1X=106+16 +GradeP1Y=-8 +GradeP2X=110+16 +GradeP2Y=8 + +[TextBanner] +TitleOnCommand=horizalign,left;shadowlengthy,1;shadowcolor,color("0,0,0,0.5") +; lots of misc effects for songs +TitleSetMessageCommand=%function(self, params) \ + local song = params.Song \ + if not song then return end \ + local title = song:GetDisplayFullTitle() \ + local artist = song:GetDisplayArtist() \ + if title == "Let It Flow" and artist == "BANTU" then \ + self:jitter(true) \ + else \ + self:jitter(false) \ + end \ + if string.find(title, "Katamari") then \ + self:rainbowscroll(true) \ + else \ + self:rainbowscroll(false) \ + end \ + if title == "KING of the SEA" then \ + self:zoom(1.5) \ + self:maxwidth(170) \ + end \ + if (string.find(string.lower(title), "hardstyle") or \ + string.find(string.lower(title), "hardcore")) and \ + params.HasFocus then \ + self:diffuseramp() \ + self:effectclock("bgm") \ + self:effectcolor1(color("#ccaaaa")) \ + else \ + self:stopeffect() \ + end \ + if artist == "Angerfist" and params.HasFocus then \ + self:diffuseramp() \ + self:effectclock("bgm") \ + self:effectcolor1(color("#ffaaaa")) \ + else \ + self:stopeffect() \ + end \ +end +SubtitleOnCommand=horizalign,left;shadowlengthy,1;shadowcolor,color("0,0,0,0.5") +SubtitleSetMessageCommand=%function(self, params) \ + local song = params.Song \ + if not song then return end \ + --[[ I've got a few simfiles here with an annoying prefix here. ]] \ + local subtitle = song:GetDisplaySubTitle() \ + if string.sub(subtitle, 1, 2) == "- " then \ + self:settext(string.sub(subtitle, 3)) \ + end \ +end +ArtistOnCommand=horizalign,left;shadowlengthy,1;shadowcolor,color("0,0,0,0.5") +ArtistSetMessageCommand=diffuse,color("#aaaaaa") +ArtistPrependString="/" +AfterSetCommand=%function(self,param) \ + local mainMaxWidth = 228 \ + local subMaxWidth = 420 \ + local artistMaxWidth = 300/0.8 \ + local Title = self:GetChild("Title") \ + local Subtitle = self:GetChild("Subtitle") \ + local Artist = self:GetChild("Artist") \ + \ + if Subtitle:GetText() == "" then \ + Title:maxwidth(mainMaxWidth) \ + Title:y(-8) \ + Title:zoom(1) \ + \ + --[[ hide so that the game skips drawing. ]] \ + Subtitle:visible(false) \ + \ + Artist:zoom(0.66) \ + Artist:maxwidth(artistMaxWidth) \ + Artist:y(8) \ + else \ + Title:maxwidth(mainMaxWidth*1.25) \ + Title:y(-11) \ + Title:zoom(0.75) \ + \ + --[[ subtitle below title ]] \ + Subtitle:visible(true) \ + Subtitle:zoom(0.55) \ + Subtitle:y(0) \ + Subtitle:maxwidth(subMaxWidth) \ + \ + Artist:zoom(0.6) \ + Artist:maxwidth(artistMaxWidth) \ + Artist:y(10) \ + end \ +end