Skip to content

Commit d9fb798

Browse files
Add project files.
1 parent 5c6069d commit d9fb798

File tree

5 files changed

+217
-0
lines changed

5 files changed

+217
-0
lines changed

EVLC_Settings.ini

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[Emergency Vehicles]
2+
Siren_Toggle_Key=T
3+
4+
[All]
5+
Beam_Toggle_Key=CapsLock
6+
Interior_Light_toggle_key=I
7+
Left_Indicator_Key=Left
8+
Right_Indicator_Key=Right
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{58F44D0C-9DED-4C02-A015-C1B6ECB1BA0A}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>EnhancedVehicleLightingControls</RootNamespace>
11+
<AssemblyName>EnhancedVehicleLightingControls</AssemblyName>
12+
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
<Deterministic>true</Deterministic>
15+
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17+
<DebugSymbols>true</DebugSymbols>
18+
<DebugType>full</DebugType>
19+
<Optimize>false</Optimize>
20+
<OutputPath>bin\Debug\</OutputPath>
21+
<DefineConstants>DEBUG;TRACE</DefineConstants>
22+
<ErrorReport>prompt</ErrorReport>
23+
<WarningLevel>4</WarningLevel>
24+
</PropertyGroup>
25+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26+
<DebugType>pdbonly</DebugType>
27+
<Optimize>true</Optimize>
28+
<OutputPath>bin\Release\</OutputPath>
29+
<DefineConstants>TRACE</DefineConstants>
30+
<ErrorReport>prompt</ErrorReport>
31+
<WarningLevel>4</WarningLevel>
32+
</PropertyGroup>
33+
<ItemGroup>
34+
<Reference Include="ScriptHookVDotNet3">
35+
<HintPath>..\..\Production\Vehicle-Ragdoll Master\ScriptHookVDotNet3.dll</HintPath>
36+
</Reference>
37+
<Reference Include="System" />
38+
<Reference Include="System.Core" />
39+
<Reference Include="System.Windows.Forms" />
40+
<Reference Include="System.Xml.Linq" />
41+
<Reference Include="System.Data.DataSetExtensions" />
42+
<Reference Include="Microsoft.CSharp" />
43+
<Reference Include="System.Data" />
44+
<Reference Include="System.Net.Http" />
45+
<Reference Include="System.Xml" />
46+
</ItemGroup>
47+
<ItemGroup>
48+
<Compile Include="main.cs" />
49+
<Compile Include="Properties\AssemblyInfo.cs" />
50+
</ItemGroup>
51+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
52+
</Project>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.31424.327
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EnhancedVehicleLightingControls", "EnhancedVehicleLightingControls.csproj", "{58F44D0C-9DED-4C02-A015-C1B6ECB1BA0A}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{58F44D0C-9DED-4C02-A015-C1B6ECB1BA0A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{58F44D0C-9DED-4C02-A015-C1B6ECB1BA0A}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{58F44D0C-9DED-4C02-A015-C1B6ECB1BA0A}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{58F44D0C-9DED-4C02-A015-C1B6ECB1BA0A}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {1B701EB9-49A0-4BE1-AB70-5F93E6A2CFC6}
24+
EndGlobalSection
25+
EndGlobal

Properties/AssemblyInfo.cs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("CopVehicleControlls")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("CopVehicleControlls")]
13+
[assembly: AssemblyCopyright("Copyright © 2021")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("58f44d0c-9ded-4c02-a015-c1b6ecb1ba0a")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]

main.cs

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
using System;
2+
using System.Windows.Forms;
3+
4+
using GTA;
5+
using GTA.UI;
6+
7+
namespace EnhancedVehicleLightingControls
8+
{
9+
public class Main : Script
10+
{
11+
bool firstTime = true;
12+
13+
Ped playerCharacter = Game.Player.Character;
14+
bool isSirenSilent;
15+
bool leftIndicator, rightIndicator;
16+
17+
Keys sirenToggleKey, beamToggleKey, interiorLightToggleKey, leftIndicatorKey, rightIndicatorKey;
18+
19+
public Main()
20+
{
21+
this.Tick += OnTick;
22+
this.KeyDown += OnKeyDown;
23+
24+
ScriptSettings config = ScriptSettings.Load("scripts\\EVLC_Settings.ini");
25+
26+
sirenToggleKey = config.GetValue<Keys>("Emergency Vehicles", "Siren_Toggle_Key", Keys.Tab);
27+
beamToggleKey = config.GetValue<Keys>("All", "Beam_Toggle_Key", Keys.CapsLock);
28+
interiorLightToggleKey = config.GetValue<Keys>("All", "Interior_Light_Toggle_Key", Keys.I);
29+
leftIndicatorKey = config.GetValue<Keys>("All", "Left_Indicator_key", Keys.Left);
30+
rightIndicatorKey = config.GetValue<Keys>("All", "Right_Indicator_key", Keys.Right);
31+
32+
}
33+
34+
private void OnTick(object sender, EventArgs e)
35+
{
36+
string modName = "Enhanced Vehicle Lighting Controls";
37+
string version = "PreRelease v0.2.0";
38+
string developer = "MccDev260";
39+
40+
if (firstTime)
41+
{
42+
Notification.Show(NotificationIcon.Blocked, modName, developer, version + " " + "loaded!!", false, true);
43+
firstTime = false;
44+
}
45+
}
46+
47+
private void OnKeyDown(object sender, KeyEventArgs e)
48+
{
49+
50+
if (playerCharacter.CurrentVehicle != null)
51+
{
52+
if (playerCharacter.CurrentVehicle.HasSiren)
53+
{
54+
if (e.KeyCode == sirenToggleKey)
55+
{
56+
isSirenSilent = !isSirenSilent;
57+
playerCharacter.CurrentVehicle.IsSirenSilent = isSirenSilent;
58+
}
59+
}
60+
61+
if (playerCharacter.CurrentVehicle.AreLightsOn)
62+
{
63+
if (e.KeyCode == beamToggleKey)
64+
playerCharacter.CurrentVehicle.AreHighBeamsOn = !playerCharacter.CurrentVehicle.AreHighBeamsOn;
65+
}
66+
67+
if (e.KeyCode == interiorLightToggleKey)
68+
playerCharacter.CurrentVehicle.IsInteriorLightOn = !playerCharacter.CurrentVehicle.IsInteriorLightOn;
69+
70+
if (e.KeyCode == rightIndicatorKey)
71+
{
72+
rightIndicator = !rightIndicator;
73+
playerCharacter.CurrentVehicle.IsRightIndicatorLightOn = rightIndicator;
74+
75+
if (leftIndicator)
76+
{
77+
leftIndicator = !leftIndicator;
78+
playerCharacter.CurrentVehicle.IsLeftIndicatorLightOn = leftIndicator;
79+
}
80+
}
81+
82+
if (e.KeyCode == leftIndicatorKey)
83+
{
84+
leftIndicator = !leftIndicator;
85+
playerCharacter.CurrentVehicle.IsLeftIndicatorLightOn = leftIndicator;
86+
87+
if (rightIndicator)
88+
{
89+
rightIndicator = !rightIndicator;
90+
playerCharacter.CurrentVehicle.IsRightIndicatorLightOn = rightIndicator;
91+
}
92+
}
93+
}
94+
}
95+
}
96+
}

0 commit comments

Comments
 (0)