module Base
{

	model 91fordRangerWindowfl
	{
		mesh = vehicles/Vehicles_91fordRanger_Body|91ranger_window_fl,
		shader = damn_vehicle_shader,
		static = FALSE,
		scale = 0.1,
		boneWeight = window_fl_bone 1.0,
	}

	model 91fordRangerWindowfr
	{
		mesh = vehicles/Vehicles_91fordRanger_Body|91ranger_window_fr,
		shader = damn_vehicle_shader,
		static = FALSE,
		scale = 0.1,
		boneWeight = window_fr_bone 1.0,
	}

    model 91fordRangerWindowbl
	{
		mesh = vehicles/Vehicles_91fordRanger_Body|91ranger_window_bl,
		shader = damn_vehicle_shader,
		scale = 0.1,
	}

	model 91fordRangerWindowbr
	{
		mesh = vehicles/Vehicles_91fordRanger_Body|91ranger_window_br,
		shader = damn_vehicle_shader,
		scale = 0.1,
	}

	template vehicle RNG91WindowsFront
	{
		part WindowFrontLeft
		{
			model windowFL
			{
				file = 91fordRangerWindowfl,
			}

			anim ClosedToOpen
			{
				anim = window_fl_opening,
				animate = FALSE,
			}

			parent = DoorFrontLeft,
			area = SeatFrontLeft,
			itemType = Base.91fordRangerFrontSideWindow,
			table install
			{
				requireInstalled = DoorFrontLeft,
			}
			table uninstall
				{
				requireUninstalled = DAMNFrontLeftArmor,
				}
		}

		part WindowFrontRight
		{
			model windowFR
			{
				file = 91fordRangerWindowfr,
			}

			anim ClosedToOpen
			{
				anim = window_fr_opening,
				animate = FALSE,
			}

			parent = DoorFrontRight,
			area = SeatFrontRight,
			itemType = Base.91fordRangerFrontSideWindow,
			table install
			{
				requireInstalled = DoorFrontRight,
			}
			table uninstall
				{
				requireUninstalled = DAMNFrontRightArmor,
				}
		}

		part Window*
		{
			category = door,
			mechanicRequireKey = true,
            durability = 2,
             
			window
			{
				openable = true,
			}
			table install
			{
				items
				{
					1
					{
						type = Base.Screwdriver,
						count = 1,
						keep = true,
						equip = primary,
					}
				}
				time = 500,
				skills = Mechanics:3,
				recipes = Intermediate Mechanics,
				test = Vehicles.InstallTest.Default,
				complete = Vehicles.InstallComplete.Window,
			}
			table uninstall
			{
				items
				{
					1
					{
						type = Base.Screwdriver,
						count = 1,
						keep = true,
						equip = primary,
					}
				}
				time = 500,
				skills = Mechanics:3,
				recipes = Intermediate Mechanics,
				test = Vehicles.UninstallTest.Default,
				complete = Vehicles.UninstallComplete.Default,
			}
			lua
			{
				create = Vehicles.Create.Window,
				init = Vehicles.Init.Window,
			}
		}
	}

    template vehicle RNG91WindowsRear
	{
		part WindowRearLeft
		{
			model windowRL
			{
				file = 91fordRangerWindowbl,
			}

			area = SeatFrontLeft,
			itemType = Base.91fordRangerBackSideWindow,
			table uninstall
				{
				requireUninstalled = DAMNBackLeftArmor,
				}
		}

		part WindowRearRight
		{
			model windowRR
			{
				file = 91fordRangerWindowbr,
			}

			area = SeatFrontRight,
			itemType = Base.91fordRangerBackSideWindow,
			table uninstall
				{
				requireUninstalled = DAMNBackRightArmor,
				}
		}

		part Window*
		{
			category = door,
			mechanicRequireKey = true,
            durability = 2,
             
			window
			{
				openable = true,
			}
			table install
			{
				items
				{
					1
					{
						type = Base.Screwdriver,
						count = 1,
						keep = true,
						equip = primary,
					}
				}
				time = 500,
				skills = Mechanics:3,
				recipes = Intermediate Mechanics,
				test = Vehicles.InstallTest.Default,
				complete = Vehicles.InstallComplete.Window,
			}
			table uninstall
			{
				items
				{
					1
					{
						type = Base.Screwdriver,
						count = 1,
						keep = true,
						equip = primary,
					}
				}
				time = 500,
				skills = Mechanics:3,
				recipes = Intermediate Mechanics,
				test = Vehicles.UninstallTest.Default,
				complete = Vehicles.UninstallComplete.Default,
			}
			lua
			{
				create = Vehicles.Create.Window,
				init = Vehicles.Init.Window,
			}
		}
	}
}

