Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
thers committed Jan 30, 2017
1 parent 6c3c66a commit 4d3b5d3
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 28 deletions.
9 changes: 7 additions & 2 deletions DevMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,26 @@
using CitizenFX.Core;
using CitizenFX.Core.UI;
using NativeUI;
using System.Drawing;
using System.Security;
using CitizenFX.Core.Native;

namespace FRFuel.Dev {
public class DevMenu {
protected MenuPool menuPool;
protected UIMenu mainMenu;

protected UIMenuItem position;
protected UIMenuItem isDriver;
protected UIMenuItem vehicleModelId;
protected UIMenuItem vehicleFuelTank;
protected UIMenuItem knownVehicle;

protected UIMenuItem netVehicleId;
protected UIMenuItem netVehicleIdControl;
protected UIMenuItem decoration;

protected Text txt = new Text("", new PointF(600f, 100f), .5f);

public DevMenu() {
menuPool = new MenuPool();
mainMenu = new UIMenu("FRFuel dev menu", "things");
Expand Down Expand Up @@ -54,7 +59,7 @@ public DevMenu() {
menuPool.Add(mainMenu);
menuPool.RefreshIndex();
}

public void OnTick() {
position.Text = "Pos: " + Game.PlayerPed.Position.ToString();

Expand Down
7 changes: 5 additions & 2 deletions FRFuel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ public void ConsumeFuel(Vehicle vehicle) {
// And ped is in range of sqrt(80) to it
Vector3.DistanceSquared(currentGasStation.Position, vehicle.Position) <= 80f
) {
if (vehicle.Speed < 0.1f) {
ControlEngine(vehicle);
}

if (vehicle.IsEngineRunning) {
hud.helpTextTurnOff.Draw();
} else {
Expand All @@ -167,7 +171,7 @@ public void ConsumeFuel(Vehicle vehicle) {
/// </summary>
/// <param name="vehicle"></param>
public void ControlEngine(Vehicle vehicle) {
if (Game.IsControlJustReleased(0, Control.CinematicSlowMo)) {
if (Game.IsControlJustReleased(0, Control.VehicleHorn)) {
if (vehicle.IsEngineRunning) {
vehicle.IsDriveable = false;
vehicle.IsEngineRunning = false;
Expand Down Expand Up @@ -357,7 +361,6 @@ public async Task OnTick() {
InitFuel(vehicle);
}

ControlEngine(vehicle);
ConsumeFuel(vehicle);
RenderUI(playerPed);

Expand Down
4 changes: 2 additions & 2 deletions FRFuel.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand All @@ -29,6 +29,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<Reference Include="CitizenFX.Core">
Expand All @@ -54,7 +55,6 @@
<Compile Include="FRFuel.cs" />
<Compile Include="GasStations.cs" />
<Compile Include="HUD.cs" />
<Compile Include="ModMenu.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TinyTween.cs" />
<Compile Include="VehiclesPetrolTanks.cs" />
Expand Down
4 changes: 2 additions & 2 deletions HUD.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class HUD {
);

public Text helpTextTurnOff = new Text(
"Press ~b~L~w~ to stop engine",
"~b~Horn~w~ to stop engine",
new PointF(640f, 690f),
0.5f,
Color.FromArgb(255, 255, 255, 255),
Expand All @@ -46,7 +46,7 @@ public class HUD {
);

public Text helpTextTurnOn = new Text(
"Press ~b~L~w~ to start engine",
"~b~Horn~w~ to start engine",
new PointF(640f, 690f),
0.5f,
Color.FromArgb(255, 255, 255, 255),
Expand Down
19 changes: 0 additions & 19 deletions ModMenu.cs

This file was deleted.

2 changes: 1 addition & 1 deletion Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

0 comments on commit 4d3b5d3

Please sign in to comment.