--
-- Customizations for MF1200
-- uses parts of other scripts in own combination
-- thanks Templaer, Headshot XXL
-- 
-- main scripting: BoneCrusherXes 
-- additional scripting: Assassin
--
-- > Copyright (C) BoneCrusherXes & Assassin  14.06.09  ---


MF1200 = {}

function MF1200.prerequisitesPresent(specializations)
    return SpecializationUtil.hasSpecialization(Steerable, specializations);
end;

function MF1200:load(xmlFile)
	

      self.exhaustParticleSystems = {};
      local exhaustParticleSystemCount = Utils.getNoNil(getXMLInt(xmlFile, "vehicle.exhaustParticleSystems#count"), 0);
	for i=1, exhaustParticleSystemCount do
      	local namei = string.format("vehicle.exhaustParticleSystems.exhaustParticleSystem%d", i);
		local nodei = Utils.indexToObject(self.rootNode, getXMLString(xmlFile, namei .. "#index"));
      	Utils.loadParticleSystem(xmlFile, self.exhaustParticleSystems, namei, nodei, false, nil, self.baseDirectory);
	end;	

	local rotationNode1 = Utils.indexToObject(self.rootNode, getXMLString(xmlFile, "vehicle.rotation1#index"));
    if rotationNode1 ~= nil then
        self.rotation1 = {};
        self.rotation1.node = rotationNode1;
        local x, y, z = Utils.getVectorFromString(getXMLString(xmlFile, "vehicle.rotation1#minRot"));
        self.rotation1.minRot = {};
        self.rotation1.minRot[1] = Utils.degToRad(Utils.getNoNil(x, 0));
        self.rotation1.minRot[2] = Utils.degToRad(Utils.getNoNil(y, 0));
        self.rotation1.minRot[3] = Utils.degToRad(Utils.getNoNil(z, 0));

        x, y, z = Utils.getVectorFromString(getXMLString(xmlFile, "vehicle.rotation1#maxRot"));
        self.rotation1.maxRot = {};
        self.rotation1.maxRot[1] = Utils.degToRad(Utils.getNoNil(x, 0));
        self.rotation1.maxRot[2] = Utils.degToRad(Utils.getNoNil(y, 0));
        self.rotation1.maxRot[3] = Utils.degToRad(Utils.getNoNil(z, 0));

        self.rotation1.rotTime = Utils.getNoNil(getXMLString(xmlFile, "vehicle.rotation1#rotTime"), 2)*1000;
        self.rotation1.touchRotLimit = Utils.degToRad(Utils.getNoNil(getXMLString(xmlFile, "vehicle.rotation1#touchRotLimit"), 10));
    end;
	local rotationNode2 = Utils.indexToObject(self.rootNode, getXMLString(xmlFile, "vehicle.rotation2#index"));
    if rotationNode2 ~= nil then
        self.rotation2 = {};
        self.rotation2.node = rotationNode2;
        local x, y, z = Utils.getVectorFromString(getXMLString(xmlFile, "vehicle.rotation2#minRot"));
        self.rotation2.minRot = {};
        self.rotation2.minRot[1] = Utils.degToRad(Utils.getNoNil(x, 0));
        self.rotation2.minRot[2] = Utils.degToRad(Utils.getNoNil(y, 0));
        self.rotation2.minRot[3] = Utils.degToRad(Utils.getNoNil(z, 0));

        x, y, z = Utils.getVectorFromString(getXMLString(xmlFile, "vehicle.rotation2#maxRot"));
        self.rotation2.maxRot = {};
        self.rotation2.maxRot[1] = Utils.degToRad(Utils.getNoNil(x, 0));
        self.rotation2.maxRot[2] = Utils.degToRad(Utils.getNoNil(y, 0));
        self.rotation2.maxRot[3] = Utils.degToRad(Utils.getNoNil(z, 0));

        self.rotation2.rotTime = Utils.getNoNil(getXMLString(xmlFile, "vehicle.rotation2#rotTime"), 2)*1000;
        self.rotation2.touchRotLimit = Utils.degToRad(Utils.getNoNil(getXMLString(xmlFile, "vehicle.rotation2#touchRotLimit"), 10));
    end;
	local rotationNode3 = Utils.indexToObject(self.rootNode, getXMLString(xmlFile, "vehicle.rotation3#index"));
    if rotationNode3 ~= nil then
        self.rotation3 = {};
        self.rotation3.node = rotationNode3;
        local x, y, z = Utils.getVectorFromString(getXMLString(xmlFile, "vehicle.rotation3#minRot"));
        self.rotation3.minRot = {};
        self.rotation3.minRot[1] = Utils.degToRad(Utils.getNoNil(x, 0));
        self.rotation3.minRot[2] = Utils.degToRad(Utils.getNoNil(y, 0));
        self.rotation3.minRot[3] = Utils.degToRad(Utils.getNoNil(z, 0));

        x, y, z = Utils.getVectorFromString(getXMLString(xmlFile, "vehicle.rotation3#maxRot"));
        self.rotation3.maxRot = {};
        self.rotation3.maxRot[1] = Utils.degToRad(Utils.getNoNil(x, 0));
        self.rotation3.maxRot[2] = Utils.degToRad(Utils.getNoNil(y, 0));
        self.rotation3.maxRot[3] = Utils.degToRad(Utils.getNoNil(z, 0));

        self.rotation3.rotTime = Utils.getNoNil(getXMLString(xmlFile, "vehicle.rotation3#rotTime"), 2)*1000;
        self.rotation3.touchRotLimit = Utils.degToRad(Utils.getNoNil(getXMLString(xmlFile, "vehicle.rotation3#touchRotLimit"), 10));
    end;
	local rotationNode4 = Utils.indexToObject(self.rootNode, getXMLString(xmlFile, "vehicle.rotation4#index"));
    if rotationNode4 ~= nil then
        self.rotation4 = {};
        self.rotation4.node = rotationNode4;
        local x, y, z = Utils.getVectorFromString(getXMLString(xmlFile, "vehicle.rotation4#minRot"));
        self.rotation4.minRot = {};
        self.rotation4.minRot[1] = Utils.degToRad(Utils.getNoNil(x, 0));
        self.rotation4.minRot[2] = Utils.degToRad(Utils.getNoNil(y, 0));
        self.rotation4.minRot[3] = Utils.degToRad(Utils.getNoNil(z, 0));

        x, y, z = Utils.getVectorFromString(getXMLString(xmlFile, "vehicle.rotation4#maxRot"));
        self.rotation4.maxRot = {};
        self.rotation4.maxRot[1] = Utils.degToRad(Utils.getNoNil(x, 0));
        self.rotation4.maxRot[2] = Utils.degToRad(Utils.getNoNil(y, 0));
        self.rotation4.maxRot[3] = Utils.degToRad(Utils.getNoNil(z, 0));

        self.rotation4.rotTime = Utils.getNoNil(getXMLString(xmlFile, "vehicle.rotation4#rotTime"), 2)*1000;
        self.rotation4.touchRotLimit = Utils.degToRad(Utils.getNoNil(getXMLString(xmlFile, "vehicle.rotation4#touchRotLimit"), 10));
    end;

	local rotationNode5 = Utils.indexToObject(self.rootNode, getXMLString(xmlFile, "vehicle.rotation5#index"));
        self.rotation5 = {};
          self.rotation5.node = rotationNode5;

	local rotationNode6 = Utils.indexToObject(self.rootNode, getXMLString(xmlFile, "vehicle.rotation6#index"));
        self.rotation6 = {};
          self.rotation6.node = rotationNode6;	

	local rotationNode7 = Utils.indexToObject(self.rootNode, getXMLString(xmlFile, "vehicle.rotation7#index"));
        self.rotation7 = {};
          self.rotation7.node = rotationNode7;	

	local rotationNode8 = Utils.indexToObject(self.rootNode, getXMLString(xmlFile, "vehicle.rotation8#index"));
        self.rotation8 = {};
          self.rotation8.node = rotationNode8;

	local rotationNode9 = Utils.indexToObject(self.rootNode, getXMLString(xmlFile, "vehicle.rotation9#index"));
        self.rotation9 = {};
          self.rotation9.node = rotationNode9;

	local rotationNode10 = Utils.indexToObject(self.rootNode, getXMLString(xmlFile, "vehicle.rotation10#index"));
        self.rotation10 = {};
          self.rotation10.node = rotationNode10;

	local rotationNode11 = Utils.indexToObject(self.rootNode, getXMLString(xmlFile, "vehicle.rotation11#index"));
        self.rotation11 = {};
          self.rotation11.node = rotationNode11;

	local rotationNode12 = Utils.indexToObject(self.rootNode, getXMLString(xmlFile, "vehicle.rotation12#index"));
        self.rotation12 = {};
          self.rotation12.node = rotationNode12;

	local rotationNode13 = Utils.indexToObject(self.rootNode, getXMLString(xmlFile, "vehicle.rotation13#index"));
        self.bottomArm2 = {};
          self.bottomArm2.node = rotationNode13;

	local BottomArmNode = Utils.indexToObject(self.rootNode, getXMLString(xmlFile, "vehicle.attacherJoints.attacherJoint.bottomArm#rotationNode"));
        self.bottomArm = {};
          self.bottomArm.node = BottomArmNode;

      local translationNode1 = Utils.indexToObject(self.rootNode, getXMLString(xmlFile, "vehicle.translation1#index"));
      if translationNode1 ~= nil then
        self.translation1 = {};
        self.translation1.node = translationNode1;
        local x, y, z = Utils.getVectorFromString(getXMLString(xmlFile, "vehicle.translation1#minTrans"));
        self.translation1.minTrans = {};
        self.translation1.minTrans[1] = Utils.getNoNil(x, 0);
        self.translation1.minTrans[2] = Utils.getNoNil(y, 0);
        self.translation1.minTrans[3] = Utils.getNoNil(z, 0);

        x, y, z = Utils.getVectorFromString(getXMLString(xmlFile, "vehicle.translation1#maxTrans"));
        self.translation1.maxTrans = {};
        self.translation1.maxTrans[1] = Utils.getNoNil(x, 0);
        self.translation1.maxTrans[2] = Utils.getNoNil(y, 0);
        self.translation1.maxTrans[3] = Utils.getNoNil(z, 0);

        self.translation1.transTime = Utils.getNoNil(getXMLString(xmlFile, "vehicle.translation1#transTime"), 2)*1000;
        self.translation1.touchTransLimit = Utils.getNoNil(getXMLString(xmlFile, "vehicle.translation1#touchTransLimit"), 10);
    end; 


    hornSoundFile = Utils.getFilename("horn.wav", self.baseDirectory);
    self.hornSoundId = createSample("MF1200_horn");
    loadSample(self.hornSoundId, hornSoundFile, false);
    self.hornPlaying = false;

    steerHydSoundFile = Utils.getFilename("mf1200_steerHyd.wav", self.baseDirectory);
    self.steerHydSoundId = createSample("MF1200_steerSound");
    loadSample(self.steerHydSoundId, steerHydSoundFile, false);
    self.steerHydPlaying = false;

	local needleTempNode = Utils.indexToObject(self.rootNode, getXMLString(xmlFile, "vehicle.needleTemp#index"));
     if needleTempNode ~= nil then
        self.needleTemp = {};
        self.needleTemp.node = needleTempNode;
        local x, y, z = Utils.getVectorFromString(getXMLString(xmlFile, "vehicle.needleTemp#minRot"));
        self.needleTemp.minRot = {};
        self.needleTemp.minRot[1] = Utils.degToRad(Utils.getNoNil(x, 0));
        self.needleTemp.minRot[2] = Utils.degToRad(Utils.getNoNil(y, 0));
        self.needleTemp.minRot[3] = Utils.degToRad(Utils.getNoNil(z, 0));

        x, y, z = Utils.getVectorFromString(getXMLString(xmlFile, "vehicle.needleTemp#maxRot"));
        self.needleTemp.maxRot = {};
        self.needleTemp.maxRot[1] = Utils.degToRad(Utils.getNoNil(x, 0));
        self.needleTemp.maxRot[2] = Utils.degToRad(Utils.getNoNil(y, 0));
        self.needleTemp.maxRot[3] = Utils.degToRad(Utils.getNoNil(z, 0));

        self.needleTemp.rotTime = Utils.getNoNil(getXMLString(xmlFile, "vehicle.needleTemp#rotTime"), 2)*3000;
        self.needleTemp.touchRotLimit = Utils.degToRad(Utils.getNoNil(getXMLString(xmlFile, "vehicle.needleTemp#touchRotLimit"), 10));
    end;

	self.needleRPM = Utils.indexToObject(self.rootNode, getXMLString(xmlFile, "vehicle.needleRPM#index"));
	self.needleSpeed = Utils.indexToObject(self.rootNode, getXMLString(xmlFile, "vehicle.needleSpeed#index"));
	self.needleGas = Utils.indexToObject(self.rootNode, getXMLString(xmlFile, "vehicle.needleGas#index"));
	self.needleBattery = Utils.indexToObject(self.rootNode, getXMLString(xmlFile, "vehicle.needleBattery#index"));

	tempRot1 = 0;
	tempRot = 0;
	tempCount = 0;

	--worklight
	local numWorkLights = Utils.getNoNil(getXMLInt(xmlFile, "vehicle.worklights#count"), 0);
    self.worklights = {};
    for i=1, numWorkLights do
        local worklightnamei = string.format("vehicle.worklights.worklight%d", i);
        self.worklights[i] = Utils.indexToObject(self.components, getXMLString(xmlFile, worklightnamei .. "#index"));
        setVisibility(self.worklights[i], false);
    end;
	self.worklightsActive = true;


	numLights = Utils.getNoNil(getXMLInt(xmlFile, "vehicle.lights#count"), 0);
	self.lights = {};
    for i=1, numLights do
        local lightnamei = string.format("vehicle.lights.light%d", i);
        self.lights[i] = Utils.indexToObject(self.components, getXMLString(xmlFile, lightnamei .. "#index"));
        setVisibility(self.lights[i], false);
    end;

	-- helpPanel
	self.helpPanelTextPosX = 0.01;
	self.helpPanelTextPosY = 0.19;
	self.helpPanelActive = false;

