--siudix29--
--

ShowHelp = {};

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

function ShowHelp:load(xmlFile)
	self.hudPosX = 0.63;    
    self.hudPosY = 0.3;
	self.hudWidth = 0.3;
    self.hudHeight = 0.55;
	
	self.hudPomocy = Utils.getFilename("Tekstura/hud.dds", self.baseDirectory);
	self.hudPomocyOverlay = Overlay:new("allrad_symb_yes", self.hudPomocy, self.hudPosX, self.hudPosY, self.hudWidth, self.hudHeight);

	self.showHelp = false;
end;

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

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

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

function ShowHelp:update(dt)
	if self.isEntered then
		if InputBinding.hasEvent(InputBinding.TOGGLE_SHOW_HELP) then
			self.showHelp = not self.showHelp;
		end;
	end;
end;

function ShowHelp:updateTick(dt)
end;

function ShowHelp:draw()
	if not self.showHelp then
		renderText(0.72, 0.20, 0.02, "Wcisnij Numpad 0: Info");
	else
		self.hudPomocyOverlay:render();
		--[[ Koordinaten sind aus der F930.lua - Author leider unbekannt
		renderText(0.72, 0.86, 0.022, "-> ZETOR FORTERRA by Marlin&siudix29 <-");			
		renderText(0.72, 0.81, 0.02, "Wcisnij Numpad 2: Awaryjne");
		renderText(0.72, 0.79, 0.02, "Wcisnij Numpad 1: Kierunkowskaz Lewy");			
		renderText(0.72, 0.75, 0.02, "Wcisnij Numpad 3: Kierunkowskaz Prawy");
		renderText(0.72, 0.77, 0.02, "Wcisnij Numpad 5: Swiatla robocze przod");
		renderText(0.72, 0.73, 0.02, "Wcisnij Numpad 6: Swiatla robocze tyl");
		renderText(0.72, 0.71, 0.02, "Wcisnij Spacja: Tryb Interaktywny");
		renderText(0.72, 0.69, 0.02, "---");
		renderText(0.72, 0.67, 0.02, "---");
		renderText(0.72, 0.65, 0.02, "---");
		renderText(0.72, 0.63, 0.02, "---");
		renderText(0.72, 0.61, 0.02, "---");
		renderText(0.72, 0.59, 0.02, "---");
		renderText(0.72, 0.57, 0.02, "---");
		renderText(0.72, 0.55, 0.02, "---");
	    renderText(0.72, 0.53, 0.02, "---");
	    renderText(0.72, 0.51, 0.02, "---");
	    renderText(0.72, 0.49, 0.02, "---");]]
	end;
end;

function ShowHelp:onLeave()
	self.showHelp = false;
end;