module Base
{
	model PU_Chains_FL_TrailerTSMega
    {
        mesh = vehicles/TrailerTSMegaArmor|chaintires2,
        texture = Vehicles/puv_parts,
        shader = vehiclewheel,
        scale = 0.05,
    }

	model PU_Chains_FR_TrailerTSMega
    {
        mesh = vehicles/TrailerTSMegaArmor|chaintires2,
        texture = Vehicles/puv_parts,
        shader = vehiclewheel,
        scale = 0.05,
        invertX = TRUE,
    }

	model PU_Chains_RL_TrailerTSMega
    {
        mesh = vehicles/TrailerTSMegaArmor|chaintires,
        texture = Vehicles/puv_parts,
        shader = vehiclewheel,
        scale = 0.05,
    }

	model PU_Chains_RR_TrailerTSMega
    {
        mesh = vehicles/TrailerTSMegaArmor|chaintires,
        texture = Vehicles/puv_parts,
        shader = vehiclewheel,
        scale = 0.05,
        invertX = TRUE,
    }

	model PU_Trunk_TrailerTSMega_Light
    {
        mesh = vehicles/TrailerTSMegaArmor|trunklightrear,
        texture = Vehicles/puv_parts,
        shader = vehiclewheel,
        scale = 0.05,
    }

	model PU_Trunk_TrailerTSMega_Heavy
    {
        mesh = vehicles/TrailerTSMegaArmor|trunkheavyrear,
        texture = Vehicles/puv_parts,
        shader = vehiclewheel,
        scale = 0.05,
    }

	model PU_Rack_TrailerTSMega
    {
        mesh = vehicles/TrailerTSMegaArmor|roofrack,
        texture = Vehicles/puv_parts,
        shader = vehiclewheel,
        scale = 0.05,
    }

	template vehicle PU_Armor_TrailerTSMega
	{
        template = ATA2Protection/part/ATA2ProtectionTrunk,
        part ATA2ProtectionTrunk
        {
            model Light
            {
                file = PU_Trunk_TrailerTSMega_Light,
            }
            model Heavy
            {
                file = PU_Trunk_TrailerTSMega_Heavy,
            }
        }

        part Tire*
        {
            setAllModelsVisible = false,
            table install
            {
                complete = ATATuning2.InstallComplete.TireNotAllModelsVisible,
            }
            
            table uninstall
            {
                complete = ATATuning2.UninstallComplete.TireNotAllModelsVisible,
            }
            
            lua
            {
                create = ATATuning2.Create.TireNotAllModelsVisible,
                init = ATATuning2.Init.TireNotAllModelsVisible,
                checkOperate = Vehicles.CheckOperate.Tire,
                update = Vehicles.Update.Tire,
            }
        }

        template = ATA2Protection/part/ATA2ProtectionWheels,
        part TireFrontLeft
        {
            model ATAProtection
            {
                file = PU_Chains_FL_TrailerTSMega,
				offset = 1.3 0.0 0.0,
            }
        }

        part TireFrontRight
        {
            model ATAProtection
            {
                file = PU_Chains_FR_TrailerTSMega,
				offset = -1.3 0.0 0.0,
            }
        }

        part TireRearLeft
        {
            model ATAProtection
            {
                file = PU_Chains_RL_TrailerTSMega,
            }
        }

        part TireRearRight
        {
            model ATAProtection
            {
                file = PU_Chains_RR_TrailerTSMega,
            }
        }

        template = ATA2InteractiveTrunk/part/ATA2InteractiveTrunkRoofRack,
        part ATA2InteractiveTrunkRoofRack
        {
            model Default
            {
                file = PU_Rack_TrailerTSMega,
            }
        }
	}
}