end;
      
function MF1200:delete()
    delete(self.hornSoundId);
    delete(self.steerHydSoundId);

end;

function MF1200:mouseEvent(posX, posY, isDown, isUp, button)
end;
	  
function MF1200:keyEvent(unicode, sym, modifier, isDown)

	if sym == Input.KEY_KP_7 then
		self.rotation1Max = isDown;
		self.rotation2Min = isDown;
	end;
	if sym == Input.KEY_KP_8 then
		self.rotation1Min = isDown;
		self.rotation2Max = isDown;
	end;
	if sym == Input.KEY_KP_6 then
		self.rotation3Min = isDown;
		self.rotation4Min = isDown;
	end;
	if sym == Input.KEY_KP_9 then
		self.rotation3Max = isDown;
		self.rotation4Max = isDown;
	end;
	if sym == Input.KEY_KP_4 then
		self.translation1Max = isDown;
	end;
	if sym == Input.KEY_KP_1 then
		self.translation1Min = isDown;
	end;

	self.needleTempMin = isDown;

	
end;


function MF1200:update(dt)
	
  for i=1, table.getn(self.wheels) do
	twx,twy,twz = getTranslation(self.wheels[i].repr);
	wrx,wry,wrz = getRotation(self.wheels[i].repr);
	wNrx,wNry,wNrz = getRotation(self.wheels[i].driveNode);

  end;

	local doRotate = self.rotation1Max or self.rotation1Min 
	if self.rotation1 ~= nil and doRotate then
        local x1r, y1r, z1r = getRotation(self.rotation1.node);
        local rot = {x1r,y1r,z1r};
        local newRot = Utils.getMovedLimitedValues(rot, self.rotation1.maxRot, self.rotation1.minRot, 3, self.rotation1.rotTime, dt, not self.rotation1Max);
        setRotation(self.rotation1.node, unpack(newRot));
    end;
	local doRotate = self.rotation2Max or self.rotation2Min 
	if self.rotation2 ~= nil and doRotate then
        local x1r, y1r, z1r = getRotation(self.rotation2.node);
        local rot = {x1r,y1r,z1r};
        local newRot = Utils.getMovedLimitedValues(rot, self.rotation2.maxRot, self.rotation2.minRot, 3, self.rotation2.rotTime, dt, not self.rotation2Max);
        setRotation(self.rotation2.node, unpack(newRot));
    end;
	local doRotate = self.rotation3Max or self.rotation3Min 
	if self.rotation3 ~= nil and doRotate then
        local x1r, y1r, z1r = getRotation(self.rotation3.node);
        local rot = {x1r,y1r,z1r};
        local newRot = Utils.getMovedLimitedValues(rot, self.rotation3.maxRot, self.rotation3.minRot, 3, self.rotation3.rotTime, dt, not self.rotation3Max);
        setRotation(self.rotation3.node, unpack(newRot));
    end;
	local doRotate = self.rotation4Max or self.rotation4Min 
	if self.rotation4 ~= nil and doRotate then
        local x1r, y1r, z1r = getRotation(self.rotation4.node);
        local rot = {x1r,y1r,z1r};
        local newRot = Utils.getMovedLimitedValues(rot, self.rotation4.maxRot, self.rotation4.minRot, 3, self.rotation4.rotTime, dt, not self.rotation4Max);
        setRotation(self.rotation4.node, unpack(newRot));
    end;

	if self.rotation5.node ~= nil and wry ~= nil then
        setRotation(self.rotation5.node, 0, -wry, 0);
    end;
	if self.rotation6.node ~= nil and wry ~= nil then
        setRotation(self.rotation6.node, 0, -wry, 0);
    end;
	if self.rotation7.node ~= nil and wry ~= nil then
        setRotation(self.rotation7.node, 0, 0, wNrx*2);
    end;
	if self.rotation8.node ~= nil and wry ~= nil then
        setRotation(self.rotation8.node, 0, 0, wNrx*2);
    end;
	if self.rotation9.node ~= nil and self.bottomArm.node ~= nil then
	  rBFArmX, rBFArmY, rBFArmZ = getRotation(self.bottomArm.node);
        setRotation(self.rotation9.node, rBFArmX*1.1, 0, 0);
    end;
	if self.rotation10.node ~= nil and self.bottomArm.node ~= nil then
        setRotation(self.rotation10.node, rBFArmX/7, 0, 0);
    end;

	if self.rotation11.node ~= nil and self.bottomArm2.node ~= nil then
	  rBBArmX, rBBArmY, rBBArmZ = getRotation(self.bottomArm2.node);
        setRotation(self.rotation11.node, rBBArmX*1.5-0.35, 0, 0);
    end;
	if self.rotation12.node ~= nil and self.bottomArm2.node ~= nil then
        setRotation(self.rotation12.node, 0.278-rBBArmX*1.4, 0, 0);
    end;

	local doTranslate = self.translation1Max or self.translation1Min 
	if self.translation1 ~= nil and doTranslate then 
		local x, y, z = getTranslation(self.translation1.node); 
		local trans = {x,y,z}; 
		local newTrans = Utils.getMovedLimitedValues(trans, self.translation1.maxTrans, self.translation1.minTrans, 3, self.translation1.transTime, dt, not self.translation1Max); 
		setTranslation(self.translation1.node, unpack(newTrans)); 
	end; 

    if self:getIsActiveForInput() and self:getIsActiveForSound() and InputBinding.isPressed(InputBinding.MF1200_HORN) then
        if not self.hornPlaying then
            playSample(self.hornSoundId, 0, 1, 0);
            self.hornPlaying = true;
        end;
    else
        if self.hornPlaying then
            stopSample(self.hornSoundId);
            self.hornPlaying = false;
        end;
    end;
    if  self.isMotorStarted and wry ~= 0 and math.abs(wry) < 0.226 then
        if not self.steerHydPlaying then
            playSample(self.steerHydSoundId, 0, 1, 0);
            self.steerHydPlaying = true;
        end;
    else
        if self.steerHydPlaying then
            stopSample(self.steerHydSoundId);
            self.steerHydPlaying = false;
        end;
    end;


