--[[

|=================================================|
|-----------Script do Bizon Rekord Z058-----------|
|-----------------by PowerIsBack------------------|
|-------------Skrypt BY maciusboss1---------------|
|----------------Data: 10.04.2013-----------------|
|------------------Pomoc: Burner------------------|
|--------------------No Edit!!!-------------------|
|-------------------------------------------------|
|=================================================|

]]--

Bizon_Rekord_Z058_Heder = {};

function Bizon_Rekord_Z058_Heder.prerequisitesPresent(specializations)
    return SpecializationUtil.hasSpecialization(Cutter, specializations);
end;

function Bizon_Rekord_Z058_Heder:load(xmlFile)   

 	self.threshingParticleSystems = {};
    local i = 0;
    while true do
        local namei = string.format("vehicle.threshingParticleSystems.threshingParticleSystem(%d)", i);
		local nodei = Utils.indexToObject(self.components, getXMLString(xmlFile, namei .. "#index"));
		if nodei == nil then
			break;
		end;
		local isStatic = Utils.getNoNil(getXMLBool(xmlFile, namei.."#static"), false);
		if isStatic then
			StaticParticleSystem.loadParticleSystem(xmlFile, self.threshingParticleSystems, namei, nodei, false, nil, self.baseDirectory);
		else
			Utils.loadParticleSystem(xmlFile, self.threshingParticleSystems, namei, nodei, false, nil, self.baseDirectory);
		end;
		Utils.setEmittingState(self.threshingParticleSystems,false);
		i = i +1;		
    end;
 
end;

function Bizon_Rekord_Z058_Heder:delete()
end;

function Bizon_Rekord_Z058_Heder:readStream(streamId, connection)
end;

function Bizon_Rekord_Z058_Heder:writeStream(streamId, connection)
end;

function Bizon_Rekord_Z058_Heder:readUpdateStream(streamId, timestamp, connection)
end;

function Bizon_Rekord_Z058_Heder:writeUpdateStream(streamId, connection, dirtyMask)
end;

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

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

function Bizon_Rekord_Z058_Heder:update(dt)

    if self:getIsActiveForInput() then
		if InputBinding.isPressed(InputBinding.BizonZ058_HederDOWN) then
              self:setAnimationTime(1, self.animationParts[1].currentPosition+(self.animationParts[1].offSet+dt), false);
		elseif InputBinding.isPressed(InputBinding.BizonZ058_HederUP) then
              self:setAnimationTime(1, self.animationParts[1].currentPosition-(self.animationParts[1].offSet+dt), false);
		end;
    end;
    	if self.reelStarted then
					self:setAnimationTime(2, 1);
			
					self:setAnimationTime(3, 1);
				else 
					self:setAnimationTime(2, 0);
			
					self:setAnimationTime(3, 0);
			end;
    
end;

function Bizon_Rekord_Z058_Heder:updateTick(dt)
end;

function Bizon_Rekord_Z058_Heder:draw()

	g_currentMission:addExtraPrintText(string.format(""..InputBinding.getKeyNamesOfDigitalAction(InputBinding.BizonZ058_HederDOWN) .. " / " .. InputBinding.getKeyNamesOfDigitalAction(InputBinding.BizonZ058_HederUP)..": "..g_i18n:getText("BizonZ058_Motowidla")..""));


end;

function Bizon_Rekord_Z058_Heder:onDetach()
end;

function Bizon_Rekord_Z058_Heder:onLeave()
end;

function Bizon_Rekord_Z058_Heder:onDeactivate()
end;