class 'l_08_Lauras_room_Z_Window_vase' (ZoomZone)

function l_08_Lauras_room_Z_Window_vase:__init(name, mode, PlayField)
	ZoomZone.__init(self, name, mode, PlayField)
	self:entityHide('area_apply_rope','zw_trap','area_find_rope_ladder_2','area_apply_rope_ladder_2','area_click_window_2','area_click_window_3')

	 local function on_find_08_vase(event)    	
	   self.playfield:getEntityNamed('Vase_1'):hide()
	   self:entityHide('zw_vaze')
	   
	   if not event.save then
	   	 self:entityFadeHide('zw_vaze')
	   		-- actionScreen
	    	self.playfield.action:incrementActionBar(10)
	    	----------------------------------------------------------
	   end
	   if HasGameState('08_click_window') then self:entityShow('area_apply_rope') end
	end
	self:registerToolFindInfo('08_vase', 'area_find_08_vase', on_find_08_vase)


	local function on_click_window(event)
	    self:entityHide(event.target)
        self.playfield:entityShow('window_2')
        self.playfield:entityHide('window_1')
        self:entityHide('zw_window_close')

		SetGameState('08_click_window','true') 
		
        if not event.save then 
        	self:playSound('08_click_window')
		    self:getEntityNamed('zw_window_close'):ChangeOpacity(1, 0, 0.5)
		    self.playfield:getEntityNamed('window_1'):ChangeOpacity(1, 0, 0.5)  
		    self.playfield:getEntityNamed('window_2'):ChangeOpacity(0, 1, 0.5)  
    	end
    	if IsToolFound('08_vase') then self:entityShow('area_apply_rope') end
	end
	self:registerActiveObject('area_click_window', on_click_window)

	local function on_applied_rope1(event)		
  		self:entityHide('area_apply_rope')
  	    self.playfield:entityShow('ropeladder')
  	    self:entityShow('area_find_rope_ladder_2')
  	    if not event.save then
  	    	-- actionScreen
	    	self.playfield.action:incrementActionBar(10)
	    	----------------------------------------------------------
  	    	self:playSound('08_apply_rope')
  	         self:entityFadeShow('zw_trap')
  	         self.playfield:entityFadeShow('ropeladder')
  	    	 self.mouseBlocker:push()
      		 self.timer:add(function()
      		 	
	   			self:close()
	   			self.playfield:getEntityNamed('compositiongirl'):ChangeOpacity(1,0,0.5,1.5)
	   			self.playfield:entityHide('area_click_bbt_Laura')
	      		self.mouseBlocker:pop()
	      		self.playfield:showBlackBar('BBT_08_LAURA_WAS_ESC')
 			end, 0.7)
 		else
 			self:entityShow('zw_trap')
 			self.playfield:entityHide('compositiongirl','area_click_bbt_Laura')
  	    end	
  	 	
  	end
    self:registerToolApplyInfo('08_rope_ladder', 'area_apply_rope', on_applied_rope1, 'BBT_NEED_08_ROPE')
	
	local function on_find_rope_ladder_2(event)    	
	  	self:entityHide('zw_trap')
	  	self:entityShow('area_click_window_2')
	  	self.playfield:entityHide('ropeladder')
	end
	self:registerToolFindInfo('08_rope_ladder_2', 'area_find_rope_ladder_2', on_find_rope_ladder_2)	

	local function on_click_window_2(event)		
	  	self:entityHide(event.target)
        self.playfield:entityHide('window_2')
        self.playfield:entityShow('window_1')
        self:entityShow('zw_window_close')
        -- self:entityShow('area_apply_rope')
		--SetGameState('08_click_window','true') 
			
        if not event.save then 
        	-- actionScreen
	    	self.playfield.action:incrementActionBar(10)
	    	----------------------------------------------------------
        	self:playSound('08_click_window')
		    self:getEntityNamed('zw_window_close'):ChangeOpacity(0, 1, 0.5)
		    self.playfield:getEntityNamed('window_1'):ChangeOpacity(0, 1, 0.5)  
		    self.playfield:getEntityNamed('window_2'):ChangeOpacity(1, 0, 0.5)  
    	end

		if HasGameState('Click_to_hide_bad', 'true') then
			self.playfield:entityShow('area_click_shelf')
			self.playfield:entityHide('area_click_bbt')
		end
  	 	
  	end
   self:registerActiveObject('area_click_window_2', on_click_window_2)

 --    if HasGameState('08_Cantello_cut_scene_was_ended', 'true') then
 --    	self:entityShow('area_click_window_3')
	-- end

	local function on_click_window_3(event)
	    self:entityHide(event.target)
        self.playfield:entityShow('window_2')
        self.playfield:entityHide('window_1')
        self:entityHide('zw_window_close')
        self:entityShow('area_apply_rope_ladder_2')

	    if not event.save then 
        	self:playSound('08_click_window')
		    self:getEntityNamed('zw_window_close'):ChangeOpacity(1, 0, 0.5)
		    self.playfield:getEntityNamed('window_1'):ChangeOpacity(1, 0, 0.5)  
		    self.playfield:getEntityNamed('window_2'):ChangeOpacity(0, 1, 0.5)  
    	end

	end
	self:registerActiveObject('area_click_window_3', on_click_window_3)

	local function on_rope_ladder_2(event)		
  		self:entityHide('area_apply_rope_ladder_2')
  	    self.playfield:entityShow('ropeladder')
  	    self.playfield:entityShow('area_link_06')
  	    if not event.save then
  	    	self:playSound('08_apply_rope')
  	         self:entityFadeShow('zw_trap')
  	         self.playfield:entityFadeShow('ropeladder')
  	    	 self.mouseBlocker:push()
      		 self.timer:add(function()
      		 	self.mouseBlocker:pop()
	   			self:closeAndDisable()
 			end, 0.7)
 		else
 			self:entityShow('zw_trap')
 			self:closeAndDisable()
  	    end	
  	 	
  	end
    self:registerToolApplyInfo('08_rope_ladder_2', 'area_apply_rope_ladder_2', on_rope_ladder_2, 'BBT_NEED_08_ROPE')
	
