Skip to content

Commit

Permalink
Initial Public Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMaybeast committed Aug 17, 2020
1 parent 012b91f commit 050e561
Show file tree
Hide file tree
Showing 108 changed files with 9,094 additions and 0 deletions.
25 changes: 25 additions & 0 deletions DLS.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30225.117
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DLS", "DLS\DLS.csproj", "{283D9119-0BBE-42A0-8F57-49E580F20584}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{283D9119-0BBE-42A0-8F57-49E580F20584}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{283D9119-0BBE-42A0-8F57-49E580F20584}.Debug|Any CPU.Build.0 = Debug|Any CPU
{283D9119-0BBE-42A0-8F57-49E580F20584}.Release|Any CPU.ActiveCfg = Release|Any CPU
{283D9119-0BBE-42A0-8F57-49E580F20584}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {AEFAC0CC-75AF-4067-B01B-AE3B4504E63E}
EndGlobalSection
EndGlobal
140 changes: 140 additions & 0 deletions DLS/ActiveVehicle.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
using DLS.Utils;
using Rage;

namespace DLS
{
public class ActiveVehicle
{
public ActiveVehicle(Vehicle vehicle, bool playerVehicle = false, LightStage lightStage = LightStage.Off, SirenStage sirenStage = SirenStage.Off)
{
Vehicle = vehicle;
VehicleHash = 0;
LightStage = lightStage;
SirenStage = sirenStage;
CurrentHash = 0;
TAStage = TAStage.Off;
TempUsed = false;
TempLightStage = LightStage.Off;
TempWailLightStage = LightStage.Off;
AuxOn = false;
AuxID = 999;
HornID = 999;
SoundId = 999;
PlayerVehicle = false;
SBOn = false;
IntLightOn = false;
IndStatus = IndStatus.Off;
TAType = "off";
TAgroup = null;
TApatternCurrentIndex = 999;
PlayerVehicle = playerVehicle;
DefaultEL = vehicle.EmergencyLighting;
IsSirenSilent = vehicle.IsSirenSilent;
IsScanOn = false;
if (vehicle && vehicle.GetDLS() != null)
{
bool temp = vehicle.IsSirenOn;
vehicle.IsSirenOn = false;
InitialLengths = new float[20];
GameFiber.Yield();
for (int i = 0; i < InitialLengths.Length; i++)
{
string bone = "siren" + (i + 1);
if (vehicle.HasBone(bone))
{
InitialLengths[i] = vehicle.GetBoneOrientation(bone).LengthSquared();
}
else
{
InitialLengths[i] = 1f;
}
}
vehicle.IsSirenOn = temp;
DLSModel vehDLS;
if (vehicle)
vehDLS = vehicle.GetDLS();
else
vehDLS = null;
TAType = vehDLS.TrafficAdvisory.Type;
if (TAType != "off")
{
TAgroup = Entrypoint.tagroups[vehDLS.TrafficAdvisory.TAgroup];
TApatternCurrentIndex = Entrypoint.tagroups[vehDLS.TrafficAdvisory.TAgroup].GetIndexFromTAPatternName(vehDLS.TrafficAdvisory.DefaultTApattern);
}
VehicleHash = Game.GetHashKey(vehDLS.Name);
vehicle.EmergencyLightingOverride = Vehicles.GetEL(vehicle, this);
}
}
public Vehicle Vehicle { get; set; }
public uint VehicleHash { get; set; }
public LightStage LightStage { get; set; }
public LightStage TempLightStage { get; set; }
public bool TempUsed { get; set; } = true;
public bool Wailing { get; set; }
public string TAType { get; set; }
public LightStage TempWailLightStage { get; set; }
public SirenStage SirenStage { get; set; }
public TAStage TAStage { get; set; }
public bool SBOn { get; set; }
public bool AuxOn { get; set; }
public bool HornOn { get; set; }
public bool PlayerVehicle { get; set; }
public bool IntLightOn { get; set; }
public int AuxID { get; set; }
public int HornID { get; set; }
public int SoundId { get; set; }
public IndStatus IndStatus { get; set; }
public TAgroup TAgroup { get; set; }
public int TApatternCurrentIndex { get; set; }
public uint CurrentHash { get; set; }
public float[] InitialLengths { get; set; }
public EmergencyLighting DefaultEL { get; set; }
public bool IsSirenSilent { get; set; }
public bool IsScanOn { get; set; }
}

public enum LightStage
{
Off,
One,
Two,
Three,
CustomOne,
CustomTwo,
Empty
}

public enum SirenStage
{
Off,
One,
Two,
Warning,
Warning2,
Horn
}

public enum TAStage
{
Off,
Left,
Diverge,
Right,
Warn
}

public enum IndStatus
{
Left,
Right,
Both,
Off
}

public enum SirenStatus
{
On,
Off,
None
}
}
Loading

0 comments on commit 050e561

Please sign in to comment.