

-- by namreh78
--

InfoPanel = {};

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

function InfoPanel:load(xmlFile)


	--  Info Hud --
	self.hudInfoPosX = 0.02;
    self.hudInfoWidth = 0.16;
    self.hudInfoPosY = 0.02;
    self.hudInfoHeight = 0.4;

	self.infoPanelInfoPath = Utils.getFilename("hud/menu.png", self.baseDirectory);
	self.hudInfoOverlay = Overlay:new("hudInfoOverlay", self.infoPanelInfoPath, self.hudInfoPosX, self.hudInfoPosY, self.hudInfoWidth, self.hudInfoHeight);

	self.showhudInfo = false;


end;

function InfoPanel:delete()

     	--  Info Hud --
    if self.hudInfoOverlay ~= nil then
		self.hudInfoOverlay:delete();
	end;

end;

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

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

function InfoPanel:update(dt)

    if self:getIsActiveForInput() and self.isEntered then
    

		if InputBinding.hasEvent(InputBinding.InfoPanel01) then
		    self.showhudInfo = not self.showhudInfo;
		end;
		


   		

	end;			 

end;

function InfoPanel:draw()


  	if self.showhudInfo and self.isEntered then
		self.hudInfoOverlay:render();
	end;

	if not self.isMotorStarted then	renderText(0.72, 0.30, 0.02, "Taste Numpad 0: Info Einschalten");
	end;

end;

