module Base
{
    model 82oshkoshM911windshield
    {
        mesh = vehicles/Vehicles_82oshkoshM911_mk3_Body|m911_windshield,
        shader = damn_vehicle_shader,
        scale = 0.1,
    }

	model 82oshkoshM911windowfl
	{
		mesh = vehicles/Vehicles_82oshkoshM911_mk3_Body|m911_window_fl,
		shader = damn_vehicle_shader,
		static = FALSE,
		scale = 0.1,
		boneWeight = window_fl_bone 1.0,
	}

	model 82oshkoshM911windowfr
	{
		mesh = vehicles/Vehicles_82oshkoshM911_mk3_Body|m911_window_fr,
		shader = damn_vehicle_shader,
		static = FALSE,
		scale = 0.1,
		boneWeight = window_fr_bone 1.0,
	}

    model 82oshkoshM911rearwindshield
    {
        mesh = vehicles/Vehicles_82oshkoshM911_mk3_Body|m911_windshield_rear,
        shader = damn_vehicle_shader,
        scale = 0.1,
    }

	template vehicle M911Windows
	{
        part Windshield
        {
            model windshieldFront12314643478
            {
                file = 82oshkoshM911windshield,
            }
            window
            {
            openable = false,
            }
                
            itemType = Base.M911Windshield,
            area = Engine,
            category = bodywork,
            mechanicRequireKey = false,
            durability = 3,
            table install
            {
                items
                {
                    1
                    {
                        tags = Screwdriver,
                        count = 1,
                        keep = true,
			equip = primary,
                    }
                }
                time = 700,
                skills = Mechanics:5,
                recipes = Intermediate Mechanics,
                test = Vehicles.InstallTest.Default,
                complete = Vehicles.InstallComplete.Window,
            }
            table uninstall
            {
                items
                {
                    1
                    {
                        tags = Screwdriver,
                        count = 1,
                        keep = true,
						equip = primary,
                    }
                }
                time = 700,
                  skills = Mechanics:5,
                  recipes = Intermediate Mechanics,
                test = Vehicles.UninstallTest.Default,
                requireUninstalled = DAMNWindshieldArmor,
            }
            lua
            {
                create = Vehicles.Create.Default,
            }
        }

		part WindowFrontLeft
		{
			model windowFL4569426
			{
				file = 82oshkoshM911windowfl,
			}

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

			parent = DoorFrontLeft,
			area = SeatFrontLeft,
			table install
			{
				requireInstalled = DoorFrontLeft,
			}
			table uninstall
				{
				requireUninstalled = DAMNFrontLeftArmor,
				}
		}

		part WindowFrontRight
		{
			model windowFR652954563
			{
				file = 82oshkoshM911windowfr,
			}

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

			parent = DoorFrontRight,
			area = SeatFrontRight,
			table install
			{
				requireInstalled = DoorFrontRight,
			}
			table uninstall
				{
				requireUninstalled = DAMNFrontRightArmor,
				}
		}

		part Window*
		{
			category = door,
			mechanicRequireKey = true,
            durability = 3,
			itemType = Base.M911SideWindow,
			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,
			}
		}

        part WindshieldRear
        {
            model windshieldRear9594
            {
                file = 82oshkoshM911rearwindshield,
            }
            
            window
            {
            openable = false,
            }
                
            itemType = Base.M911WindshieldRear,
            area = TruckBed,
            category = bodywork,
            mechanicRequireKey = false,
            durability = 3,
            table install
            {
                items
                {
                    1
                    {
                        tags = Screwdriver,
                        count = 1,
                        keep = true,
			            equip = primary,
                    }
                }
                time = 700,
                skills = Mechanics:5,
                recipes = Intermediate Mechanics,
                test = Vehicles.InstallTest.Default,
                complete = Vehicles.InstallComplete.Window,
            }
            table uninstall
            {
                items
                {
                    1
                    {
                        tags = Screwdriver,
                        count = 1,
                        keep = true,
						equip = primary,
                    }
                }
                time = 700,
                  skills = Mechanics:5,
                  recipes = Intermediate Mechanics,
                test = Vehicles.UninstallTest.Default,
                requireUninstalled = DAMNWindshieldRearArmor,
            }
            lua
            {
                create = Vehicles.Create.Default,
            }
        }
	}
}

