local Index = Var("GameCommand"):GetIndex();
local GameName = Var("GameCommand"):GetName();
local FriendlyGameName = THEME:GetString("ScreenSelectStyle",Var("GameCommand"):GetName() );
local FriendlyStyleName = THEME:GetString("ScreenSelectStyle","Explanation" .. Var("GameCommand"):GetName() );
local IconSize = 106*1.65;
local IconX = THEME:GetMetric("ScreenSelectStyle","Icon"..GameName.."X");
local IconY = THEME:GetMetric("ScreenSelectStyle","IconCommonY");
local IconWidth = 584;
local IconHeight = 256;
local ThemeColor = ReadPref("Themes/Cerulean Skies/Preferences/","ThemeColor")
local PadAlias = { Single = "home single",Solo = "home single",Versus = "versus",Double = "double",Couple = "double",};
local function GetPadStyle()
    local padstyle = PadAlias[FriendlyGameName]
    return padstyle
end;
local t = Def.ActorFrame {
    Def.ActorFrame {
     InitCommand=cmd(x,IconX;y,IconY);
        -- Icons --
        -- Background Icon
        LoadActor(THEME:GetPathG("_frame", "1D"),{ 1/3, 1/3, 1/3 },LoadActor(THEME:GetPathG("1D","Frames/Icon Cell " .. ThemeColor))) .. {
            DisabledCommand=cmd(playcmomand,"SetSize",{ Width=IconSize; tween=cmd(finishtweening;diffuse,0,0,0,1) });
            EnabledCommand=cmd(playcmomand,"SetSize",{ Width=IconSize; tween=cmd(finishtweening;diffuse,1,1,1,1) });
            GainFocusCommand=cmd(playcommand,"SetSize",{ Width=IconSize; tween=cmd(finishtweening;diffuse,1,1,1,1;); });
            LoseFocusCommand=cmd(playcommand,"SetSize",{ Width=IconSize; tween=cmd(finishtweening;diffuse,0.5,0.5,0.5,1;); });
        };
        -- Icon Text --
        LoadFont("Common") .. {
            Text=FriendlyGameName;
            InitCommand=cmd(shadowlength,1;maxwidth,106);
        };
        -- Conformation Select
        LoadActor(THEME:GetPathG("_frame", "1D"),{ 1/3, 1/3, 1/3 },LoadActor(THEME:GetPathG("1D","Frames/Icon Glow"))) .. {
            LoseFocusCommand=cmd(playcommand,"SetSize",{ Width=IconSize; tween=cmd(finishtweening;visible,false); });
            GainFocusCommand=cmd(playcommand,"SetSize",{ Width=IconSize; tween=cmd(finishtweening;visible,true;fadetop,0;croptop,0;diffuse,1,1,1,1;decelerate,1.25;fadetop,1;croptop,1;sleep,1.5;queuecommand,"GainFocus"); });
        };
        -- Selector Flash
        LoadActor(THEME:GetPathG("_frame", "1D"),{ 1/3, 1/3, 1/3 },LoadActor(THEME:GetPathG("1D","Frames/Icon Glow"))) .. {
            InitCommand=cmd(playcommand,"SetSize",{ Width=IconSize; tween=cmd(finishtweening;diffusealpha,0;);  });
            GainFocusCommand=cmd(playcommand,"SetSize",{ Width=IconSize; tween=cmd(finishtweening;diffusealpha,1;decelerate,0.5;diffusealpha,0;); });
    --~         LoseFocusCommand=cmd(playcommand,"SetSize",{ Width=IconSize; tween=cmd(); });
        };
        -- Disabled Flash?
        LoadActor(THEME:GetPathG("_frame", "1D"),{ 1/3, 1/3, 1/3 },LoadActor(THEME:GetPathG("1D","Frames/Icon Glow"))) .. {
            InitCommand=cmd(playcommand,"SetSize",{ Width=IconSize; tween=cmd(finishtweening;diffusealpha,0;playcommand,"Enabled");  });
            EnabledCommand=cmd(playcommand,"SetSize",{ Width=IconSize; tween=cmd(finishtweening;visible,true;fadetop,1;croptop,0;diffuse,1,1,1,1;decelerate,1.25;fadetop,1;croptop,1;); });
            DisabledCommand=cmd(playcommand,"SetSize",{ Width=IconSize; tween=cmd(finishtweening;visible,true;fadetop,0;croptop,0;diffuse,1,0,0,1;decelerate,1.25;fadetop,1;); });
        };
    };
    Def.ActorFrame {
     GainFocusCommand=cmd(visible,true);
     LoseFocusCommand=cmd(visible,false);
        -- Preview Background --
        LoadActor(THEME:GetPathG("Common","Select Background " .. ThemeColor)) .. {
            InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_TOP+208);
            GainFocusCommand=cmd(visible,true);
            LoseFocusCommand=cmd(visible,false);
        };
        LoadActor(THEME:GetPathG("_platform",GetPadStyle())) .. {
            InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_TOP+194;rotationx,35);
            BeginCommand=cmd(wag;effectmagnitude,0,8,0);
           GainFocusCommand=cmd(visible,true);
            LoseFocusCommand=cmd(visible,false);
        };
        -- Select Style 1 Header! --
