-- ActorFrame name, used for controlling the children from control actor (in FG).
local name = 'section3'

local base_param = ...
local sw,sh,scx,scy,songdir,rr,am,bt,hs,pe,hr,ease,wratio,hratio,paraph = base_param.sw,base_param.sh,base_param.scx,base_param.scy,base_param.songdir,base_param.rr,base_param.am,base_param.bt,base_param.hs,base_param.pe,base_param.hr,base_param.ease,base_param.wratio,base_param.hratio,base_param.paraph

-- Camera manipulation table
local Cameras = {
	Name=name,
	Tween={
		{6288, 'queuecommand', 'GetTexture1'},
		{6336, 'queuecommand', 'GetTexture2'},
		{6384, 'queuecommand', 'GetTexture3'},
		{6432, 'queuecommand', 'GetTexture4'},
		{6480, 'queuecommand', 'GetTexture5'},
		{6528, 'queuecommand', 'GetTexture6'},
		{6576, 'queuecommand', 'GetTexture7'},
		{7056, 'queuecommand', 'ResetCover'},
		{7056, 'queuecommand', 'GetTexture1'},
		{7104, 'queuecommand', 'GetTexture2'},
		{7152, 'queuecommand', 'GetTexture3'},
		{7200, 'queuecommand', 'GetTexture4'},
		{7248, 'queuecommand', 'GetTexture5'},
		{7296, 'queuecommand', 'GetTexture6'},
		{7344, 'queuecommand', 'GetTexture7'},
		{7824, 'queuecommand', 'ResetCover'},
		{7824, 'queuecommand', 'GetTexture1'},
		{7872, 'queuecommand', 'GetTexture2'},
		{7920, 'queuecommand', 'GetTexture3'},
		{7968, 'queuecommand', 'GetTexture4'},
		{8016, 'queuecommand', 'GetTexture5'},
		{8064, 'queuecommand', 'GetTexture6'},
		{8112, 'queuecommand', 'GetTexture7'},
		{8592, 'queuecommand', 'ResetCover'},
		{8592, 'zoomy', -1},
		{8592, 'queuecommand', 'GetTexture1'},
		{8640, 'queuecommand', 'GetTexture2'},
		{8688, 'queuecommand', 'GetTexture3'},
		{8736, 'queuecommand', 'GetTexture4'},
		{8784, 'queuecommand', 'GetTexture5'},
		{8832, 'queuecommand', 'GetTexture6'},
		{8880, 'queuecommand', 'GetTexture7'},
		{9360, 'queuecommand', 'ResetCover'},
		{9360, 'zoomy', 1},
		{9360, 'zoomx', -1},
		{9360, 'queuecommand', 'GetTexture1'},
		{9408, 'queuecommand', 'GetTexture2'},
		{9456, 'queuecommand', 'GetTexture3'},
		{9504, 'queuecommand', 'GetTexture4'},
		{9552, 'queuecommand', 'GetTexture5'},
		{9600, 'queuecommand', 'GetTexture6'},
		{9648, 'queuecommand', 'GetTexture7'},
		{10128, 'queuecommand', 'ResetCover'},
		{10128, 'zoomx', 1},
	}
}

