--
-- self
-- Class for all self
--
-- @author  Mario
-- @date  25/04/10
--
-- Copyright (C) Mario

mirror = {};

function mirror.prerequisitesPresent(specializations)
    return SpecializationUtil.hasSpecialization(Trailer, specializations);
end;

function mirror:load(xmlFile)

    self.mirrors = {};
    self.mirrors[1] = Utils.indexToObject(self.rootNode, getXMLString(xmlFile, "vehicle.mirrors.mirror1#index"));
    self.mirrors[2] = Utils.indexToObject(self.rootNode, getXMLString(xmlFile, "vehicle.mirrors.mirror2#index"));
	
end;

function mirror:keyEvent(unicode, sym, modifier, isDown)

    if isDown and sym == Input.KEY_x then 
		self.drawMirror = not self.drawMirror;
		setVisibility(self.mirrors[1], self.drawMirror);
    	setVisibility(self.mirrors[2], self.drawMirror);
	end;
	
	        if isDown and sym == Input.KEY_KP_0 then
		self.helpPanel = not self.helpPanel;
	end;

end;


function mirror:update(dt)
end;

function mirror:draw()

     if self.attacherVehicle then
		if not self.helpPanel then
			renderText(0.82, 0.24, 0.02, "KP 0: Info an");

		else
			renderText(0.82, 0.24, 0.02, "KP 0: Info aus");

		end;
		if self.helpPanel then
			renderText(0.7635, 0.40, 0.025, "- Fliegl DDK 240 Info -");
			renderText(0.7635, 0.365, 0.02, "Taste X Plane auf/zu");
		end;
	end;
end;

function mirror:onEnter()

end;

function mirror:onLeave()
end;

function mirror:delete()
end;

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