コード例 #1
0
ファイル: Siren.cs プロジェクト: timnboys/ELS-FiveM-1
        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(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");
        }
コード例 #3
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");
        }
コード例 #4
0
ファイル: Siren.cs プロジェクト: Jason1123/ELS-FiveM
        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);
        }
コード例 #5
0
 internal MainSiren(ref Tones tonesl)
 {
     MainTones   = new List <Tone>(new[] { tonesl.tone1, tonesl.tone2, tonesl.tone3, tonesl.tone4 });
     currentTone = MainTones[0];
 }
コード例 #6
0
ファイル: MainSiren.cs プロジェクト: Jason1123/ELS-FiveM
 public MainSiren(Tones tonesl)
 {
     MainTones   = new List <Tone>(new[] { tonesl.tone1, tonesl.tone2, tonesl.tone3, tonesl.tone4 });
     currentTone = MainTones[0];
 }