--
--Dodge2500
-- Specialization for farmer car mod
--
-- @author  Nordlicht & Sven777b
-- @date  23/05/09
--
-- Copyright (C)Nordlicht & Sven777b, Confidential, All Rights Reserved.

Dodge2500 = {};

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


function Dodge2500:load(xmlFile) 
self.hornSoundId_an = false; 
self.hornSoundId_laeuft = false; 
hornSoundFile = Utils.getFilename("horn.wav", self.baseDirectory);
    self.hornSoundId = createSample("famerCarSound");
    loadSample(self.hornSoundId, hornSoundFile, false);
	end;
	
function Dodge2500:delete()
	delete(self.hornSoundId);
end;	

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

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



    function Dodge2500:update(dt)
if self:getIsActiveForInput() and self:getIsActiveForSound() and InputBinding.isPressed(InputBinding.FARMER_CAR_HORN) then
self.hornSoundId_an = not self.hornSoundId_an; 
end; 
  
if self.hornSoundId_an and not self.hornSoundId_laeuft then 
playSample(self.hornSoundId,0,1,0); 
self.hornSoundId_laeuft = true; 
end; 


if self.hornSoundId_laeuft and not self.hornSoundId_an then 
stopSample(self.hornSoundId); 
self.hornSoundId_laeuft = false; 
end; 
end;

function Dodge2500:draw()
    g_currentMission:addHelpButtonText(g_i18n:getText("Dodge2500Horn"), InputBinding.FARMER_CAR_HORN);
end;


