class 'l_01_Boat_crash_site_Z_Road_block' (ZoomZone)

function l_01_Boat_crash_site_Z_Road_block:__init(name, mode, PlayField)
	ZoomZone.__init(self, name, mode, PlayField)
	
	----------------------------------------------------------------------------
	self:entityHide('area_apply_zr_box', 'zr_box_2', 'zr_box_3')
	self.playfield:entityHide('boxes')
	----------------------------------------------------------------------------

	-- drag box ----------------------------------------------------------------
	do	   
		local function on_drop_bx_1(event)    	   
	    	self:entityHide('area_get_bx_1')
	    	self:entityHide('area_drop_bx_1')

	    	self:entityShow('area_apply_zr_box')
    	  	self.playfield.boxes_intrctv2_moln:setOpacity(1)
    		self.playfield.boxes_intrctv2_moln_2:setOpacity(1)

    		self.playfield.boxes_intrctv1_moln:setOpacity(0)
    		self.playfield.boxes_intrctv1_moln_2:setOpacity(0)
	    	
	    	if not event.save then
	    	    self:playSound('01_apply_zr_box')

    	   	    self:entityFadeHide('zr_bx_1')
    	  	    self:entityFadeShow('zr_box_2')
    	  	    self.playfield:entityFadeShow('box_intrctv_2')
    	  	    self.playfield:entityFadeHide('box_intrctv_1')
	    	else
	    	    self:entityHide('zr_bx_1')
    	  	    self.playfield:entityHide('box_intrctv_1')

	    	 	self:entityShow('zr_box_2')
	    	 	self.playfield:entityShow('box_intrctv_2')	    	 	
	    	end
	    	    	
	    end
	    self:registerDragObject('zr_bx_1', 'area_get_bx_1', 'area_drop_bx_1', nil, nil, on_drop_bx_1, nil,true)	
	end
	----------------------------------------------------------------------------

	-- apply box ---------------------------------------------------------------
	do
		local function on_apply_zr_box(e)
		    self:entityHide(e.target)
		    self.playfield:entityShow('area_link_02')
		    self:entityHide('area_apply_zr_box')

	        self.playfield:entityShow('box_3')
	       	self.playfield.z_box_1:setOpacity(1)
			self.playfield.z_box_2:setOpacity(1)
	        
	        local function call_link_tutorial()
	            if ( not self.playfield.tutorial:isTipCompleted( 'LINK_SCENE' ) ) then
	    			self.playfield.tutorial:showTip( 'LINK_SCENE', ZOOM_ZONE_APPEARING_TIME )
			    end
	        end

		    self.playfield:entityShow('boxes')
		    self.playfield:entityHide('box_3','box_intrctv_2')

		    self.playfield.boxes_intrctv2_moln:setOpacity(0)
	    	self.playfield.boxes_intrctv2_moln_2:setOpacity(0)

	    	self.playfield.boxes_intrctv3_moln:setOpacity(1)
	    	self.playfield.boxes_intrctv3_moln_2:setOpacity(1)
	    	
		    if not e.save then
		        self.mouseBlocker:push()

		        self:entityFadeShow('zr_box_3')

		        self:playSound('01_apply_zr_box')	

		        self.timer:add( function()
					                self.mouseBlocker:pop()

					                call_link_tutorial()					                
					                completeGameTask('01')

					                self:closeAndDisable()
					            end, 1 )
		    else
		        self:entityShow('zr_box_3')	 

		        self:closeAndDisable()		        
		        call_link_tutorial()

		        self.timer:add( function()
					    	   		completeGameTask('01')
						    	end, 0 )
		    end
		end
		self:registerToolApplyInfo('01_box', 'area_apply_zr_box', on_apply_zr_box, 'BBT_01_NEED_BOX')
	end
	----------------------------------------------------------------------------
end

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