end

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

function l_08_Lauras_room_Z_Window_vase:CreateLoaderTable()
	local objects =
	{
		{ name = 'zw_bg',  entityType = 'SpriteEntity',  x = 512,  y = 384,  order = 0,  editingLocked = false,  treeItemIsExpanded = true,  texturePath = 'Data/Textures/Scenes/08_Lauras_room/Z_Window_vase/zw_bg.jpg',  width = 384,  height = 512,  },
		{ name = 'zw_window_close',  entityType = 'SpriteEntity',  x = 641,  y = 381,  order = 2,  editingLocked = false,  treeItemIsExpanded = true,  texturePath = 'Data/Textures/Scenes/08_Lauras_room/Z_Window_vase/zw_window_close.png',  width = 134,  height = 484,  },
		{ name = 'zw_vaze',  entityType = 'SpriteEntity',  x = 504,  y = 527,  order = 5,  editingLocked = false,  treeItemIsExpanded = false,  texturePath = 'Data/Textures/Scenes/08_Lauras_room/Z_Window_vase/zw_vaze.png',  width = 132,  height = 224,  },
		{ name = 'zw_masc',  entityType = 'SpriteEntity',  x = 617,  y = 178,  order = 40,  editingLocked = false,  treeItemIsExpanded = true,  texturePath = 'Data/Textures/Scenes/08_Lauras_room/Z_Window_vase/zw_masc.png',  width = 170,  height = 96,  },
		{ name = 'area_find_08_vase',  entityType = 'SpriteEntity',  x = 511,  y = 513,  order = 120,  color = {r = 1, g = 1, b = 1, a = 0.00392157},  editingLocked = false,  treeItemIsExpanded = true,  width = 150,  height = 240,  },
		{ name = 'area_apply_rope',  entityType = 'SpriteEntity',  x = 570,  y = 472,  order = 50,  color = {r = 1, g = 1, b = 1, a = 0.00392157},  editingLocked = false,  treeItemIsExpanded = true,  hotSpot = {x = 125, y = 163},  width = 250,  height = 326,  },
		{ name = 'zw_trap',  entityType = 'SpriteEntity',  x = 613,  y = 581,  order = 20,  editingLocked = false,  treeItemIsExpanded = false,  texturePath = 'Data/Textures/Scenes/08_Lauras_room/Z_Window_vase/zw_trap.png',  width = 182,  height = 116,  },
		{ name = 'area_click_window',  entityType = 'SpriteEntity',  x = 623,  y = 387,  order = 20,  color = {r = 1, g = 1, b = 1, a = 0.00392157},  editingLocked = false,  treeItemIsExpanded = true,  hotSpot = {x = 81, y = 225},  width = 162,  height = 450,  },
		{ name = 'area_find_rope_ladder_2',  entityType = 'SpriteEntity',  x = 577,  y = 484,  order = 50,  color = {r = 1, g = 1, b = 1, a = 0.00392157},  editingLocked = false,  treeItemIsExpanded = true,  width = 250,  height = 300,  },
		{ name = 'area_apply_rope_ladder_2',  entityType = 'SpriteEntity',  x = 570,  y = 485,  order = 50,  color = {r = 1, g = 1, b = 1, a = 0.00392157},  editingLocked = false,  treeItemIsExpanded = true,  width = 250,  height = 300,  },
		{ name = 'area_click_window_2',  entityType = 'SpriteEntity',  x = 561,  y = 387,  order = 20,  color = {r = 1, g = 1, b = 1, a = 0.00392157},  editingLocked = false,  treeItemIsExpanded = true,  hotSpot = {x = 143, y = 225},  width = 286,  height = 450,  },
		{ name = 'area_click_window_3',  entityType = 'SpriteEntity',  x = 549,  y = 386,  order = 20,  scaleX = 2.78182,  scaleY = 1,  color = {r = 1, g = 1, b = 1, a = 0.00392157},  editingLocked = false,  treeItemIsExpanded = true,  hotSpot = {x = 55, y = 225},  width = 110,  height = 450,  },
	}
	return objects
end
