-- Animation script for fiat-Allis FD14e
-- By Harley
-- 04/06/2010

NHtk4060 = {};

function NHtk4060.prerequisitesPresent(specializations)
    return true;
end;

function NHtk4060:load(xmlFile)

	

end;

function NHtk4060:mouseEvent(posX, posY, isDown, isUp, button)
end;

function NHtk4060:keyEvent(unicode, sym, modifier, isDown)
end;

function NHtk4060:update(dt)
	if self:getIsActiveForInput() then
		
		
		if InputBinding.isPressed(InputBinding.NHtk4060_Barra_traino1) and self:getIsActiveForInput() then
			self:setAnimationTime(1, self.animationParts[1].currentPosition+(self.animationParts[1].offSet+dt), false);
		elseif InputBinding.isPressed(InputBinding.NHtk4060_Barra_traino2) and self:getIsActiveForInput() then
			self:setAnimationTime(1, self.animationParts[1].currentPosition-(self.animationParts[1].offSet+dt), false);
		end;
            
            if InputBinding.isPressed(InputBinding.NHtk4060_acceleratore1) and self:getIsActiveForInput() then
			self:setAnimationTime(2, self.animationParts[2].currentPosition+(self.animationParts[2].offSet+dt), false);
		elseif InputBinding.isPressed(InputBinding.NHtk4060_acceleratore2) and self:getIsActiveForInput() then
			self:setAnimationTime(2, self.animationParts[2].currentPosition-(self.animationParts[2].offSet+dt), false);
			
		end;

           if InputBinding.isPressed(InputBinding.NHtk4060_frizione1) and self:getIsActiveForInput() then
			self:setAnimationTime(3, self.animationParts[3].currentPosition+(self.animationParts[3].offSet+dt), false);
		elseif InputBinding.isPressed(InputBinding.NHtk4060_frizione3) and self:getIsActiveForInput() then
			self:setAnimationTime(3, self.animationParts[3].currentPosition-(self.animationParts[3].offSet+dt), false);

			
		end;

	     if InputBinding.isPressed(InputBinding.NHtk4060_frizione2) and self:getIsActiveForInput() then
			self:setAnimationTime(3, self.animationParts[3].currentPosition+(self.animationParts[3].offSet+dt), false);
		elseif InputBinding.isPressed(InputBinding.NHtk4060_frizione3) and self:getIsActiveForInput() then
			self:setAnimationTime(3, self.animationParts[3].currentPosition-(self.animationParts[3].offSet+dt), false);

			
		end;
		
		 if InputBinding.isPressed(InputBinding.NHtk4060_sollevatore1) and self:getIsActiveForInput() then
			self:setAnimationTime(4, self.animationParts[4].currentPosition+(self.animationParts[4].offSet+dt), false);
		elseif InputBinding.isPressed(InputBinding.NHtk4060_sollevatore2) and self:getIsActiveForInput() then
			self:setAnimationTime(4, self.animationParts[4].currentPosition-(self.animationParts[4].offSet+dt), false);
		end;

           
          if InputBinding.isPressed(InputBinding.NHtk4060_levasol1) and self:getIsActiveForInput() then
			self:setAnimationTime(5, self.animationParts[5].currentPosition+(self.animationParts[5].offSet+dt), false);
		elseif InputBinding.isPressed(InputBinding.NHtk4060_levasol2) and self:getIsActiveForInput() then
			self:setAnimationTime(5, self.animationParts[5].currentPosition-(self.animationParts[5].offSet+dt), false);
		end;


		
	end;
	
end;

function NHtk4060:updateTick(dt)

	
	
end;


function NHtk4060:delete()
end;

function NHtk4060:validateAttacherJoint(implement, jointDesc, dt)
    return true;
end;

function NHtk4060:draw()

	g_currentMission:addExtraPrintText(g_i18n:getText("NHtk4060_Barra_traino")); 
	g_currentMission:addExtraPrintText(g_i18n:getText("NHtk4060_cab"));
      g_currentMission:addExtraPrintText(g_i18n:getText("arco"));
      g_currentMission:addExtraPrintText(g_i18n:getText("indor_camera"));

end;