--                    .----.            .------------------`    -------.         -------.             
--                   .NMMMMm.           dMMMMMMMMMMMMMMMMMM:   `mMMMMMMM-       +MMMMMMMy             
--                  `dMMMMMMd           dMMMMMMMMMMMMMMMMMM:   `mMMMMMMMy      `mMMMMMMMy             
--                  yMMMMMMMMs          dMMMM/                 `mMMMMNMMM-     oMMMNMMMMy             
--                 +MMMMoyMMMM+         dMMMM/                 `mMMMMoMMMh    `mMMNoMMMMy             
--                -NMMMh `mMMMN:        dMMMMs------------`    `mMMMM.mMMM:   oMMMy:MMMMy             
--               .mMMMN.  -NMMMN.       dMMMMMMMMMMMMMMMMM:    `mMMMN`+MMMd  .NMMM-:MMMMy             
--               hMMMM/    +MMMMd`      dMMMMMNNNNNNNNNNNN:    `mMMMN``mMMM/ sMMMh :MMMMy             
--              sMMMMNhyyyyhMMMMMy      dMMMM/                 `mMMMN` oMMMm-NMMM- -MMMMy             
--             /MMMMMMMMMMMMMMMMMM+     dMMMM/                 `mMMMN  `NMMMmMMMh  -MMMMy             
--            -NMMMNsoooooooosNMMMM:    dMMMM/                 `mMMMN   oMMMMMMM:  -MMMMy             
--           `mMMMM+          +MMMMN.   dMMMMmhhhhhhhhhhhhhs   `mMMMN   .NMMMMMd   -MMMMy             
--           hMMMMh            yMMMMd`  dMMMMMMMMMMMMMMMMMMh   `mMMMm    sMMMMM:   .MMMMy             
--          .ooooo`            `ooooo-  /oooooooooooooooooo/    +ooo+    `oooo+    `oooo:      
--MPREADY: American Eagles Modteam (TwistedGA & looseterror)
--www.americaneaglesmodding.com
--looseterror & TwistedGA (American Eagles Modteam)
--jackStand
-- Specialization for jackStand
--

jackStand = {};

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

function jackStand:load(xmlFile)
	
	self.stand = Utils.indexToObject(self.components, getXMLString(xmlFile, "vehicle.stand#index"));
	self.stand_x, self.stand_y, self.stand_z = getTranslation(self.stand);
	self.standUpTranslation = self.stand_y + 10.5;
	self.standCurTranslation = self.stand_y;
	self.standDownTranslation = self.stand_y;
	self.standDown = true;
end;

function jackStand:delete()
end;


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

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

function jackStand:update(dt)	
	for i, jointDesc in pairs(self.componentJoints) do
	   setJointFrame(self.componentJoints[i].jointIndex, 0, self.componentJoints[i].jointNode);
	end;	
	-- Set self.standDown
	if self.attacherVehicle ~= nil then
		self.standDown = false;
	else
		self.standDown = true;
	end;
-- Increase/Decrease standCurTranslation, Update Translation
	if self.standDown then
		if self.standCurTranslation > self.standDownTranslation then
			self.standCurTranslation = self.standCurTranslation - 0.14;
		end;
		setTranslation(self.stand, self.stand_x, self.standCurTranslation, self.stand_z);
	else
		if self.standCurTranslation < self.standUpTranslation then
			self.standCurTranslation = self.standCurTranslation + 0.14;
		end;
		setTranslation(self.stand, self.stand_x, self.standCurTranslation, self.stand_z);
	end;	
end;

function jackStand:draw()
end;

function jackStand:onAttach(attacherVehicle)
end;

function jackStand:onDetach()
end;

function jackStand:onLeave()
end;

function jackStand:onDeactivate()
end;

function jackStand:onDeactivateSounds()
end;