Kronekr250 = {};


function Kronekr250.prerequisitesPresent(specializations)
	return true;

end;

function Kronekr250:load(xmlFile)
	self.Kronekr250 = Overlay:new("Kronekr250Overlay", Utils.getFilename("Hud.dds", self.baseDirectory), 0.8143, 0.8315, 0.176, 0.06638);
	self.Balle_neu = 0;	
	self.Balle_alt = 0;	
end;

function Kronekr250:getSaveAttributesAndNodes(nodeIdent)	
	local attributes = 'Balle_neu="'.. tostring(self.Balle_neu) ..'"';	
	return attributes, nil;
end;

function Kronekr250:loadFromAttributesAndNodes(xmlFile, key, resetVehicles)		
	self.Balle_neu = Utils.getNoNil(getXMLInt(xmlFile, key.."#Balle_neu"), 0);		
end;

function Kronekr250:delete()	
	if self.Kronekr250 ~= nil then
		self.Kronekr250:delete();
	end;
end;

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

function Kronekr250:keyEvent(unicode, sym, modifier, isDown)

end;

function Kronekr250:update(dt)	
	if table.getn(self.bales) > self.Balle_alt then		
		self.Balle_neu = self.Balle_neu + 1;	
		self.Balle_alt = self.Balle_alt + 1;		
	elseif table.getn(self.bales) < self.Balle_alt then	
		self.Balle_alt = self.Balle_alt - 1;	
	end;	
	if self:getIsActive() then
    		if InputBinding.hasEvent(InputBinding.Reset) then
		self.Balle_neu = 0;
    		end;
    	end;
end;
function Kronekr250:readStream(streamId, connection) 
     self.Balle_neu = streamReadInt32(streamId) 
end;

function Kronekr250:writeStream(streamId, connection) 
    streamWriteInt32(streamId, self.Balle_neu);
 
end;
	
function Kronekr250:draw()			
	self.Kronekr250:render();	
	setTextAlignment(RenderText.ALIGN_RIGHT);
	
	setTextBold(true);	
	setTextColor(1, 1, 1, 1);	
	renderText(0.9653, 0.849, 0.032, tostring(self.Balle_neu));		
	if self:getIsActive() then	
                g_currentMission:addHelpButtonText(g_i18n:getText("Reset"), InputBinding.Reset);
	end;

	g_currentMission:addExtraPrintText(string.format("Klawisz V: Opusc/ Podnies Podbieracz."));
	g_currentMission:addExtraPrintText(string.format("Klawisz 7: Zakmnij/ Otworz Klape."));
	end;