-- Children manipulation table
local Actors = {
	Name=name,
	Tween={
		{'gimmick', 6336, 'setstate', 44},
		{'katkoi', 6336, 'queuecommand', 'Katkoi'},
		{'gimmick', 6384, 'setstate', 22},
		{'gimmick', 6432, 'setstate', 48},
		{'katkoi', 6432, 'queuecommand', 'Katkoi'},
		{'gimmick', 6480, 'setstate', 18},
		{'gimmick', 6528, 'setstate', 38},
		{'katkoi', 6528, 'queuecommand', 'Katkoi'},
		{'gimmick', 6576, 'setstate', 20},
		{'gimmick', 6624, 'setstate', 72},
		{'katkoi', 6624, 'queuecommand', 'Katkoi'},
		{'gimmick', 6672, 'setstate', 16},
		{'cover1', 6672, 'diffusealpha', 0},
		{'cover2', 6672, 'diffusealpha', 0},
		{'cover3', 6672, 'diffusealpha', 0},
		{'cover4', 6672, 'diffusealpha', 0},
		{'cover5', 6672, 'diffusealpha', 0},
		{'cover6', 6672, 'diffusealpha', 0},
		{'cover7', 6672, 'diffusealpha', 0},
		{'invert', 6672, 'diffusealpha', 0},
		{'gimmick', 6720, 'setstate', 44},
		{'katkoi', 6720, 'queuecommand', 'Katkoi'},
		{'cover1', 6720, 'diffusealpha', 1},
		{'gimmick', 6768, 'setstate', 22},
		{'cover2', 6768, 'diffusealpha', 1},
		{'gimmick', 6816, 'setstate', 48},
		{'katkoi', 6816, 'queuecommand', 'Katkoi'},
		{'cover3', 6816, 'diffusealpha', 1},
		{'gimmick', 6864, 'setstate', 18},
		{'cover4', 6864, 'diffusealpha', 1},
		{'gimmick', 6912, 'setstate', 38},
		{'katkoi', 6912, 'queuecommand', 'Katkoi'},
		{'cover5', 6912, 'diffusealpha', 1},
		{'gimmick', 6960, 'setstate', 20},
		{'cover6', 6960, 'diffusealpha', 1},
		{'gimmick', 7008, 'setstate', 72},
		{'katkoi', 7008, 'queuecommand', 'Katkoi'},
		{'cover7', 7008, 'diffusealpha', 1},
		{'gimmick', 7056, 'setstate', 16},
		{'invert', 7056, 'diffusealpha', 1},
		{'gimmick', 7104, 'setstate', 44},
		{'katkoi', 7104, 'queuecommand', 'Katkoi'},
		{'gimmick', 7152, 'setstate', 22},
		{'gimmick', 7200, 'setstate', 48},
		{'katkoi', 7200, 'queuecommand', 'Katkoi'},
		{'gimmick', 7248, 'setstate', 18},
		{'gimmick', 7296, 'setstate', 38},
		{'katkoi', 7296, 'queuecommand', 'Katkoi'},
		{'gimmick', 7344, 'setstate', 20},
		{'gimmick', 7392, 'setstate', 72},
		{'katkoi', 7392, 'queuecommand', 'Katkoi'},
		{'gimmick', 7440, 'setstate', 16},
		{'cover1', 7440, 'diffusealpha', 0},
		{'cover2', 7440, 'diffusealpha', 0},
		{'cover3', 7440, 'diffusealpha', 0},
		{'cover4', 7440, 'diffusealpha', 0},
		{'cover5', 7440, 'diffusealpha', 0},
		{'cover6', 7440, 'diffusealpha', 0},
		{'cover7', 7440, 'diffusealpha', 0},
		{'invert', 7440, 'diffusealpha', 0},
		{'G', 7440, 'x', 128*3},
		{'i', 7440, 'x', 128*2},
		{'M', 7440, 'x', 128*1},
		{'m', 7440, 'x', 0},
		{'I', 7440, 'x', 128*-1},
		{'c', 7440, 'x', 128*-2},
		{'K', 7440, 'x', 128*-3},
		{'gimmick', 7488, 'setstate', 44},
		{'katkoi', 7488, 'queuecommand', 'Katkoi'},
		{'cover7', 7488, 'diffusealpha', 1},
		{'gimmick', 7536, 'setstate', 22},
		{'cover6', 7536, 'diffusealpha', 1},
		{'gimmick', 7584, 'setstate', 48},
		{'katkoi', 7584, 'queuecommand', 'Katkoi'},
		{'cover5', 7584, 'diffusealpha', 1},
		{'gimmick', 7632, 'setstate', 18},
		{'cover4', 7632, 'diffusealpha', 1},
		{'gimmick', 7680, 'setstate', 38},
		{'katkoi', 7680, 'queuecommand', 'Katkoi'},
		{'cover3', 7680, 'diffusealpha', 1},
		{'gimmick', 7728, 'setstate', 20},
		{'cover2', 7728, 'diffusealpha', 1},
		{'gimmick', 7776, 'setstate', 72},
		{'katkoi', 7776, 'queuecommand', 'Katkoi'},
		{'cover1', 7776, 'diffusealpha', 1},
		{'gimmick', 7824, 'setstate', 16},
		{'invert', 7824, 'diffusealpha', 1},
		{'gimmick', 7872, 'setstate', 44},
		{'katkoi', 7872, 'queuecommand', 'Katkoi'},
		{'gimmick', 7920, 'setstate', 22},
		{'gimmick', 7968, 'setstate', 48},
		{'katkoi', 7968, 'queuecommand', 'Katkoi'},
		{'gimmick', 8016, 'setstate', 18},
		{'gimmick', 8064, 'setstate', 38},
		{'katkoi', 8064, 'queuecommand', 'Katkoi'},
		{'gimmick', 8112, 'setstate', 20},
		{'gimmick', 8160, 'setstate', 72},
		{'katkoi', 8160, 'queuecommand', 'Katkoi'},
		{'gimmick', 8208, 'setstate', 16},
		{'cover1', 8208, 'diffusealpha', 0},
		{'cover2', 8208, 'diffusealpha', 0},
		{'cover3', 8208, 'diffusealpha', 0},
		{'cover4', 8208, 'diffusealpha', 0},
		{'cover5', 8208, 'diffusealpha', 0},
		{'cover6', 8208, 'diffusealpha', 0},
		{'cover7', 8208, 'diffusealpha', 0},
		{'invert', 8208, 'diffusealpha', 0},
		{'G', 8208, 'x', 128*-3},
		{'i', 8208, 'x', 128*-1},
		{'M', 8208, 'x', 128*1},
		{'m', 8208, 'x', 128*3},
		{'I', 8208, 'x', 128*-2},
		{'c', 8208, 'x', 128*0},
		{'K', 8208, 'x', 128*2},
		{'gimmick', 8256, 'setstate', 44},
		{'katkoi', 8256, 'queuecommand', 'Katkoi'},
		{'cover1', 8256, 'diffusealpha', 1},
		{'gimmick', 8304, 'setstate', 22},
		{'cover3', 8304, 'diffusealpha', 1},
		{'gimmick', 8352, 'setstate', 48},
		{'katkoi', 8352, 'queuecommand', 'Katkoi'},
		{'cover5', 8352, 'diffusealpha', 1},
		{'gimmick', 8400, 'setstate', 18},
		{'cover7', 8400, 'diffusealpha', 1},
		{'gimmick', 8448, 'setstate', 38},
		{'katkoi', 8448, 'queuecommand', 'Katkoi'},
		{'cover2', 8448, 'diffusealpha', 1},
		{'gimmick', 8496, 'setstate', 20},
		{'cover4', 8496, 'diffusealpha', 1},
		{'gimmick', 8544, 'setstate', 72},
		{'katkoi', 8544, 'queuecommand', 'Katkoi'},
		{'cover6', 8544, 'diffusealpha', 1},
		{'gimmick', 8592, 'setstate', 16},
		{'invert', 8592, 'diffusealpha', 1},
		{'gimmick', 8640, 'setstate', 44},
		{'katkoi', 8640, 'queuecommand', 'Katkoi'},
		{'gimmick', 8688, 'setstate', 22},
		{'gimmick', 8736, 'setstate', 48},
		{'katkoi', 8736, 'queuecommand', 'Katkoi'},
		{'gimmick', 8784, 'setstate', 18},
		{'gimmick', 8832, 'setstate', 38},
		{'katkoi', 8832, 'queuecommand', 'Katkoi'},
		{'gimmick', 8880, 'setstate', 20},
		{'gimmick', 8928, 'setstate', 72},
		{'katkoi', 8928, 'queuecommand', 'Katkoi'},
		{'gimmick', 8976, 'setstate', 16},
		{'cover1', 8976, 'diffusealpha', 0},
		{'cover2', 8976, 'diffusealpha', 0},
		{'cover3', 8976, 'diffusealpha', 0},
		{'cover4', 8976, 'diffusealpha', 0},
		{'cover5', 8976, 'diffusealpha', 0},
		{'cover6', 8976, 'diffusealpha', 0},
		{'cover7', 8976, 'diffusealpha', 0},
		{'invert', 8976, 'diffusealpha', 0},
		{'G', 8976, 'x', 128*0},
		{'i', 8976, 'x', 128*-3},
		{'M', 8976, 'x', 128*1},
		{'m', 8976, 'x', 128*-2},
		{'I', 8976, 'x', 128*2},
		{'c', 8976, 'x', 128*-1},
		{'K', 8976, 'x', 128*3},
		{'gimmick', 9024, 'setstate', 44},
		{'katkoi', 9024, 'queuecommand', 'Katkoi'},
		{'cover4', 9024, 'diffusealpha', 1},
		{'gimmick', 9072, 'setstate', 22},
		{'cover1', 9072, 'diffusealpha', 1},
		{'gimmick', 9120, 'setstate', 48},
		{'katkoi', 9120, 'queuecommand', 'Katkoi'},
		{'cover5', 9120, 'diffusealpha', 1},
		{'gimmick', 9168, 'setstate', 18},
		{'cover2', 9168, 'diffusealpha', 1},
		{'gimmick', 9216, 'setstate', 38},
		{'katkoi', 9216, 'queuecommand', 'Katkoi'},
		{'cover6', 9216, 'diffusealpha', 1},
		{'gimmick', 9264, 'setstate', 20},
		{'cover3', 9264, 'diffusealpha', 1},
		{'gimmick', 9312, 'setstate', 72},
		{'katkoi', 9312, 'queuecommand', 'Katkoi'},
		{'cover7', 9312, 'diffusealpha', 1},
		{'gimmick', 9360, 'setstate', 16},
		{'invert', 9360, 'diffusealpha', 1},
		{'gimmick', 9408, 'setstate', 44},
		{'katkoi', 9408, 'queuecommand', 'Katkoi'},
		{'gimmick', 9456, 'setstate', 22},
		{'gimmick', 9504, 'setstate', 48},
		{'katkoi', 9504, 'queuecommand', 'Katkoi'},
		{'gimmick', 9552, 'setstate', 18},
		{'gimmick', 9600, 'setstate', 38},
		{'katkoi', 9600, 'queuecommand', 'Katkoi'},
		{'gimmick', 9648, 'setstate', 20},
		{'gimmick', 9696, 'setstate', 72},
		{'katkoi', 9696, 'queuecommand', 'Katkoi'},
		{'gimmick', 9744, 'setstate', 16},
		{'cover1', 9744, 'diffusealpha', 0},
		{'cover2', 9744, 'diffusealpha', 0},
		{'cover3', 9744, 'diffusealpha', 0},
		{'cover4', 9744, 'diffusealpha', 0},
		{'cover5', 9744, 'diffusealpha', 0},
		{'cover6', 9744, 'diffusealpha', 0},
		{'cover7', 9744, 'diffusealpha', 0},
		{'invert', 9744, 'diffusealpha', 0},
		{'G', 9744, 'x', 128*3},
		{'i', 9744, 'x', 128*-1},
		{'M', 9744, 'x', 128*1},
		{'m', 9744, 'x', 128*-2},
		{'I', 9744, 'x', 128*2},
		{'c', 9744, 'x', 128*0},
		{'K', 9744, 'x', 128*-3},
		{'gimmick', 9792, 'setstate', 44},
		{'katkoi', 9792, 'queuecommand', 'Katkoi'},
		{'cover7', 9792, 'diffusealpha', 1},
		{'gimmick', 9840, 'setstate', 22},
		{'cover3', 9840, 'diffusealpha', 1},
		{'gimmick', 9888, 'setstate', 48},
		{'katkoi', 9888, 'queuecommand', 'Katkoi'},
		{'cover5', 9888, 'diffusealpha', 1},
		{'gimmick', 9936, 'setstate', 18},
		{'cover2', 9936, 'diffusealpha', 1},
		{'gimmick', 9984, 'setstate', 38},
		{'katkoi', 9984, 'queuecommand', 'Katkoi'},
		{'cover6', 9984, 'diffusealpha', 1},
		{'gimmick', 10032, 'setstate', 20},
		{'cover4', 10032, 'diffusealpha', 1},
		{'gimmick', 10080, 'setstate', 72},
		{'katkoi', 10080, 'queuecommand', 'Katkoi'},
		{'cover1', 10080, 'diffusealpha', 1},
		{'invert', 10128, 'diffusealpha', 1},
		{'G', 10128, 'diffusealpha', 0},
		{'i', 10128, 'diffusealpha', 0},
		{'M', 10128, 'diffusealpha', 0},
		{'m', 10128, 'diffusealpha', 0},
		{'I', 10128, 'diffusealpha', 0},
		{'c', 10128, 'diffusealpha', 0},
		{'K', 10128, 'diffusealpha', 0},
	}
}

