module Base
{

	model 90bmwE302doorWindowfl
	{
		mesh = vehicles/Vehicles_90bmwE30_Body|e30_2door_window_fl,
		shader = damn_vehicle_shader,
		static = FALSE,
		scale = 0.1,
	}

	model 90bmwE302doorWindowfr
	{
		mesh = vehicles/Vehicles_90bmwE30_Body|e30_2door_window_fr,
		shader = damn_vehicle_shader,
		static = FALSE,
		scale = 0.1,
	}

	model 90bmwE302doorWindowrl
	{
		mesh = vehicles/Vehicles_90bmwE30_Body|e30_2door_window_rl,
		shader = damn_vehicle_shader,
		scale = 0.1,
	}

	model 90bmwE302doorWindowrr
	{
		mesh = vehicles/Vehicles_90bmwE30_Body|e30_2door_window_rr,
		shader = damn_vehicle_shader,
		scale = 0.1,
	}

	model 90bmwE304doorWindowfl
	{
		mesh = vehicles/Vehicles_90bmwE30_Body|e30_4door_window_fl,
		shader = damn_vehicle_shader,
		static = FALSE,
		scale = 0.1,
	}

	model 90bmwE304doorWindowfr
	{
		mesh = vehicles/Vehicles_90bmwE30_Body|e30_4door_window_fr,
		shader = damn_vehicle_shader,
		static = FALSE,
		scale = 0.1,
	}

	model 90bmwE304doorWindowrl
	{
		mesh = vehicles/Vehicles_90bmwE30_Body|e30_4door_window_rl,
		shader = damn_vehicle_shader,
		static = FALSE,
		scale = 0.1,
	}

	model 90bmwE304doorWindowrr
	{
		mesh = vehicles/Vehicles_90bmwE30_Body|e30_4door_window_rr,
		shader = damn_vehicle_shader,
		static = FALSE,
		scale = 0.1,
	}

	model 90bmwE30touringWindowrl
	{
		mesh = vehicles/Vehicles_90bmwE30_Body|e30_touring_window_rl,
		shader = damn_vehicle_shader,
		static = FALSE,
		scale = 0.1,
	}

	model 90bmwE30touringWindowrr
	{
		mesh = vehicles/Vehicles_90bmwE30_Body|e30_touring_window_rr,
		shader = damn_vehicle_shader,
		static = FALSE,
		scale = 0.1,
	}

	model 90bmwE30touringWindowbl
	{
		mesh = vehicles/Vehicles_90bmwE30_Body|e30_touring_window_bl,
		shader = damn_vehicle_shader,
		scale = 0.1,
	}

	model 90bmwE30touringWindowbr
	{
		mesh = vehicles/Vehicles_90bmwE30_Body|e30_touring_window_br,
		shader = damn_vehicle_shader,
		scale = 0.1,
	}

	model 90bmwE30cabrioWindowfl
	{
		mesh = vehicles/Vehicles_90bmwE30_Body|e30_cabrio_window_fl,
		shader = damn_vehicle_shader,
		static = FALSE,
		scale = 0.1,
	}

	model 90bmwE30cabrioWindowfr
	{
		mesh = vehicles/Vehicles_90bmwE30_Body|e30_cabrio_window_fr,
		shader = damn_vehicle_shader,
		static = FALSE,
		scale = 0.1,
	}

