diff --git a/Themes/rsr/Graphics/MusicWheelItem Roulette NormalPart.lua b/Themes/rsr/Graphics/MusicWheelItem Roulette NormalPart.lua new file mode 100644 index 0000000000..fee0e98fd1 --- /dev/null +++ b/Themes/rsr/Graphics/MusicWheelItem Roulette NormalPart.lua @@ -0,0 +1,60 @@ +local t = Def.ActorFrame {} + +local width = 330 +local height = 46 +local offset = -16 + +-- background mask +t[#t+1] = Def.Quad {} +t[#t].InitCommand = function(self) + self:x(offset) + self:setsize(width, height) + self:diffuse({0, 0, 0, 0.6}) +end + +t[#t+1] = LoadActor(THEME:GetPathG("", "_texture checkerboard")) +t[#t].InitCommand = function(self) + self:rainbow() + self:diffusealpha(0.05) + self:stretchto(-width/2 + offset, -height/2, width/2 + offset, height/2) + self:customtexturerect(0, 0, width/32, height/32) + self:texcoordvelocity(0.5, 0.25) +end + +t[#t+1] = LoadActor(THEME:GetPathG("", "_texture checkerboard")) +t[#t].InitCommand = function(self) + self:rainbow() + self:diffusealpha(0.05) + self:stretchto(-width/2 + offset, -height/2, width/2 + offset, height/2) + self:customtexturerect(0, 0, width/32, height/32) + self:texcoordvelocity(0.5, -0.25) +end + +t[#t+1] = LoadActor(THEME:GetPathG("", "_texture checkerboard")) +t[#t].InitCommand = function(self) + self:rainbow() + self:diffusealpha(0.05) + self:stretchto(-width/2 + offset, -height/2, width/2 + offset, height/2) + self:customtexturerect(0, 0, width/32, height/32) + 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 new file mode 100644 index 0000000000..9c1faf949c --- /dev/null +++ b/Themes/rsr/Graphics/MusicWheelItem SectionCollapsed NormalPart.lua @@ -0,0 +1,44 @@ +local t = Def.ActorFrame {} + +local width = 330 +local height = 46 +local offset = -16 + +-- background top +t[#t+1] = Def.Quad {} +t[#t].InitCommand = function(self) + self:x(offset) + self:vertalign(bottom) + self:setsize(width, height/2) + self:diffusetopedge({0.05, 0.05, 0.05, 0.6}) + self:diffusebottomedge({0.0, 0.0, 0.0, 0.6}) +end + +-- background bottom +t[#t+1] = Def.Quad {} +t[#t].InitCommand = function(self) + self:x(offset) + self:vertalign(top) + self:setsize(width, height/2) + 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 new file mode 100644 index 0000000000..82f52ba244 --- /dev/null +++ b/Themes/rsr/Graphics/MusicWheelItem SectionExpanded NormalPart.lua @@ -0,0 +1,44 @@ +local t = Def.ActorFrame {} + +local width = 330 +local height = 46 +local offset = -16 + +-- background top +t[#t+1] = Def.Quad {} +t[#t].InitCommand = function(self) + self:x(offset) + self:vertalign(bottom) + self:setsize(width, height/2) + self:diffuse({0.1, 0.1, 0.1, 0.6}) +end + +-- background bottom +t[#t+1] = Def.Quad {} +t[#t].InitCommand = function(self) + self:x(offset) + self:vertalign(top) + self:setsize(width, height/2) + self:diffusebottomedge({0.2, 0.2, 0.2, 0.6}) + 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 ColorPart.lua b/Themes/rsr/Graphics/MusicWheelItem Song ColorPart.lua index d3d0df30f3..16702e25d7 100644 --- a/Themes/rsr/Graphics/MusicWheelItem Song ColorPart.lua +++ b/Themes/rsr/Graphics/MusicWheelItem Song ColorPart.lua @@ -1,14 +1,3 @@ -return Def.ActorFrame { - Def.Quad { - InitCommand=cmd(x,-128+4;zoomto,4,46); --- OnCommand=cmd(diffuse,color("0,0,0,0.5")); - }; ---[[ Def.Quad { - InitCommand=cmd(x,-128+16+6;zoomto,32,46); --- OnCommand=cmd(faderight,1;diffusealpha,0.5); - }; --]] ---[[ Def.Quad { - InitCommand=cmd(x,2;y,23;zoomto,320,1); --- OnCommand=cmd(diffuse,color("0,0,0,0.5")); - }; --]] -}; \ No newline at end of file +return Def.Quad { + InitCommand=cmd(x,-129;zoomto,4,46) +} diff --git a/Themes/rsr/Graphics/MusicWheelItem Song NormalPart.lua b/Themes/rsr/Graphics/MusicWheelItem Song NormalPart.lua deleted file mode 100644 index 7c5b876099..0000000000 --- a/Themes/rsr/Graphics/MusicWheelItem Song NormalPart.lua +++ /dev/null @@ -1,6 +0,0 @@ -return Def.ActorFrame { - Def.Quad { - InitCommand=cmd(x,4;zoomto,256-4,46); - OnCommand=cmd(diffuse,color("0,0,0,0.5")); - }; -}; \ No newline at end of file diff --git a/Themes/rsr/Graphics/MusicWheelItem Song NormalPart/default.lua b/Themes/rsr/Graphics/MusicWheelItem Song NormalPart/default.lua new file mode 100644 index 0000000000..a51290f5ee --- /dev/null +++ b/Themes/rsr/Graphics/MusicWheelItem Song NormalPart/default.lua @@ -0,0 +1,150 @@ +local t = Def.ActorFrame {} + +local width = 330 +local height = 46 +local offset = -16 + +t.InitCommand=function(self) + --self:y(0.5) +end + +-- background +t[#t+1] = Def.Quad {} +t[#t].InitCommand = function(self) + self:x(offset + 29) + self:setsize(width - 50, height) + self:diffuse({0, 0, 0, 0.6}) +end + +-- genre gen <3 +local function GenerateRandomColors(song) + if not song then return 0, {} end + + -- randomseed truncates float values, but we need more randomness. + -- move the number over several digits to compensate. + local length = song:MusicLengthSeconds() + + -- BMS files without BGM mess with this (zero). Use 120 instead. + if length == 0 then + length = 120 + elseif length == 105 then -- ITG length hack + length = 1001 + end + local seed = 10000*length + math.randomseed(seed) + + -- Vary the amount of words returned, based on the seed. + local rand = math.random() + + -- chances for word amount: + -- 2/10 for one, 7/10 for two, 1/10 for three + if rand < 0.2 then num = 1 + elseif rand > 0.9 then num = 3 + else num = 2 end + + colors = {} + for i=1,num do + colors[i] = {} + math.randomseed(seed) + colors[i][1] = math.random(); + math.randomseed(seed+5) + colors[i][2] = math.random(); + math.randomseed(seed+10) + colors[i][3] = math.random(); + math.randomseed(seed+15) + colors[i][4] = clamp(math.random(), 0.75, 1.0) + seed = seed + 1 + end + return num, colors +end + +local t2 = Def.ActorFrame { + SetMessageCommand = function(self, params) + local song = params.Song + + local num, colors = GenerateRandomColors(song) + + local children = {} + for i=1,self:GetNumChildren() do + children[i] = self:GetChild("MusicWheel_Quad"..i) + end + for k, v in pairs(children) do + v:visible(false) + if k <= num and song then + v:visible(true) + v:y(math.ceil(-height/2 + ((height-1)/num)*(k-1))) + local sub = num % 2 == 0 and 1 or 0 + v:setsize(50, math.ceil((height-sub)/num)) + v:diffuse(colors[k]) + end + end + end +} + +for i=1,3 do + t2[#t2+1] = Def.Quad { + Name="MusicWheel_Quad"..i, + InitCommand=function(self) + self:horizalign(left) + self:vertalign(top) + self:y(math.ceil(-height/2)) + self:x(-width/2 + offset) + self:setsize(50, height-1) + self:diffusealpha(0.0) + end + } +end + +t[#t+1] = t2 + +t[#t+1] = LoadActor(THEME:GetPathG("", "_shigu")) +t[#t].InitCommand = cmd(visible,false;x,-width/2+3;zoom,0.25;animate,false) +t[#t].SetMessageCommand = function(self, params) + local song = params.Song + + if song and string.lower(song:GetDisplayMainTitle()) == "sigsig" then + self:visible(true) + if params.HasFocus then + self:animate(true) + else + self:setstate(0) + self:animate(false) + end + else + self:visible(false) + end +end + + +t[#t+1] = LoadActor(THEME:GetPathG("", "_hax")) +t[#t].InitCommand = cmd(visible,false;x,-width/2-offset/2;zoom,0.25;animate,false) +t[#t].SetMessageCommand = function(self, params) + local song = params.Song + + if song and song:MusicLengthSeconds() == 105 then + self:visible(true) + else + self:visible(false) + 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/Graphics/_hax.png b/Themes/rsr/Graphics/_hax.png new file mode 100644 index 0000000000..cf49202ce0 Binary files /dev/null and b/Themes/rsr/Graphics/_hax.png differ diff --git a/Themes/rsr/Graphics/_shigu 3x1.png b/Themes/rsr/Graphics/_shigu 3x1.png new file mode 100644 index 0000000000..96772fa734 Binary files /dev/null and b/Themes/rsr/Graphics/_shigu 3x1.png differ