
RPM = {};
local rpm_directory = g_currentModDirectory;

function RPM.prerequisitesPresent(specializations)
    return SpecializationUtil.hasSpecialization(Motorized, specializations);
end;

function RPM:load(xmlFile)
	self.RPMPosX = 0.402; -- Horizontal verschieben 8543
    self.RPMWidth = 0.10; -- Overlaytextur Breite 134
    self.RPMPosY = 0.01238; -- Vertikal verschieben 5125
    self.RPMHeight = 0.04; -- Overlaytextur Höhe
	self.RPMHudOverlay = Overlay:new("RPMHUDOverlay", Utils.getFilename("rpmHud.dds", breakEngine.modDir.."tex/"), self.RPMPosX, self.RPMPosY, self.RPMWidth, self.RPMHeight);
end;

function RPM:delete()
end;

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

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

function RPM:update(dt)
	
end;

function RPM:draw()

	if self:getIsActive() then
		if self.isMotorStarted == false then
			
			setTextBold(true);
			setTextAlignment(RenderText.ALIGN_RIGHT);
			setTextColor(1, 0, 0, 1);
			renderText(0.91, 0.14, 0.03, "0"); -- 0.105
		end;
		if self.isMotorStarted == true then	
			if self.motor.lastMotorRpm > 2000 then
				setTextBold(true);
				setTextAlignment(RenderText.ALIGN_RIGHT);
				setTextColor(1, 0, 0, 1);
				renderText(0.91, 0.14, 0.03, tostring(math.floor(self.motor.lastMotorRpm)));
			else
				setTextBold(true);
				setTextAlignment(RenderText.ALIGN_RIGHT);
				setTextColor(0, 1, 0, 1);
				renderText(0.91, 0.14, 0.03, tostring(math.floor(self.motor.lastMotorRpm)));
			end;
		end;
	end;
end;

function RPM:onLeave()

end;
