module Base
{

	model 88toyotaHiluxWindowfl
	{
		mesh = vehicles/Vehicles_88toyotaHilux_Body|88hilux_window_fl,
		shader = damn_vehicle_shader,
		static = FALSE,
		scale = 0.1,
		boneWeight = window_fl_bone 1.0,
	}

	model 88toyotaHiluxWindowfr
	{
		mesh = vehicles/Vehicles_88toyotaHilux_Body|88hilux_window_fr,
		shader = damn_vehicle_shader,
		static = FALSE,
		scale = 0.1,
		boneWeight = window_fr_bone 1.0,
	}

    model 88toyotaHiluxWindowbl
	{
		mesh = vehicles/Vehicles_88toyotaHilux_Body|88hilux_window_bl,
		shader = damn_vehicle_shader,
		scale = 0.1,
	}

	model 88toyotaHiluxWindowbr
	{
		mesh = vehicles/Vehicles_88toyotaHilux_Body|88hilux_window_br,
		shader = damn_vehicle_shader,
		scale = 0.1,
	}

	template vehicle HLX88WindowsFront
	{
		part WindowFrontLeft
		{
			model windowFL
			{
				file = 88toyotaHiluxWindowfl,
			}

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

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

		part WindowFrontRight
		{
			model windowFR
			{
				file = 88toyotaHiluxWindowfr,
			}

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

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

		part Window*
		{
			category = door,
			mechanicRequireKey = true,
            durability = 2,
			window
			{
				openable = true,
			}
			table install
			{
				items
				{
					1
					{
						tags = 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
					{
						tags = 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 HLX88WindowsRear
	{
		part WindowRearLeft
		{
			model windowRL
			{
				file = 88toyotaHiluxWindowbl,
			}

			area = SeatFrontLeft,
			itemType = Base.88toyotaHiluxBackSideWindow,
			table uninstall
				{
				requireUninstalled = DAMNBackLeftArmor,
				}
		}

		part WindowRearRight
		{
			model windowRR
			{
				file = 88toyotaHiluxWindowbr,
			}

			area = SeatFrontRight,
			itemType = Base.88toyotaHiluxBackSideWindow,
			table uninstall
				{
				requireUninstalled = DAMNBackRightArmor,
				}
		}

		part Window*
		{
			category = door,
			mechanicRequireKey = true,
            durability = 2,
			window
			{
				openable = true,
			}
			table install
			{
				items
				{
					1
					{
						tags = 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
					{
						tags = 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,
			}
		}
	}
}

