class 'l_09_Andreas_house_Z_Fathers_picture' (ZoomZone)

function l_09_Andreas_house_Z_Fathers_picture:__init(name, mode, PlayField)
	ZoomZone.__init(self, name, mode, PlayField)
	self:entityHide('zf_cap_2','zf_map','area_find_picture_part','area_click_cap')
	self.playfield:entityHide('casket_cap_2')
	
	local function on_apply_hair_comb(event)	
		self:entityHide(event.target)
		self:entityShow('area_click_cap')
		if not event.save then
			self:playSound('09_apply_haircomb')
		end
	
	end
	self:registerToolApplyInfo('08_hair_comb', 'area_apply_hair_comb', on_apply_hair_comb, 'BBT_09_NEED_HAIR_COMB')


	local function on_click_cap(event)
	    self:entityHide(event.target)
        self:entityShow('zf_cap_2','zf_map', 'zf_cube', 'area_find_cube')
        self.playfield:entityShow('casket_cap_2')
        self.playfield:entityHide('casket_cap_1')
        self:entityHide('zf_cap_1')
        if not event.save then 
	    	self:playSound('09_click_cap')
		    self:getEntityNamed('zf_cap_1'):ChangeOpacity(1, 0, 0.5)
		    self:getEntityNamed('zf_cap_2'):ChangeOpacity(0, 1, 0.5)
		    self:getEntityNamed('zf_map'):ChangeOpacity(0, 1, 0.5)  
		    self.playfield:getEntityNamed('casket_cap_1'):ChangeOpacity(1, 0, 0.5)
		    self.playfield:getEntityNamed('casket_cap_2'):ChangeOpacity(0, 1, 0.5)

		    self:playSound('09_open_box')
    	end
	end
	self:registerActiveObject('area_click_cap', on_click_cap)

	local function on_find_green_eye(event)
	    self:entityHide(event.target)
	    self:entityHide('zf_eye')

	    if not event.save then
	    	local node = path_manager:findNode(NodeType.SCENE, '06_Town')
	        if node then
	            node:setState(NodeState.ENABLED)
	        end
	    end
	end
	self:registerToolFindInfo('09_green_eye', 'area_find_green_eye', on_find_green_eye)	

	do
		local function picture_part(event)
		    self:entityHide(event.target)
		    if not event.save then
		    	self:playSound('08_take_picture_part')
		    end	
			self:closeAndDisable() 
		end
		self:registerToolFindInfo('09_treasure_picture_part_2', 'area_find_picture_part', picture_part)
	end

	do
		local function find_cube_btn(event)
		    self:entityHide(event.target, 'zf_cube')
		    self:entityShow(event.target, 'area_find_picture_part')

		    if not event.save then		    	
		    end	
		end
		self:registerToolFindInfo('09_remote_control_button', 'area_find_cube', find_cube_btn)
	end
end

--------------------------------------------------------------------------------
--                      GENERATED CONTENT. DO NOT EDIT.                       --
--------------------------------------------------------------------------------

function l_09_Andreas_house_Z_Fathers_picture:CreateLoaderTable()
	local objects =
	{
		{ name = 'zf_bg',  entityType = 'SpriteEntity',  x = 512,  y = 384,  order = 0,  editingLocked = false,  treeItemIsExpanded = true,  texturePath = 'Data/Textures/Scenes/09_Andreas_house/Z_Fathers_picture/zf_bg.jpg',  width = 640,  height = 480,  },
		{ name = 'zf_cap_1',  entityType = 'SpriteEntity',  x = 445,  y = 474,  order = 10,  editingLocked = false,  treeItemIsExpanded = false,  texturePath = 'Data/Textures/Scenes/09_Andreas_house/Z_Fathers_picture/zf_cap_1.png',  width = 504,  height = 298,  },
		{ name = 'zf_cap_2',  entityType = 'SpriteEntity',  x = 358,  y = 339,  order = 0,  editingLocked = false,  treeItemIsExpanded = false,  texturePath = 'Data/Textures/Scenes/09_Andreas_house/Z_Fathers_picture/zf_cap_2.png',  width = 332,  height = 292,  },
		{ name = 'zf_cube',  entityType = 'SpriteEntity',  x = 493,  y = 422,  order = 4,  editingLocked = false,  treeItemIsExpanded = false,  texturePath = 'Data/Textures/Scenes/09_Andreas_house/Z_Fathers_picture/zf_cube.png',  width = 122,  height = 84,  },
		{ name = 'zf_map',  entityType = 'SpriteEntity',  x = 434,  y = 434,  order = 2,  editingLocked = false,  treeItemIsExpanded = true,  hotSpot = {x = 89, y = 77},  texturePath = 'Data/Textures/Scenes/09_Andreas_house/Z_Fathers_picture/zf_map.png',  width = 178,  height = 154,  },
		{ name = 'area_find_picture_part',  entityType = 'SpriteEntity',  x = 416,  y = 418,  order = 20,  isVisible = false,  isRespondable = false,  angle = -32,  color = {r = 1, g = 1, b = 1, a = 0.00392157},  editingLocked = false,  treeItemIsExpanded = false,  width = 180,  height = 150,  },
		{ name = 'area_apply_hair_comb',  entityType = 'SpriteEntity',  x = 500.698,  y = 480.295,  order = 60,  angle = -27,  color = {r = 1, g = 1, b = 1, a = 0.00392157},  editingLocked = false,  treeItemIsExpanded = true,  hotSpot = {x = 43.9706, y = 38.579},  width = 88,  height = 77,  },
		{ name = 'zf_keyhole',  entityType = 'SpriteEntity',  x = 498,  y = 478,  order = 3,  editingLocked = false,  treeItemIsExpanded = false,  hotSpot = {x = 13, y = 25},  texturePath = 'Data/Textures/Scenes/09_Andreas_house/Z_Fathers_picture/zf_keyhole.png',  width = 26,  height = 50,  },
		{ name = 'area_click_cap',  entityType = 'SpriteEntity',  x = 442.341,  y = 396.435,  order = 60,  angle = -27,  color = {r = 1, g = 1, b = 1, a = 0.00392157},  editingLocked = false,  treeItemIsExpanded = true,  hotSpot = {x = 129.554, y = 60.1262},  width = 259,  height = 120,  },
		{ name = 'area_find_green_eye',  entityType = 'SpriteEntity',  x = 643,  y = 464,  order = 30,  color = {r = 1, g = 1, b = 1, a = 0.00392157},  editingLocked = false,  treeItemIsExpanded = false,  hotSpot = {x = 50, y = 50},  width = 100,  height = 100,  },
		{ name = 'zf_eye',  entityType = 'SpriteEntity',  x = 634,  y = 472,  order = 0,  editingLocked = false,  treeItemIsExpanded = false,  hotSpot = {x = 28.5, y = 27},  texturePath = 'Data/Textures/Scenes/09_Andreas_house/Z_Fathers_picture/zf_eye.png',  width = 57,  height = 54,  },
		{ name = 'area_find_cube',  entityType = 'SpriteEntity',  x = 416,  y = 418,  order = 20,  isVisible = false,  isRespondable = false,  angle = -32,  color = {r = 1, g = 1, b = 1, a = 0.00392157},  editingLocked = false,  treeItemIsExpanded = false,  width = 180,  height = 150,  },
	}
	return objects
end