	template vehicle BMWE30Windows2door
	{
		part WindowFrontLeft
		{
			model windowFL
			{
				file = 90bmwE302doorWindowfl,
			}

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

			parent = DoorFrontLeft,
			area = SeatFrontLeft,
			itemType = Base.90bmwE30FrontSideWindow,
			table install
			{
				requireInstalled = DoorFrontLeft,
			}
			table uninstall
				{
				requireUninstalled = BMWE30FrontLeftArmor,
				}
		}

		part WindowFrontRight
		{
			model windowFR
			{
				file = 90bmwE302doorWindowfr,
			}

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

			parent = DoorFrontRight,
			area = SeatFrontRight,
			itemType = Base.90bmwE30FrontSideWindow,
			table install
			{
				requireInstalled = DoorFrontRight,
			}
			table uninstall
				{
				requireUninstalled = BMWE30FrontRightArmor,
				}
		}

		part WindowRearLeft
		{
			model windowRL
			{
				file = 90bmwE302doorWindowrl,
			}

			area = SeatRearLeft,
			itemType = Base.90bmwE30SedanRearSideWindow,
			table uninstall
				{
				requireUninstalled = BMWE30RearLeftArmor,
				}
		}

		part WindowRearRight
		{
			model windowRR
			{
				file = 90bmwE302doorWindowrr,
			}

			area = SeatRearRight,
			itemType = Base.90bmwE30SedanRearSideWindow,
			table uninstall
				{
				requireUninstalled = BMWE30RearRightArmor,
				}
		}

		part Window*
		{
			category = door,
			mechanicRequireKey = true,
			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 BMWE30Windows4door
	{
		part WindowFrontLeft
		{
			model windowFL
			{
				file = 90bmwE304doorWindowfl,
			}

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

			parent = DoorFrontLeft,
			area = SeatFrontLeft,
			itemType = Base.90bmwE30FrontSideWindow,
			table install
			{
				requireInstalled = DoorFrontLeft,
			}
			table uninstall
				{
				requireUninstalled = BMWE30FrontLeftArmor,
				}
		}

		part WindowFrontRight
		{
			model windowFR
			{
				file = 90bmwE304doorWindowfr,
			}

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

			parent = DoorFrontRight,
			area = SeatFrontRight,
			itemType = Base.90bmwE30FrontSideWindow,
			table install
			{
				requireInstalled = DoorFrontRight,
			}
			table uninstall
				{
				requireUninstalled = BMWE30FrontRightArmor,
				}
		}

		part WindowRearLeft
		{
			model windowRL
			{
				file = 90bmwE304doorWindowrl,
			}

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

			parent = DoorRearLeft,
			area = SeatRearLeft,
			itemType = Base.90bmwE30SedanRearSideWindow,
			table install
			{
				requireInstalled = DoorRearLeft,
			}
			table uninstall
				{
				requireUninstalled = BMWE30RearLeftArmor,
				}
		}

		part WindowRearRight
		{
			model windowRR
			{
				file = 90bmwE304doorWindowrr,
			}

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

			parent = DoorRearRight,
			area = SeatRearRight,
			itemType = Base.90bmwE30SedanRearSideWindow,
			table install
			{
				requireInstalled = DoorRearRight,
			}
			table uninstall
				{
				requireUninstalled = BMWE30RearRightArmor,
				}
		}

		part Window*
		{
			category = door,
			mechanicRequireKey = true,
			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 BMWE30WindowsTouring
	{

		template! = BMWE30Windows4door,

		part WindowRearLeft
		{
			model windowRL
			{
				file = 90bmwE30touringWindowrl,
			}

			itemType = Base.90bmwE30TouringRearSideWindow,
		}

		part WindowRearRight
		{
			model windowRR
			{
				file = 90bmwE30touringWindowrr,
			}

			itemType = Base.90bmwE30TouringRearSideWindow,
		}

		part WindowBackLeft
		{
			model windowBL
			{
				file = 90bmwE30touringWindowbl,
			}

			area = SeatRearLeft,
			itemType = Base.90bmwE30TouringBackSideWindow,

			table uninstall
				{
				requireUninstalled = BMWE30BackLeftArmor,
				}
		}

		part WindowBackRight
		{
			model windowBR
			{
				file = 90bmwE30touringWindowbr,
			}

			area = SeatRearRight,
			itemType = Base.90bmwE30TouringBackSideWindow,

			table uninstall
				{
				requireUninstalled = BMWE30BackRightArmor,
				}
		}

		part Window*
		{
			category = door,
			mechanicRequireKey = true,
			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 BMWE30WindowsCabrio
	{
		part WindowFrontLeft
		{
			model windowFL
			{
				file = 90bmwE30cabrioWindowfl,
			}

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

			parent = DoorFrontLeft,
			area = SeatFrontLeft,
			itemType = Base.90bmwE30CabrioSideWindows,
			table install
			{
				requireInstalled = DoorFrontLeft,
			}
			table uninstall
				{
				requireUninstalled = BMWE30FrontLeftArmor,
				}
		}

		part WindowFrontRight
		{
			model windowFR
			{
				file = 90bmwE30cabrioWindowfr,
			}

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

			parent = DoorFrontRight,
			area = SeatFrontRight,
			itemType = Base.90bmwE30CabrioSideWindows,
			table install
			{
				requireInstalled = DoorFrontRight,
			}
			table uninstall
				{
				requireUninstalled = BMWE30FrontRightArmor,
				}
		}

		part Window*
		{
			category = door,
			mechanicRequireKey = true,
			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,
			}
		}
	}

}

