class 'l_08_Lauras_room_Z_Table_pillow' (ZoomZone)

function l_08_Lauras_room_Z_Table_pillow:__init(name, mode, PlayField)
	ZoomZone.__init(self, name, mode, PlayField)
	self:entityHide('zt_diary_open','area_find_flyNote')
	--self:entityHide('area_click_diary')

	local function on_click_diary(event)
	    self:entityHide(event.target)
        self:entityShow('zt_diary_open','area_find_flyNote')
        self:entityHide('zt_diary')
	    if not event.save then 
		    self:getEntityNamed('zt_diary'):ChangeOpacity(1, 0, 0.5)
		    self:getEntityNamed('zt_diary_open'):ChangeOpacity(0, 1, 0.5)
		end
	end
	self:registerActiveObject('area_click_diary', on_click_diary)
    
    local function on_find_flyNote(event)    	
    	SetGameState('08_FlyNote_Diary_founded', 'true')
	    self:entityHide(event.target, 'zt_diary_open')

	    if not event.save then    	
	         self.playfield:addFlyNote('Note_08_Diary', event.save, 'Layer_08_Diary', true, nil, nil, Vector2f(0.5, 0.5), on_take_note)
	   	else 
	  	end
		if IsToolFound('08_hair_comb') then self:closeAndDisable() end
	end
		self:registerActiveObject('area_find_flyNote', on_find_flyNote)
	
	local function on_find_wig(event)    	

	    self:entityHide(event.target)
	    self:entityHide('zt_wig')
	    self.playfield:entityHide('wig_1')
	    if not event.save then    	
	    	  -- actionScreen
	  		  self.playfield.action:incrementActionBar(10)
	  		  ----------------------------------------------------------
	   	else 
	  	end

		if IsToolFound('08_pillow') then 
		-- 	self:closeAndDisable()
		end
	end
	self:registerToolFindInfo('08_wig', 'area_find_wig', on_find_wig)

	local function on_find_pillow(event)
	    self:entityHide(event.target)
	    self:entityHide('zt_pillow')
	    if not event.save then
	    	-- actionScreen
	    	self.playfield.action:incrementActionBar(10)
	    	----------------------------------------------------------
	    	
	    	self:getEntityNamed('zt_pillow'):ChangeOpacity(1, 0, 0.5)
	    	self.playfield:getEntityNamed('pillow_on_chair'):ChangeOpacity(1, 0, 0.5)
	    else
	   		self.playfield:getEntityNamed('pillow_on_chair'):hide()
	    		
		end
		if IsToolFound('08_wig') then  
		--	self:closeAndDisable() 
		end
	end
	self:registerToolFindInfo('08_pillow', 'area_find_pillow', on_find_pillow)
end

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

function l_08_Lauras_room_Z_Table_pillow:CreateLoaderTable()
	local objects =
	{
		{ name = 'zt_bg',  entityType = 'SpriteEntity',  x = 512,  y = 384,  order = 0,  editingLocked = false,  treeItemIsExpanded = true,  texturePath = 'Data/Textures/Scenes/08_Lauras_room/Z_Table_pillow/zt_bg.jpg',  width = 384,  height = 512,  },
		{ name = 'zt_pillow',  entityType = 'SpriteEntity',  x = 475,  y = 550,  order = 1,  editingLocked = false,  treeItemIsExpanded = false,  texturePath = 'Data/Textures/Scenes/08_Lauras_room/Z_Table_pillow/zt_pillow.png',  width = 254,  height = 178,  },
		{ name = 'zt_diary',  entityType = 'SpriteEntity',  x = 544,  y = 422,  order = 3,  editingLocked = false,  treeItemIsExpanded = true,  texturePath = 'Data/Textures/Scenes/08_Lauras_room/Z_Table_pillow/zt_diary.png',  width = 150,  height = 120,  },
		{ name = 'zt_tools',  entityType = 'SpriteEntity',  x = 510,  y = 399,  order = 3,  editingLocked = false,  treeItemIsExpanded = true,  texturePath = 'Data/Textures/Scenes/08_Lauras_room/Z_Table_pillow/zt_tools.png',  width = 372,  height = 344,  },
		{ name = 'zt_diary_open',  entityType = 'SpriteEntity',  x = 520,  y = 434,  order = 5,  editingLocked = false,  treeItemIsExpanded = false,  texturePath = 'Data/Textures/Scenes/08_Lauras_room/Z_Table_pillow/zt_diary_open.png',  width = 212,  height = 156,  },
		{ name = 'area_click_diary',  entityType = 'SpriteEntity',  x = 534,  y = 410,  order = 20,  angle = -17,  color = {r = 1, g = 1, b = 1, a = 0.00392157},  editingLocked = false,  treeItemIsExpanded = true,  width = 100,  height = 130,  },
		{ name = 'area_find_pillow',  entityType = 'SpriteEntity',  x = 458,  y = 543,  order = 20,  angle = 12,  color = {r = 1, g = 1, b = 1, a = 0.00392157},  editingLocked = false,  treeItemIsExpanded = true,  width = 200,  height = 150,  },
		{ name = 'area_find_flyNote',  entityType = 'SpriteEntity',  x = 505.32,  y = 422.203,  order = 20,  angle = -20,  color = {r = 1, g = 1, b = 1, a = 0.00392157},  editingLocked = false,  treeItemIsExpanded = true,  hotSpot = {x = 74.8224, y = 44.1237},  width = 150,  height = 88,  },
		{ name = 'zt_wig_stand',  entityType = 'SpriteEntity',  x = 648,  y = 313,  order = 0,  editingLocked = false,  treeItemIsExpanded = false,  texturePath = 'Data/Textures/Scenes/08_Lauras_room/Z_Table_pillow/zt_wig_stand.png',  width = 110,  height = 250,  },
		{ name = 'zt_wig',  entityType = 'SpriteEntity',  x = 629,  y = 352,  order = 6,  editingLocked = false,  treeItemIsExpanded = false,  texturePath = 'Data/Textures/Scenes/08_Lauras_room/Z_Table_pillow/zt_wig.png',  width = 146,  height = 282,  },
		{ name = 'area_find_wig',  entityType = 'SpriteEntity',  x = 628.002,  y = 367.001,  order = 20,  color = {r = 1, g = 1, b = 1, a = 0.00392157},  editingLocked = false,  treeItemIsExpanded = true,  width = 150,  height = 200,  },
		{ name = 'area_zoom_Hipo',  entityType = 'SpriteEntity',  x = 476,  y = 315,  order = 60,  color = {r = 1, g = 1, b = 1, a = 0.00392157},  editingLocked = false,  treeItemIsExpanded = false,  hotSpot = {x = 50, y = 50},  width = 100,  height = 100,  },
		{ name = 'zt_hipo_close',  entityType = 'SpriteEntity',  x = 453,  y = 299,  order = 4,  editingLocked = false,  treeItemIsExpanded = false,  hotSpot = {x = 62.5, y = 30.5},  texturePath = 'Data/Textures/Scenes/08_Lauras_room/Z_Table_pillow/zt_hipo_close.png',  width = 125,  height = 61,  },
	}
	return objects
end
