--[[

NOTICE: THIS CODE IS MAD OUTDATED AND ACTUALLY DOESN'T DO WHAT I WAS HOPING
FOR. I LATER FIXED THIS PROBLEM BUT DID NOT IMPLEMENT IT IN NCEVO.

DON'T TRY AND LEARN FROM THIS, I guess.

-syn

]]

-- c is used later :ssh:
local c;

--[[
ScreenSelectMusic has the following children:

MusicWheel
OptionsList[PlayerNumberToString]
Banner
CDTitle
ScoreFrameP[number]
ScoreP[number]
]]

local t = Def.ActorFrame{
	-- look at me i'm a generic piece of monkey shit!!!
	
	children = {
		LoadActor("MusicWheelItem song")..{ Name="WheelItem"; };
		Def.Quad{ Name="LongVerQuad"; };
		LoadFont("","_helvblack")..{ Name="DebugOut"; };
	};
	
	InitCommand=function(self)
		-- get all the children
		c = self:GetChildren();
		
		-- set up Quad beforehand
		c.LongVerQuad:setsize(16,16);
		c.LongVerQuad:diffuse(color("0,0.45,1,1"));
		
		-- set up DebugOut
		c.DebugOut:settext(c.WheelItem:GetDiffuseAlpha());
	end;
	
	BeginCommand=function(self)
		c = self:GetChildren();
	
		-- I was told to set things here by someone much wiser than myself.
		local song = GAMESTATE:GetCurrentSong();
		
		-- if there's no song, get the fuck out
		if not song then c.LongVerQuad:visible(false); return; end;
		
		-- at this point we can assume there's a song.
		-- now we want to check if the wheel item has focus, and since I can't
		-- do it the right way, I'm going to do it the hack way since I found
		-- a way to do so.
		
		if song:GetDisplayArtist() == "m1dy" then
			c.WheelItem:diffuse(color("1,0,0,1"));
		end;
		
		if c.WheelItem:GetDiffuseAlpha() == 0.9 then
			(cmd(wag))(c.WheelItem);
		else (cmd(stopeffect))(c.WheelItem);
		end;
	end;
	
	--[[
	-- UH OH WHAT'S A NIGGA GONNA DO WITH A QUAD
	Def.ActorProxy{
		BeginCommand=function(self)
			local c = SCREENMAN:GetTopScreen():GetChild('MusicWheel'):GetChildren();
			for i=1,table.getn(c) do
				Trace("S DEBUG: ScreenSelectMusic's children include: "..c[i]:GetName());
			end;
			--self:SetTarget(wheelitem);
		end;
	};
	]]
	
	
};

return t;

-- coded by Synikal of the Destined