-- -------------------needleRPM + Speed + Gas----------------------

	if self.isMotorStarted then
		rotNSX, rotNSY, rotNSZ = getRotation(self.needleSpeed);
		local rotNSY = Utils.degToRad(self.motor.nonClampedMotorRpm/15);
		rotX, rotY, rotZ = getRotation(self.needleRPM);
		local rotY = Utils.degToRad((self.motor.nonClampedMotorRpm+200)/12);
		local rotNGX, rotNGY, rotNGZ = getRotation(self.needleGas);

	local fuelLevel = (-self.fuelFillLevel / 318 ) *1.5;
	setRotation(self.needleGas, rotNGx, fuelLevel, rotNGZ);

	


		if tempCount < 3 then
			tempRot = tempRot + rotY;
			tempRot1 = tempRot1 + rotNSY;
			tempCount = tempCount + 1;
		  else
			rotSNY = tempRot1/4;
			tempRot1 = 0;
			rotNY = tempRot/4;
			tempRot = 0;
			tempCount = 0;

		  if self.motor.minRpm < 0 then
			rotNSY = rotNSY-Utils.degToRad(self.motor.minRpm/15);
			rotY = rotY-Utils.degToRad(self.motor.minRpm/12);
		  else
			rotNSY = rotSNY;
			setRotation(self.needleSpeed, rotNSX, -rotNSY, rotNSZ);
			rotY = rotNY;
			setRotation(self.needleRPM, rotX, rotY, rotZ);
		  end;

		  if rotY < Utils.degToRad(0) then
			rotY = Utils.degToRad(0);
			setRotation(self.needleRPM, rotX, rotY, rotZ);
		  end;

		  if rotY > Utils.degToRad(150) then
			rotY = Utils.degToRad(150);
			setRotation(self.needleRPM, rotX, rotY, rotZ);
		  end;
		  if rotNSY < Utils.degToRad(0) then
			rotNSY = Utils.degToRad(0);
			setRotation(self.needleSpeed, rotNSX, -rotNSY, rotNSZ);
		  end;

		  if rotNSY > Utils.degToRad(120) then
			rotNSY = Utils.degToRad(120);
			setRotation(self.needleSpeed, rotNSX, -rotNSY, rotNSZ);
		  end;
		end;
	else
		setRotation(self.needleSpeed, rotNSX, 0, rotNSZ);
		setRotation(self.needleRPM, rotX, 0, rotZ);
		setRotation(self.needleGas, rotNGX, 0, rotNGZ);
	end;