--[[         LoadFont("Header") .. {
            Text="This is a test!";
            InitCommand=cmd(x,SCREEN_CENTER_X-(IconWidth/4)-64;y,SCREEN_TOP+(IconHeight/2)-28);
            BeginCommand=cmd(shadowlength,1);
        }; --]]
        -- Style Info Decorations
        Def.ActorFrame {
         InitCommand=cmd(y,80);
        -- Hack Y for Lazy!
            Def.Quad {
                InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_TOP+18;);
                BeginCommand=cmd(diffuse,color("#a8ffff");zoomto,IconWidth*0.8,1;fadeleft,0.25;faderight,0.25);
            };
            -- Style Top, Rad!~ --
            Def.Quad {
                InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_TOP+54;);
                BeginCommand=cmd(diffuse,color("#a8ffff");zoomto,IconWidth*0.8,1;fadeleft,0.25;faderight,0.25);
            };
            -- Style Text --
            Def.ActorFrame{
             -- Lazy Zoom
    --[[          GainFocusCommand=cmd(playcommandonchildren,"GainFocusChildren";);
             GainFocusChildrenCommand=cmd(finishtweening;zoomy,0;bounceend,0.4;zoomy,1); --]]
                -- Style Shadow --
                LoadFont("Regra Fill") .. {
                    Text=FriendlyGameName;
                    InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_TOP+36;shadowlength,0;);
                    BeginCommand=cmd(shadowlength,0;diffuse,0,0,0,1);
                };
                -- Style Fill --
                LoadFont("Regra Fill") .. {
                    Text=FriendlyGameName;
                    InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_TOP+34;shadowlength,0;);
                    BeginCommand=cmd(shadowlength,0;diffusetopedge,color("#00aeef");diffusebottomedge,color("#0054a6"));
                    GainFocusCommand=cmd(finishtweening;glow,1,1,1,1;decelerate,0.4;glow,1,1,1,0);
                };
                -- Style Inner Stroke --
                LoadFont("Regra Inner Glow") .. {
                    Text=FriendlyGameName;
                    InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_TOP+34;shadowlength,0;);
                    BeginCommand=cmd(shadowlength,0;diffusetopedge,color("#17c4ff");diffusebottomedge,color("#a8ffff"));
                    GainFocusCommand=cmd(finishtweening;glow,1,1,1,1;decelerate,0.4;glow,1,1,1,0);
                };
            };
            -- Style Information
            LoadFont("System") .. {
                Text=FriendlyStyleName;
                InitCommand=cmd(x,SCREEN_CENTER_X;y,math.ceil((IconHeight*0.8))+2);
                BeginCommand=cmd(shadowlength,0;wrapwidthpixels,IconWidth-26;maxheight,64);
            };
        };
    };
};

return t;