move_mouse_by_path_scene04 = {}

move_mouse_by_path_scene04.params = {}

move_mouse_by_path_scene04.params2 = 
{
	-- если true, то 
	--	нажать-отпустить левую кнопку мыши, и затем вести по кривой
	-- иначе
	-- 	нажал левую кнопку мыши и вести по кривой
	easy = true, 
	
	start_area = 
	{
		pos = sf.misc.FloatVector(367.0, 92.0), 
		radius = 20
	},
	
	finish_area = 
	{
		pos = sf.misc.FloatVector(178.0, 131.0), 
		radius = 6.0
	},
	
	colors = 
	{
		normal = sf.graphics.Color(255,255,255,255), 
		in_area = sf.graphics.Color(255,0,128,0), 
		out_area = sf.graphics.Color(255,255,0,0)
	},
	
	time_after_failed = 500,
	
	sound_start_move = "start_click"
}

move_mouse_by_path_scene04.params1 = 
{
	-- если true, то 
	--	нажать-отпустить левую кнопку мыши, и затем вести по кривой
	-- иначе
	-- 	нажал левую кнопку мыши и вести по кривой
	easy = true, 
	
	start_area = 
	{
		pos = sf.misc.FloatVector(44.0, 345.0), 
		radius = 16
	},
	
	finish_area = 
	{
		pos = sf.misc.FloatVector(351.0, 355.0), 
		radius = 10.0
	},
	
	colors = 
	{
		normal = sf.graphics.Color(255,255,255,255), 
		in_area = sf.graphics.Color(255,0,128,0), 
		out_area = sf.graphics.Color(255,255,0,0)
	},
	
	time_after_failed = 500,
	
	sound_start_move = "start_click"
}

function move_mouse_by_path_scene04._HideImages(_owner)
	local iterator = _owner.GetWidgets()
    while iterator.IsEnd() == false do
		if string.find(iterator.Get().GetId().c_str(), "alpha") == 1 or string.find(iterator.Get().GetId().c_str(), "path") == 1 then
			iterator.Get().AddFlags(sf.gui.CWidget.FlagHidden)
		end
        iterator.Next()
    end

end

function move_mouse_by_path_scene04._Init(_owner, _num)	
	move_mouse_by_path_scene04._HideImages(_owner)
	
	move_mouse_by_path.SetParams(move_mouse_by_path_scene04["params".._num])
	
	move_mouse_by_path.alpha_image = __cast(_owner.GetWidget(_T("alpha".._num), true), sf.gui.CImageWidget)
	assert(move_mouse_by_path.alpha_image)
	
	move_mouse_by_path.path_image = __cast(_owner.GetWidget(_T("path".._num), true), sf.gui.CImageWidget)
	assert(move_mouse_by_path.path_image)	
	move_mouse_by_path.path_image.RemFlags(sf.gui.CWidget.FlagHidden)
	
	move_mouse_by_path._Init(_owner)	
end

function move_mouse_by_path_scene04.Init(_owner)
	move_mouse_by_path.SetFuncCheckEnd(move_mouse_by_path_scene04.CheckEnd)
	move_mouse_by_path_scene04.current_minigame = 1
	move_mouse_by_path_scene04.total_minigames = 2
	move_mouse_by_path_scene04._Init(_owner, move_mouse_by_path_scene04.current_minigame)	
end

function move_mouse_by_path_scene04.CheckEnd(_owner)
	if move_mouse_by_path_scene04.current_minigame < move_mouse_by_path_scene04.total_minigames then
		move_mouse_by_path_scene04.current_minigame = move_mouse_by_path_scene04.current_minigame + 1
		move_mouse_by_path_scene04._Init(_owner, move_mouse_by_path_scene04.current_minigame)	
	else
		move_mouse_by_path._CheckEnd(_owner)
	end
end

if move_mouse_by_path then
	for p,v in pairs(move_mouse_by_path) do
		if not move_mouse_by_path_scene04[p] then move_mouse_by_path_scene04[p] = v end
	end
end