-- -------------------------needleBattery + Temp--------------------------------
	if self.isMotorStarted then
		local rotNBX, rotNBY, rotNBZ = getRotation(self.needleBattery);
		setRotation(self.needleBattery, rotNBX, -1, rotNBZ);
		
		local doRotate = self.needleTempMax or self.needleTempMin 
		if self.needleTemp ~= nil and doRotate then
			rotNTX, rotNTY, rotNTZ = getRotation(self.needleTemp.node);
			local rotNT = {rotNTX, rotNTY, rotNTZ};
        		local newRotNT = Utils.getMovedLimitedValues(rotNT, self.needleTemp.maxRot, self.needleTemp.minRot, 3, self.needleTemp.rotTime, dt, not self.needleTempMax);
        		setRotation(self.needleTemp.node, unpack(newRotNT));
		end;
	else
		setRotation(self.needleBattery, rotNBX, 0, rotNBZ);
		setRotation(self.needleTemp.node, rotNTX, 0, rotNTZ);
	end;

	-- worklight
	if self.isEntered then
		if InputBinding.hasEvent(InputBinding.WORKLIGHTS) or self.backLight == false then
			self.worklightsActive = not self.worklightsActive;
			self.tempActive = not self.worklightsActive;
			self.backLight = true;


			
	
		end;
	
		for k, worklight in pairs(self.worklights) do
			setVisibility(worklight, self.worklightsActive);
		end;
	end;

		-- helpPanel
		if InputBinding.hasEvent(InputBinding.MF_HELPPANEL) then
			self.helpPanelActive = not self.helpPanelActive;
		end;