local Players = {
	Tween={
	}
}

-- Shortcut to the 'FG' ActorFrame.
local FG

local uv1 = pe[2] and {(427-155)/854*wratio, 288/720*hratio} or {(427-87)/854*wratio, 288/720*hratio}
local uv2 = pe[2] and {(427+87)/854*wratio, 288/720*hratio} or {(427+155)/854*wratio, 288/720*hratio}

-- We can use "InitializeCommand" instead of usual "OnCommand", which is executed on the beginning of section.
-- This reduces that ridiculously large frame drop on beat 0.
return Def.ActorFrame{
Name=name,
InitCommand=function(self) FG = self:GetParent():GetParent() self:visible(false):zbuffer(1) end,
InitializeCommand=function(self)
	local c = FG:GetChild('Cameras')
	local a = FG:GetChild('Actors')
--	local plt = a[1].Tween
--	for i = 1, #Players do
--		plt[#plt+1] = Players[i]
--	end
	c[#c+1] = Cameras
	a[#a+1] = Actors
	self:fov(90)
	for i = 1, 2 do
		GAMESTATE:GetPlayerState(i-1):GetPlayerOptions('ModsLevel_Song'):FromString('*100000 3x, *100000 50% stealth')
	end
	-- Adjust the position of NoteField
	FG:GetChild('PlayerAFTorig'):GetChild('Player'):addy(PREFSMAN:GetPreference('VisualDelaySeconds')/(bt*GAMESTATE:GetSongOptionsObject('ModsLevel_Song'):MusicRate())*288)
	FG:GetChild('PlayerOrig'):GetChild('Combo'):visible(false)
	FG:GetChild('PlayerOrig'):GetChild('Judgment'):visible(false)
end,

loadfile(songdir..'fg/section3/AFT.lua')(base_param)..{Name='AFT1', GetTexture1Command=function(self) self:visible(false) end},
loadfile(songdir..'fg/section3/AFT.lua')(base_param)..{Name='AFT2', GetTexture2Command=function(self) self:visible(false) end},
loadfile(songdir..'fg/section3/AFT.lua')(base_param)..{Name='AFT3', GetTexture3Command=function(self) self:visible(false) end},
loadfile(songdir..'fg/section3/AFT.lua')(base_param)..{Name='AFT4', GetTexture4Command=function(self) self:visible(false) end},
loadfile(songdir..'fg/section3/AFT.lua')(base_param)..{Name='AFT5', GetTexture5Command=function(self) self:visible(false) end},
loadfile(songdir..'fg/section3/AFT.lua')(base_param)..{Name='AFT6', GetTexture6Command=function(self) self:visible(false) end},
loadfile(songdir..'fg/section3/AFT.lua')(base_param)..{Name='AFT7', GetTexture7Command=function(self) self:visible(false) end},

paraph.BitmapText('G',{Color={0,0,0,1},Size=128})..{
	Name='G',
	InitializeCommand=function(self) self:xy(-128*3,64) end,
	ResetCoverCommand=function(self) self:xy(-128*3,64) end,
},
paraph.BitmapText('i',{Color={0.6,0.4,0,1},Size=128})..{
	Name='i',
	InitializeCommand=function(self) self:xy(-128*2,64) end,
	ResetCoverCommand=function(self) self:xy(-128*2,64) end,
},
paraph.BitmapText('M',{Color={0,0,0,1},Size=128})..{
	Name='M',
	InitializeCommand=function(self) self:xy(-128*1,64) end,
	ResetCoverCommand=function(self) self:xy(-128*1,64) end,
},
paraph.BitmapText('m',{Color={0.6,0.4,0,1},Size=128})..{
	Name='m',
	InitializeCommand=function(self) self:xy( 128*0,64) end,
	ResetCoverCommand=function(self) self:xy( 128*0,64) end,
},
paraph.BitmapText('I',{Color={0,0,0,1},Size=128})..{
	Name='I',
	InitializeCommand=function(self) self:xy( 128*1,64) end,
	ResetCoverCommand=function(self) self:xy( 128*1,64) end,
},
paraph.BitmapText('c',{Color={0.6,0.4,0,1},Size=128})..{
	Name='c',
	InitializeCommand=function(self) self:xy( 128*2,64) end,
	ResetCoverCommand=function(self) self:xy( 128*2,64) end,
},
paraph.BitmapText('K',{Color={0,0,0,1},Size=128})..{
	Name='K',
	InitializeCommand=function(self) self:xy( 128*3,64) end,
	ResetCoverCommand=function(self) self:xy( 128*3,64) end,
},

paraph.AMVQuad({Width=128*7,Height=0,uv1=uv1,uv2=uv2})..{
	Name='cover1',
	InitializeCommand=function(self) self:SetTexture(self:GetParent():GetChild('AFT1'):GetTexture()):y(-8) end,
	GetTexture1Command=function(self)
		self:accelerate(bt)
		self:SetVertex(3, {{ 448,136,0},{1,1,1,1},uv2})
		self:SetVertex(4, {{-448,136,0},{1,1,1,1},uv1})
	end,
	ResetCoverCommand=function(self)
		self:x(0)
		self:SetVertex(3, {{ 448,0,0},{1,1,1,1},uv2})
		self:SetVertex(4, {{-448,0,0},{1,1,1,1},uv1})
	end,
},
paraph.AMVQuad({Width=128*7,Height=0,uv1=uv1,uv2=uv2})..{
	Name='cover2',
	InitializeCommand=function(self) self:SetTexture(self:GetParent():GetChild('AFT2'):GetTexture()):y(-8) end,
	GetTexture2Command=function(self)
		self:accelerate(bt)
		self:SetVertex(3, {{ 448,136,0},{1,1,1,1},uv2})
		self:SetVertex(4, {{-448,136,0},{1,1,1,1},uv1})
	end,
	ResetCoverCommand=function(self)
		self:x(0)
		self:SetVertex(3, {{ 448,0,0},{1,1,1,1},uv2})
		self:SetVertex(4, {{-448,0,0},{1,1,1,1},uv1})
	end,
},
paraph.AMVQuad({Width=128*7,Height=0,uv1=uv1,uv2=uv2})..{
	Name='cover3',
	InitializeCommand=function(self) self:SetTexture(self:GetParent():GetChild('AFT3'):GetTexture()):y(-8) end,
	GetTexture3Command=function(self)
		self:accelerate(bt)
		self:SetVertex(3, {{ 448,136,0},{1,1,1,1},uv2})
		self:SetVertex(4, {{-448,136,0},{1,1,1,1},uv1})
	end,
	ResetCoverCommand=function(self)
		self:x(0)
		self:SetVertex(3, {{ 448,0,0},{1,1,1,1},uv2})
		self:SetVertex(4, {{-448,0,0},{1,1,1,1},uv1})
	end,
},
paraph.AMVQuad({Width=128*7,Height=0,uv1=uv1,uv2=uv2})..{
	Name='cover4',
	InitializeCommand=function(self) self:SetTexture(self:GetParent():GetChild('AFT4'):GetTexture()):y(-8) end,
	GetTexture4Command=function(self)
		self:accelerate(bt)
		self:SetVertex(3, {{ 448,136,0},{1,1,1,1},uv2})
		self:SetVertex(4, {{-448,136,0},{1,1,1,1},uv1})
	end,
	ResetCoverCommand=function(self)
		self:x(0)
		self:SetVertex(3, {{ 448,0,0},{1,1,1,1},uv2})
		self:SetVertex(4, {{-448,0,0},{1,1,1,1},uv1})
	end,
},
paraph.AMVQuad({Width=128*7,Height=0,uv1=uv1,uv2=uv2})..{
	Name='cover5',
	InitializeCommand=function(self) self:SetTexture(self:GetParent():GetChild('AFT5'):GetTexture()):y(-8) end,
	GetTexture5Command=function(self)
		self:accelerate(bt)
		self:SetVertex(3, {{ 448,136,0},{1,1,1,1},uv2})
		self:SetVertex(4, {{-448,136,0},{1,1,1,1},uv1})
	end,
	ResetCoverCommand=function(self)
		self:x(0)
		self:SetVertex(3, {{ 448,0,0},{1,1,1,1},uv2})
		self:SetVertex(4, {{-448,0,0},{1,1,1,1},uv1})
	end,
},
paraph.AMVQuad({Width=128*7,Height=0,uv1=uv1,uv2=uv2})..{
	Name='cover6',
	InitializeCommand=function(self) self:SetTexture(self:GetParent():GetChild('AFT6'):GetTexture()):y(-8) end,
	GetTexture6Command=function(self)
		self:accelerate(bt)
		self:SetVertex(3, {{ 448,136,0},{1,1,1,1},uv2})
		self:SetVertex(4, {{-448,136,0},{1,1,1,1},uv1})
	end,
	ResetCoverCommand=function(self)
		self:x(0)
		self:SetVertex(3, {{ 448,0,0},{1,1,1,1},uv2})
		self:SetVertex(4, {{-448,0,0},{1,1,1,1},uv1})
	end,
},
paraph.AMVQuad({Width=128*7,Height=0,uv1=uv1,uv2=uv2})..{
	Name='cover7',
	InitializeCommand=function(self) self:SetTexture(self:GetParent():GetChild('AFT7'):GetTexture()):y(-8) end,
	GetTexture7Command=function(self)
		self:accelerate(bt)
		self:SetVertex(3, {{ 448,136,0},{1,1,1,1},uv2})
		self:SetVertex(4, {{-448,136,0},{1,1,1,1},uv1})
	end,
	ResetCoverCommand=function(self)
		self:x(0)
		self:SetVertex(3, {{ 448,0,0},{1,1,1,1},uv2})
		self:SetVertex(4, {{-448,0,0},{1,1,1,1},uv1})
	end,
},
Def.ActorFrame{
	Name='katkoi',
	Def.Quad{
		InitializeCommand=function(self)
			self:zoomto(128*7,3):diffuse(0,0,0,0.5):cropleft(1):y(160)
		end,
		KatkoiCommand=function(self)
			self:accelerate(bt/2):cropleft(0):sleep(bt/4):decelerate(bt/2):cropright(1)
			self:linear(0):cropleft(1):cropright(0)
		end,
	},
	Def.Quad{
		InitializeCommand=function(self)
			self:zoomto(128*7,3):diffuse(0,0,0,0.5):cropright(1):y(-32)
		end,
		KatkoiCommand=function(self)
			self:accelerate(bt/2):cropright(0):sleep(bt/4):decelerate(bt/2):cropleft(1)
			self:linear(0):cropright(1):cropleft(0)
		end,
	},
},
paraph.BitmapText('#GOTO', {Name='GOTO', Size=32, Color={0,0,0,1}, Align='left'})..{
	InitializeCommand=function(self) self:xy(-scx+16,-scy+32) end,
},
Def.Sprite{
	Name='gimmick',
	Texture=songdir..'fg/texture/_Consolas',
	InitializeCommand=function(self)
		self:zoom(32/64):xy(-scx+16+22*7,-scy+32):diffuse(0,0,0,1)
		self:animate(0):setstate(16)
	end,
},
Def.ActorProxy{
	Name='Combo',
	InitializeCommand=function(self)
		for i = 1, 2 do
			if pe[i] then
				local zoom = 1.5
				zoom = SCREENMAN:GetTopScreen():GetChild('PlayerP'..i):GetZoom()
				self:zoom(zoom):addy(-scy/2)
				self:SetTarget(SCREENMAN:GetTopScreen():GetChild('PlayerP'..i):GetChild('Combo')):visible(true)
			end
		end
	end,
},
Def.ActorProxy{
	Name='Judgment',
	InitializeCommand=function(self)
		for i = 1, 2 do
			if pe[i] then
				local zoom = 1.5
				zoom = SCREENMAN:GetTopScreen():GetChild('PlayerP'..i):GetZoom()
				self:zoom(zoom):addy(-scy/2)
				self:SetTarget(SCREENMAN:GetTopScreen():GetChild('PlayerP'..i):GetChild('Judgment')):visible(true)
			end
		end
	end,
},
Def.Quad{
	Name='invert',
	InitializeCommand=function(self) self:zoomto(sw,sh):diffuse(1,1,1,1):blend('BlendMode_InvertDest') end,
},

}