function l_01_Boat_crash_site_Z_Road_block:CreateLoaderTable()
	local objects =
	{
		{ name = 'zr_bg',  entityType = 'SpriteEntity',  x = 512,  y = 384,  order = 0,  isRespondable = true,  editingLocked = false,  treeItemIsExpanded = false,  texturePath = 'Data/Textures/Scenes/01_Boat_crash_site/Z_Road_block/zr_bg.jpg',  width = 640,  height = 480,  },
		{ name = '01_Boat_crash_site_Anim_Z_Road_block',  entityType = 'CompositionContainer',  x = 192,  y = 144,  order = 0,  isRespondable = true,  editingLocked = false,  treeItemIsExpanded = true,  path = 'Data/Scripts/Scenes/01_Boat_crash_site/Anim/01_Boat_crash_site_Anim_Z_Road_block.lua',  },
		{ name = 'compositionbg',  entityType = 'CompositionSequence',  parentName = '01_Boat_crash_site_Anim_Z_Road_block',  x = 0,  y = 0,  order = 0,  isRespondable = true,  editingLocked = false,  treeItemIsExpanded = false,  isCyclic = true,  speed = 1,  },
		{ name = 'zr_block',  entityType = 'SpriteEntity',  x = 487,  y = 242,  order = 10,  isRespondable = true,  editingLocked = false,  treeItemIsExpanded = false,  texturePath = 'Data/Textures/Scenes/01_Boat_crash_site/Z_Road_block/zr_block.png',  width = 270,  height = 196,  },
		{ name = 'zr_box',  entityType = 'SpriteEntity',  x = 710,  y = 475,  order = 15,  isRespondable = true,  editingLocked = false,  treeItemIsExpanded = true,  texturePath = 'Data/Textures/Scenes/01_Boat_crash_site/Z_Road_block/zr_box.png',  width = 242,  height = 120,  },
		{ name = 'zr_box_2',  entityType = 'SpriteEntity',  x = 655.919,  y = 419.38,  order = 20,  isRespondable = true,  editingLocked = false,  treeItemIsExpanded = true,  texturePath = 'Data/Textures/Scenes/01_Boat_crash_site/Z_Road_block/zr_box_2.png',  width = 210,  height = 176,  },
		{ name = 'zr_box_3',  entityType = 'SpriteEntity',  x = 638,  y = 377,  order = 25,  isRespondable = true,  editingLocked = false,  treeItemIsExpanded = false,  texturePath = 'Data/Textures/Scenes/01_Boat_crash_site/Z_Road_block/zr_box_3.png',  width = 210,  height = 162,  },
		{ name = 'compositionbg_over',  entityType = 'CompositionSequence',  x = 192,  y = 144,  order = 20,  isRespondable = true,  editingLocked = false,  treeItemIsExpanded = false,  isCyclic = true,  speed = 1,  },
		{ name = 'area_apply_zr_box',  entityType = 'SpriteEntity',  x = 512,  y = 327,  order = 100,  isRespondable = true,  scaleX = 6.4,  scaleY = 3.5,  color = {r = 1, g = 1, b = 1, a = 0.00392157},  editingLocked = false,  treeItemIsExpanded = true,  width = 100,  height = 100,  },
		{ name = 'area_get_bx_1',  entityType = 'SpriteEntity',  x = 279,  y = 499,  order = 60,  isRespondable = true,  angle = -36,  color = {r = 1, g = 1, b = 1, a = 0.00392157},  editingLocked = false,  treeItemIsExpanded = false,  width = 150,  height = 150,  },
		{ name = 'area_drop_bx_1',  entityType = 'SpriteEntity',  x = 636,  y = 402,  order = 60,  isRespondable = true,  color = {r = 1, g = 1, b = 1, a = 0.00392157},  editingLocked = false,  treeItemIsExpanded = false,  width = 200,  height = 150,  },
		{ name = 'zr_bx_1',  entityType = 'SpriteEntity',  x = 312,  y = 522,  order = 0,  isRespondable = true,  editingLocked = false,  treeItemIsExpanded = false,  texturePath = 'Data/Textures/Scenes/01_Boat_crash_site/Z_Road_block/zr_get_box.png',  width = 270,  height = 170,  },
	}
	return objects
end