end;

function MF1200:onLeave()
	
end;

function MF1200:draw()

-- -------------------------helpPanel--------------------------------

	if self.helpPanelActive then
		renderText(self.helpPanelTextPosX, self.helpPanelTextPosY, 0.02, string.format("Taste %s: %s", InputBinding.getButtonKeyName(InputBinding.MF1200_HORN), g_i18n:getText("MF1200_horn")));
		renderText(self.helpPanelTextPosX, self.helpPanelTextPosY-0.02, 0.02, string.format(" : %s", g_i18n:getText("MF1200_Start")));
		renderText(self.helpPanelTextPosX, self.helpPanelTextPosY-0.04, 0.02, string.format("Taste %s: %s", InputBinding.getButtonKeyName(InputBinding.MF_IGNITION), g_i18n:getText("MF1200_Start")));

		renderText(self.helpPanelTextPosX, self.helpPanelTextPosY-0.06, 0.02, string.format("Taste f : %s", g_i18n:getText("MF1200_S-Lights")));
			if self.worklightsActive then
			renderText(self.helpPanelTextPosX, self.helpPanelTextPosY-0.08, 0.02, string.format("Taste %s: %s", InputBinding.getButtonKeyName(InputBinding.WORKLIGHTS), g_i18n:getText("MF1200_worklightOff")));
			else
			renderText(self.helpPanelTextPosX, self.helpPanelTextPosY-0.08, 0.02, string.format("Taste %s: %s", InputBinding.getButtonKeyName(InputBinding.WORKLIGHTS), g_i18n:getText("MF1200_worklightOn")));
			end;
		renderText(self.helpPanelTextPosX, self.helpPanelTextPosY-0.1, 0.02, string.format("KP 9/6 : %s", g_i18n:getText("MF1200_MirrorsUpDown")));
		renderText(self.helpPanelTextPosX, self.helpPanelTextPosY-0.12, 0.02, string.format("KP 7/8 : %s", g_i18n:getText("MF1200_MirrorsLR")));
		renderText(self.helpPanelTextPosX, self.helpPanelTextPosY-0.14, 0.02, string.format("KP 4/1 : %s", g_i18n:getText("MF1200_MoveAttacher")));
		renderText(self.helpPanelTextPosX, self.helpPanelTextPosY-0.18, 0.03, string.format("Taste %s: %s", InputBinding.getButtonKeyName(InputBinding.MF_HELPPANEL), g_i18n:getText("MF1200_helpPanelOn")));
	else
	renderText(self.helpPanelTextPosX, self.helpPanelTextPosY-0.18, 0.03, string.format("Taste %s: %s", InputBinding.getButtonKeyName(InputBinding.MF_HELPPANEL), g_i18n:getText("MF1200_helpPanelOff")));
	end;

end;

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