Пример #1
0
        public Siren(Vehicle vehicle, VCF.vcfroot vcfroot, [Optional] IDictionary <string, object> data)
        {
            _vcf     = vcfroot;
            _vehicle = vehicle;

            Function.Call(Hash.DISABLE_VEHICLE_IMPACT_EXPLOSION_ACTIVATION, _vehicle, true);
#if DEBUG
            CitizenFX.Core.Debug.WriteLine(_vehicle.DisplayName);
#endif

            _tones = new Tones
            {
                horn       = new Tone(vcfroot.SOUNDS.MainHorn.AudioString, _vehicle, ToneType.Horn),
                tone1      = new Tone(vcfroot.SOUNDS.SrnTone1.AudioString, _vehicle, ToneType.SrnTon1),
                tone2      = new Tone(vcfroot.SOUNDS.SrnTone2.AudioString, _vehicle, ToneType.SrnTon2),
                tone3      = new Tone(vcfroot.SOUNDS.SrnTone3.AudioString, _vehicle, ToneType.SrnTon3),
                tone4      = new Tone(vcfroot.SOUNDS.SrnTone4.AudioString, _vehicle, ToneType.SrnTon4),
                panicAlarm = new Tone(vcfroot.SOUNDS.PanicMde.AudioString, _vehicle, ToneType.SrnPnic)
            };

            dual_siren = false;

            _mainSiren = new MainSiren(ref _tones);

            if (data != null)
            {
                SetData(data);
            }
        }
Пример #2
0
        public Siren(ELSVehicle vehicle, Vcfroot vcfroot, IPatterns patt)
        {
            _vcf = vcfroot;
            if (_vcf is null)
            {
                Utils.ReleaseWriteLine($"VCF for vehicle {vehicle?.Vehicle?.DisplayName} with netId {vehicle?.NetworkId} is null!");
                return;
            }
            _elsVehicle        = vehicle;
            _patternController = patt;
            Utils.DebugWriteLine($"{_vcf.SOUNDS.MainHorn.AudioString}");
            Utils.DebugWriteLine($"{_vcf.SOUNDS.SrnTone1.AudioString}");
            Utils.DebugWriteLine($"{_vcf.SOUNDS.SrnTone2.AudioString}");
            Utils.DebugWriteLine($"{_vcf.SOUNDS.SrnTone3.AudioString}");
            Utils.DebugWriteLine($"{_vcf.SOUNDS.SrnTone4.AudioString}");

            _tones = new Tones
            {
                horn  = new Tone(_vcf.SOUNDS.MainHorn.AudioString, _elsVehicle, ToneType.Horn, true, soundSet: _vcf.SOUNDS.MainHorn.SoundSet),
                tone1 = new Tone(_vcf.SOUNDS.SrnTone1.AudioString, _elsVehicle, ToneType.SrnTon1, _vcf.SOUNDS.SrnTone1.AllowUse, soundSet: _vcf.SOUNDS.SrnTone1.SoundSet),
                tone2 = new Tone(_vcf.SOUNDS.SrnTone2.AudioString, _elsVehicle, ToneType.SrnTon2, _vcf.SOUNDS.SrnTone2.AllowUse, soundSet: _vcf.SOUNDS.SrnTone2.SoundSet),
                tone3 = new Tone(_vcf.SOUNDS.SrnTone3.AudioString, _elsVehicle, ToneType.SrnTon3, _vcf.SOUNDS.SrnTone3.AllowUse, soundSet: _vcf.SOUNDS.SrnTone3.SoundSet),
                tone4 = new Tone(_vcf.SOUNDS.SrnTone4.AudioString, _elsVehicle, ToneType.SrnTon4, _vcf.SOUNDS.SrnTone4.AllowUse, soundSet: _vcf.SOUNDS.SrnTone4.SoundSet),
            };

            _mainSiren = new MainSiren(ref _tones);
            dual_siren = false;

            ElsUiPanel.SetUiDesc(_mainSiren.MainTones[_mainSiren.currentTone].Type, "SRN");
            ElsUiPanel.SetUiDesc("--", "HRN");
        }
Пример #3
0
        public Siren(Vehicle vehicle, Vcfroot vcfroot, [Optional] IDictionary <string, object> data, IPatterns patt)
        {
            _vcf               = vcfroot;
            _vehicle           = vehicle;
            _patternController = patt;
            Function.Call(Hash.DISABLE_VEHICLE_IMPACT_EXPLOSION_ACTIVATION, _vehicle, true);
            Utils.DebugWriteLine(_vehicle.DisplayName);

            _tones = new Tones
            {
                horn       = new Tone(vcfroot.SOUNDS.MainHorn.AudioString, _vehicle, ToneType.Horn, true),
                tone1      = new Tone(vcfroot.SOUNDS.SrnTone1.AudioString, _vehicle, ToneType.SrnTon1, vcfroot.SOUNDS.SrnTone1.AllowUse),
                tone2      = new Tone(vcfroot.SOUNDS.SrnTone2.AudioString, _vehicle, ToneType.SrnTon2, vcfroot.SOUNDS.SrnTone2.AllowUse),
                tone3      = new Tone(vcfroot.SOUNDS.SrnTone3.AudioString, _vehicle, ToneType.SrnTon3, vcfroot.SOUNDS.SrnTone3.AllowUse),
                tone4      = new Tone(vcfroot.SOUNDS.SrnTone4.AudioString, _vehicle, ToneType.SrnTon4, vcfroot.SOUNDS.SrnTone4.AllowUse),
                panicAlarm = new Tone(vcfroot.SOUNDS.PanicMde.AudioString, _vehicle, ToneType.SrnPnic, vcfroot.SOUNDS.PanicMde.AllowUse)
            };

            dual_siren = false;

            _mainSiren = new MainSiren(ref _tones);

            if (data != null)
            {
                SetData(data);
            }
            ElsUiPanel.SetUiDesc(_mainSiren.currentTone.Type, "SRN");
            ElsUiPanel.SetUiDesc("--", "HRN");
        }
Пример #4
0
        public Siren(Vehicle vehicle)
        {
            _vehicle = vehicle;
            Function.Call(Hash.DISABLE_VEHICLE_IMPACT_EXPLOSION_ACTIVATION, _vehicle, true);

            foreach (VCF.vcfroot vcfroot in VCF.ELSVehicle)
            {
                if (vcfroot.FileName == _vehicle.DisplayName)
                {
                    _vcf = vcfroot;
                }
            }
            if (_vcf == null)
            {
                throw new Exception($"Their is no VCF file for this vehicle: {_vehicle.DisplayName}");
            }

            _tones = new Tones
            {
                horn  = new Tone(_vcf.SOUNDS.MainHorn.AudioString, _vehicle, ToneType.Horn),
                tone1 = new Tone(_vcf.SOUNDS.SrnTone1.AudioString, _vehicle, ToneType.SrnTon1),
                tone2 = new Tone(_vcf.SOUNDS.SrnTone2.AudioString, _vehicle, ToneType.SrnTon2),
                tone3 = new Tone(_vcf.SOUNDS.SrnTone3.AudioString, _vehicle, ToneType.SrnTon3),
                tone4 = new Tone(_vcf.SOUNDS.SrnTone4.AudioString, _vehicle, ToneType.SrnTon4)
            };
            dual_siren = false;
            _mainSiren = new MainSiren(_tones);
        }