class 'l_01_Boat_crash_site_Z_Fishing_net' (ZoomZone)

function l_01_Boat_crash_site_Z_Fishing_net:__init(name, mode, PlayField)
	ZoomZone.__init(self, name, mode, PlayField)
	
	----------------------------------------------------------------------------
	local close_counter = 2
	local function decrement_close_counter()
	    close_counter = close_counter - 1
	    if close_counter <= 0 then
	        self.playfield:entityShow('area_apply_dog')
	        self:closeAndDisable()

	        self.playfield.stones_moln_1:setOpacity(1)
		    self.playfield.stones_1:setOpacity(1)
		    self.playfield.stones_moln_2:setOpacity(1)
		    self.playfield.stones_2:setOpacity(1)
		    self.playfield.stones_bg:setOpacity(1)

		    self.playfield:entityShow('pit_1')
	    end
	end
	----------------------------------------------------------------------------

	-- on apply pliers ---------------------------------------------------------
	do
		local function on_close_find_zf_fishing_net(e)
		    if self.need_to_reopen then
		        self.need_to_reopen = false
		        self:open()
		    end
		end

		self:getEntityNamed('compositionbg'):rewind(false)
		self:getEntityNamed('area_apply_zf_pliers').onPress:add(bind(self.onNetclick, self))

		local function on_apply_zb_fishing_net(e)

	        self:entityHide(e.target)
	        
	        self:entityHide('compositionbg')
	       
	        if not HasGameState(TOOL_INFO_SHOWN, '01_fishing_net') and not self:isVisible() then
	            self.need_to_reopen = true
	        end
	       	
	        self.playfield:entityHide('net')
	        self.playfield.net_moln_1:setOpacity(0)
			self.playfield.net_moln_2:setOpacity(0)
			self.playfield.net_1:setOpacity(0)
			self.playfield.net_2:setOpacity(0)

			self.playfield.stones_moln_1:setOpacity(1)
			self.playfield.stones_1:setOpacity(1)
			self.playfield.stones_moln_2:setOpacity(1)
			self.playfield.stones_2:setOpacity(1)
			self.playfield.stones_bg:setOpacity(1)
			
	        decrement_close_counter() 
	        self:findTool('01_fishing_net', nil, on_close_find_zf_fishing_net)
	        if not e.save then 
	        	 self:playSound('01_apply_zf_pliers')	
	        end
		end
		self:registerToolApplyInfo('01_pliers', 'area_apply_zf_pliers', on_apply_zb_fishing_net, 'BBT_01_NEED_PLIERS')
	end
	----------------------------------------------------------------------------

	-- on find number key ------------------------------------------------------
	do
		local function on_window_closed()
		    -- if not self.playfield.tutorial:isTipCompleted( 'HINT' ) then
			   --  self.playfield.tutorial:showTip( 'HINT', ZOOM_ZONE_APPEARING_TIME )
		    -- end
		end
		
		local function on_find_zf_number_key_1(e)
	        self:entityHide(e.target)
	        
	        self:entityHide('zf_number_key_1')
	        self.playfield:entityHide('number_key_1')
	        
	        decrement_close_counter()                
		end
		self:registerToolFindInfo('01_number_key_1', 'area_find_zf_number_key_1', on_find_zf_number_key_1, nil, on_window_closed)
	end
	----------------------------------------------------------------------------
end
----------------------------------------------------------------------------

----------------------------------------------------------------------------
function l_01_Boat_crash_site_Z_Fishing_net:onOpenFinished()
	if ( not self.playfield.tutorial:isTipCompleted( 'FIND_TOOL' ) ) then
        self.playfield.tutorial:showTip( 'FIND_TOOL', ZOOM_ZONE_APPEARING_TIME )
    elseif ( not self.playfield.tutorial:isTipCompleted( 'APPLY_TOOL' ) and IsToolFound('01_pliers')) then
	    self.playfield:getInventory():dropTool()
		self.playfield.tutorial:showTip( 'APPLY_TOOL', ZOOM_ZONE_APPEARING_TIME )
	end
end
----------------------------------------------------------------------------

----------------------------------------------------------------------------
function l_01_Boat_crash_site_Z_Fishing_net:onNetclick()
	self:stopSound('01_onNetclick')
	self:playSound('01_onNetclick')
	self:getEntityNamed('compositionbg'):play()
	
end
----------------------------------------------------------------------------

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

function l_01_Boat_crash_site_Z_Fishing_net:CreateLoaderTable()
	local objects =
	{
		{ name = 'zf_bg',  entityType = 'SpriteEntity',  x = 512,  y = 384,  order = 0,  editingLocked = false,  treeItemIsExpanded = false,  texturePath = 'Data/Textures/Scenes/01_Boat_crash_site/Z_Fishing_net/zf_bg.jpg',  width = 384,  height = 512,  },
		{ name = 'zf_number_key_1',  entityType = 'SpriteEntity',  x = 497,  y = 526,  order = 15,  editingLocked = false,  treeItemIsExpanded = false,  texturePath = 'Data/Textures/Scenes/01_Boat_crash_site/Z_Fishing_net/zf_number_key_1.png',  width = 72,  height = 66,  },
		{ name = 'area_apply_zf_pliers',  entityType = 'SpriteEntity',  x = 550,  y = 218,  order = 100,  scaleX = 0.95,  scaleY = 1.1,  color = {r = 1, g = 1, b = 1, a = 0.00392157},  editingLocked = false,  treeItemIsExpanded = true,  hotSpot = {x = 236, y = 71.5},  width = 400,  height = 453,  },
		{ name = 'area_find_zf_number_key_1',  entityType = 'SpriteEntity',  x = 495,  y = 526,  order = 110,  scale = 0.7,  color = {r = 1, g = 1, b = 1, a = 0.00392157},  editingLocked = false,  treeItemIsExpanded = true,  texturePath = 'Data/Textures/Common/Area_Round.png',  width = 128,  height = 128,  },
		{ name = '01_Boat_crash_site_Anim_Z_Net',  entityType = 'CompositionContainer',  x = 320,  y = 128,  order = 10,  editingLocked = false,  treeItemIsExpanded = true,  path = 'Data/Scripts/Scenes/01_Boat_crash_site/Anim/01_Boat_crash_site_Anim_Z_Net.lua',  },
		{ name = 'compositionbg',  entityType = 'CompositionSequence',  parentName = '01_Boat_crash_site_Anim_Z_Net',  x = 0,  y = 0,  order = 0,  isRespondable = false,  editingLocked = false,  treeItemIsExpanded = false,  speed = 1,  },
	}
	return objects
end
