--
-- 
-- Autor: Luxfarm
--

cadre = {};

function cadre.prerequisitesPresent(specializations)
    return true;
end;

function cadre:load(xmlFile)
	self.PlaneNodeO = Utils.indexToObject(self.components, getXMLString(xmlFile,"vehicle.cadre#indexOpen"));
	self.PlaneNodeC = Utils.indexToObject(self.components, getXMLString(xmlFile,"vehicle.cadre#indexClose"));
	self.isOpen = true;
	setVisibility(self.PlaneNodeO, not self.isOpen);
	setVisibility(self.PlaneNodeC, self.isOpen);
end;

function cadre:delete()
end;

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

function cadre:keyEvent(unicode, sym, modifier, isDown)
	if isDown and sym == Input.KEY_b then
		self.isOpen = not self.isOpen;
	end;
end;

function cadre:update(dt)	
	if self:getIsActive() and self:getIsActiveForInput() then
		setVisibility(self.PlaneNodeO, not self.isOpen);
		setVisibility(self.PlaneNodeC, self.isOpen);
	end;
end;


function cadre:draw()
	if self.isOpen then
		g_currentMission:addExtraPrintText(string.format("Tuyau/Pipe : B"));
	else
		g_currentMission:addExtraPrintText(string.format("Tuyau/Pipe: B"));
	end;
end;


function cadre:onAttach(attacherVehicle)
end;


function cadre:onDetach()
end;


function cadre:onLeave()
end;


function cadre:onDeactivate()
end;


function cadre:onDeactivateSounds()
end;
