Пример #1
0
        public StrobedVehicle(Vehicle veh, Pattern pattern)
        {
            Vehicle     = veh;
            Pattern     = pattern;
            stagesCount = Pattern.Stages.Length;

            LeftHeadlight  = new StrobedLight(this, VehicleLight.LeftHeadlight);
            RightHeadlight = new StrobedLight(this, VehicleLight.RightHeadlight);

            LeftTailLight  = new StrobedLight(this, VehicleLight.LeftTailLight);
            RightTailLight = new StrobedLight(this, VehicleLight.RightTailLight);

            LeftBrakeLight   = new StrobedLight(this, VehicleLight.LeftBrakeLight);
            RightBrakeLight  = new StrobedLight(this, VehicleLight.RightBrakeLight);
            MiddleBrakeLight = new StrobedLight(this, VehicleLight.MiddleBrakeLight);

            // with custom siren settings RPH fails to obtain the Vehicle's EmergencyLighting, if so don't disable the headlight and tail lights sequences
            EmergencyLighting defaultEmergencyLighting = Vehicle.DefaultEmergencyLighting;

            if (defaultEmergencyLighting == null)
            {
                defaultEmergencyLighting = Vehicle.EmergencyLighting;

                if (defaultEmergencyLighting == null)
                {
                    defaultEmergencyLighting = Vehicle.Model.EmergencyLighting;
                }
            }

            if (defaultEmergencyLighting != null)
            {
                Vehicle.EmergencyLightingOverride = defaultEmergencyLighting.Clone();
                Vehicle.EmergencyLightingOverride.RightHeadLightSequenceRaw = 0;
                Vehicle.EmergencyLightingOverride.RightTailLightSequenceRaw = 0;
                Vehicle.EmergencyLightingOverride.LeftHeadLightSequenceRaw  = 0;
                Vehicle.EmergencyLightingOverride.LeftTailLightSequenceRaw  = 0;
                disabledHeadTailLightsSequences = true;
            }
            else
            {
                disabledHeadTailLightsSequences = false;
            }

            Game.LogTrivial((disabledHeadTailLightsSequences ?
                             "Successfully disabled game's headlights and tail lights sequences for model " + veh.Model.Name :
                             "Failed to disabled game's headlights and tail lights sequences for model " + veh.Model.Name));
        }
        public StrobedVehicle(Vehicle veh, Pattern pattern)
        {
            Vehicle = veh;
            Pattern = pattern;
            stagesCount = Pattern.Stages.Length;

            LeftHeadlight = new StrobedLight(this, VehicleLight.LeftHeadlight);
            RightHeadlight = new StrobedLight(this, VehicleLight.RightHeadlight);

            LeftTailLight = new StrobedLight(this, VehicleLight.LeftTailLight);
            RightTailLight = new StrobedLight(this, VehicleLight.RightTailLight);

            LeftBrakeLight = new StrobedLight(this, VehicleLight.LeftBrakeLight);
            RightBrakeLight = new StrobedLight(this, VehicleLight.RightBrakeLight);

            // with custom siren settings RPH fails to obtain the Vehicle's EmergencyLighting, if so don't disable the headlight and tail lights sequences
            EmergencyLighting defaultEmergencyLighting = Vehicle.DefaultEmergencyLighting;

            if (defaultEmergencyLighting == null)
            {
                defaultEmergencyLighting = Vehicle.EmergencyLighting;

                if (defaultEmergencyLighting == null)
                {
                    defaultEmergencyLighting = Vehicle.Model.EmergencyLighting;
                }
            }

            if (defaultEmergencyLighting != null)
            {
                Vehicle.EmergencyLightingOverride = defaultEmergencyLighting.Clone();
                Vehicle.EmergencyLightingOverride.RightHeadLightSequenceRaw = 0;
                Vehicle.EmergencyLightingOverride.RightTailLightSequenceRaw = 0;
                Vehicle.EmergencyLightingOverride.LeftHeadLightSequenceRaw = 0;
                Vehicle.EmergencyLightingOverride.LeftTailLightSequenceRaw = 0;
                disabledHeadTailLightsSequences = true;
            }
            else
            {
                disabledHeadTailLightsSequences = false;
            }
        }