class 'l_07_Cantellos_shop_Z_Old_rock' (ZoomZone)

function l_07_Cantellos_shop_Z_Old_rock:__init(name, mode, PlayField)
	ZoomZone.__init(self, name, mode, PlayField)

	self:entityHide('zo_book_2','area_find_flint','area_find_note_1')

	-- -- click book--------------------------------------------------------------
	do
		local function click_on_click_book(event)
			self:entityHide('area_click_book')	
			self:entityShow('zo_book_2', 'area_find_flint','area_find_note_1')	
			if not event.save then 
				self:playSound('07_click_book')
				self:getEntityNamed('zo_book_2'):ChangeOpacity(0, 1, 0.5)
				self:getEntityNamed('zo_book_1'):ChangeOpacity(1, 0, 0.5)
			else
				self:entityHide('zo_book_1')	
			end	
		end
		self:registerActiveObject('area_click_book', click_on_click_book, false, 'CursorGlass')
	end

	local function on_find_07_flint(event)
      	self:entityHide('area_find_flint','zo_flint')
      	if  HasGameState('07_Cantellos_shop_Father_1') and HasGameState('Layer_07_Fly_Book_with_symbols') then self:closeAndDisable() end
    end
	self:registerToolFindInfo('07_flint', 'area_find_flint', on_find_07_flint)

	local function on_click_apply_or_phone(event)
	    self:entityHide(event.target)
	    if not event.save then
	    	self:playSound('07_apply_zo_phone')
	        SetGameState('07_Cantellos_shop_Father_1','true')
	    	if IsToolFound('07_flint')  and HasGameState('Layer_07_Fly_Book_with_symbols') then self:closeAndDisable() end
	        self.playfield.zoom_comics_father_1:open()
	   else
	   		if IsToolFound('07_flint')  and HasGameState('Layer_07_Fly_Book_with_symbols') then self:closeAndDisable() end
	   end
	end
	self:registerActiveObject('area_apply_or_phone', on_click_apply_or_phone, false, 'CursorCamera')
	
	do
		local function on_take_note(event)	  
		end

		local function on_find_note(event)
			SetGameState('Layer_07_Fly_Book_with_symbols', 'true')
	        self:entityHide('area_find_note_1')
	    	--self.playfield:entityHide('')

	        self.playfield:addFlyNote('Note_07_Book_with_symbols', event.save, 'Layer_07_Fly_Book_with_symbols', true, nil, nil, Vector2f(0.5, 0.5), on_take_note)
	    	
	    	if not event.save then
	    		self:entityFadeHide('zo_book_2')	
	    	else
	    		self:entityHide('zo_book_2')
	    	end

	   		if  IsToolFound('07_flint')  and HasGameState('07_Cantellos_shop_Father_1') then self:closeAndDisable() end
	    end
	    self:registerActiveObject('area_find_note_1', on_find_note, false)
	end
end

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

function l_07_Cantellos_shop_Z_Old_rock:CreateLoaderTable()
	local objects =
	{
		{ name = 'zo_Bg',  entityType = 'SpriteEntity',  x = 512,  y = 384,  order = 0,  editingLocked = false,  treeItemIsExpanded = true,  texturePath = 'Data/Textures/Scenes/07_Cantellos_shop/Z_Old_rock/zo_Bg.jpg',  width = 640,  height = 480,  },
		{ name = 'zo_flint',  entityType = 'SpriteEntity',  x = 377,  y = 380,  order = 0,  editingLocked = false,  treeItemIsExpanded = false,  texturePath = 'Data/Textures/Scenes/07_Cantellos_shop/Z_Old_rock/zo_flint.png',  width = 20,  height = 20,  },
		{ name = 'zo_book_1',  entityType = 'SpriteEntity',  x = 379,  y = 365,  order = 1,  editingLocked = false,  treeItemIsExpanded = false,  texturePath = 'Data/Textures/Scenes/07_Cantellos_shop/Z_Old_rock/zo_book_1.png',  width = 66,  height = 116,  },
		{ name = 'zo_book_2',  entityType = 'SpriteEntity',  x = 356,  y = 557,  order = 1,  editingLocked = false,  treeItemIsExpanded = false,  texturePath = 'Data/Textures/Scenes/07_Cantellos_shop/Z_Old_rock/zo_book_2.png',  width = 164,  height = 132,  },
		{ name = 'area_find_flint',  entityType = 'SpriteEntity',  x = 371,  y = 360,  order = 56,  color = {r = 1, g = 1, b = 1, a = 0.00392157},  editingLocked = false,  treeItemIsExpanded = false,  width = 100,  height = 124,  },
		{ name = 'area_click_book',  entityType = 'SpriteEntity',  x = 371,  y = 360,  order = 60,  color = {r = 1, g = 1, b = 1, a = 0.00392157},  editingLocked = false,  treeItemIsExpanded = false,  width = 100,  height = 124,  },
		{ name = 'area_apply_or_phone',  entityType = 'SpriteEntity',  x = 575,  y = 390,  order = 60,  angle = 7,  color = {r = 1, g = 1, b = 1, a = 0.00392157},  editingLocked = false,  treeItemIsExpanded = true,  width = 300,  height = 400,  },
		{ name = 'area_find_note_1',  entityType = 'SpriteEntity',  x = 337,  y = 546,  order = 60,  color = {r = 1, g = 1, b = 1, a = 0.00392157},  editingLocked = false,  treeItemIsExpanded = false,  hotSpot = {x = 69, y = 50},  width = 152,  height = 105,  },
	}
	return objects
end
