class 'action_08_Lauras_room' (Node)
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
function action_08_Lauras_room:__init(window, name)   
    Node.__init(self, window, name, 5)     
    
    return self
end
-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
function action_08_Lauras_room:action(percent)
    local scene = current_scene:getPlayField()
    self:entityHide('08_Cantello_lips_1','08_Cantello_lips_2','08_Cantello_lips_3')
    local scale = 0.55
    
    if percent == 20 then
      self:loadCantelloLips(1)
    elseif percent == 50 then
      self:loadCantelloLips(2)
    --  self:getEntityNamed('temp_father'):setScaleX(scale)
    elseif percent == 80 then
      self:loadCantelloLips(3)
 --   self:playSound('08_action_Cantello_1') 
    else 
      if percent < 100 then
         self:getEntityNamed('08_action_Cantello_1'):show()
         self:getEntityNamed('08_action_Cantello_1'):setActive(true)
         self:getEntityNamed('08_action_Cantello_1'):play()
         scene:stopSound('08_action_Cantello_1')
         scene:playSound('08_action_Cantello_1', true)
      else
         scene:stopSound('08_action_Cantello_1')    
      end   
    end
 end      
-------------------------------------------------------------------------------
function action_08_Lauras_room:loadCantelloLips(numberVideo)
    local scene = current_scene:getPlayField()
   
  if not HasGameState('08_Cantello_lips_'.. numberVideo , 'true') then   
    SetGameState('08_Cantello_lips_'.. numberVideo , 'true')

    self:getEntityNamed('08_action_Cantello_1'):stop()
    self:getEntityNamed('08_action_Cantello_1'):hide()
    scene:stopSound('08_action_Cantello_1')
    
    local Cantello_lips = self:getEntityNamed('08_Cantello_lips_'..numberVideo)
    
    Cantello_lips:show()
    Cantello_lips:setActive(true)
    Cantello_lips:play()  
    scene:stopSound('08_action_Cantello_Lips_'..numberVideo)
    scene:playSound('08_action_Cantello_Lips_'..numberVideo)
    scene.mouseBlocker:push()
    Cantello_lips.onFinish:add( function() 
                                  Cantello_lips:setActive(false)
                                  scene.mouseBlocker:pop()
                                  Cantello_lips:stop()
                                  Cantello_lips:hide()
                                  scene:stopSound('08_action_Cantello_Lips_'..numberVideo)
                            
                                  self:getEntityNamed('08_action_Cantello_1'):show()
                                  self:getEntityNamed('08_action_Cantello_1'):play()
                                  scene:stopSound('08_action_Cantello_1')
                                  scene:playSound('08_action_Cantello_1', true)
                                  
                                end)
  else
     self:getEntityNamed('08_action_Cantello_1'):show()
     self:getEntityNamed('08_action_Cantello_1'):setActive(true)
     self:getEntityNamed('08_action_Cantello_1'):play()
     scene:stopSound('08_action_Cantello_1')
     scene:playSound('08_action_Cantello_1', true) 
  end    
end
-------------------------------------------------------------------------------
function action_08_Lauras_room:LoadSave(percent)   
    --self:getEntityNamed('08_action_Cantello_1'):show()    
end
-------------------------------------------------------------------------------

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

function action_08_Lauras_room:CreateLoaderTable()
	local objects =
	{
		{ name = '08_action_Cantello_1',  entityType = 'VideoEntity',  x = 512,  y = 384,  order = 0,  isActive = false,  scale = 0.75,  editingLocked = false,  treeItemIsExpanded = true,  path = 'Data/Video/Scenes/08_Lauras_room/08_action_Cantello_1.webm',  hasAlpha = false,  isLooped = true,  fps = 24,  play = false,  },
		{ name = '08_Cantello_lips_1',  entityType = 'VideoEntity',  x = 512,  y = 384,  order = 1,  isVisible = false,  isActive = false,  scale = 0.75,  editingLocked = false,  treeItemIsExpanded = true,  path = 'Data/Video/Scenes/08_Lauras_room/08_Cantello_lips_1.webm',  hasAlpha = false,  isLooped = false,  fps = 24,  play = false,  },
		{ name = '08_Cantello_lips_2',  entityType = 'VideoEntity',  x = 512,  y = 384,  order = 1,  isVisible = false,  isActive = false,  scale = 0.75,  editingLocked = false,  treeItemIsExpanded = true,  path = 'Data/Video/Scenes/08_Lauras_room/08_Cantello_lips_2.webm',  hasAlpha = false,  isLooped = false,  fps = 24,  play = false,  },
		{ name = '08_Cantello_lips_3',  entityType = 'VideoEntity',  x = 512,  y = 384,  order = 1,  isVisible = false,  isActive = false,  scale = 0.75,  editingLocked = false,  treeItemIsExpanded = false,  path = 'Data/Video/Scenes/08_Lauras_room/08_Cantello_lips_3.webm',  hasAlpha = false,  isLooped = false,  fps = 24,  play = false,  },
	}
	return objects
end
