Skip to content

Commit

Permalink
Make hud displaying optional
Browse files Browse the repository at this point in the history
  • Loading branch information
thers committed Sep 22, 2017
1 parent cba1c40 commit 7ad6b1d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion FRFuel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public class FRFuel : BaseScript
protected Vehicle LastVehicle { get => lastVehicle; set => lastVehicle = value; }

protected Config Config { get; set; }
protected bool showHud = true;
#endregion

/// <summary>
Expand Down Expand Up @@ -124,8 +125,11 @@ protected void LoadConfig()

Config = new Config(configContent);

showHud = Config.Get("ShowHud", "true") == "true";

#if DEBUG
Debug.WriteLine($"CreatePickups: {Config.Get("CreatePickups", "true")}");
Debug.WriteLine($"ShowHud: {Config.Get("ShowHud", "true")}");
#endif
}

Expand Down Expand Up @@ -377,7 +381,10 @@ public void ControlEngine(Vehicle vehicle)
/// <param name="playerPed"></param>
public void RenderUI(Ped playerPed)
{
hud.RenderBar(playerPed.CurrentVehicle.FuelLevel, fuelTankCapacity);
if (showHud)
{
hud.RenderBar(playerPed.CurrentVehicle.FuelLevel, fuelTankCapacity);
}

var gasStationIndex = GetGasStationIndexInRange(playerPed.Position, showMarkerInRangeSquared);

Expand Down
2 changes: 1 addition & 1 deletion FRFuel.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>copy /y $(TargetPath) C:\Games\FiveReborn\server\resources\frfuel</PostBuildEvent>
<PostBuildEvent>copy /y $(TargetPath) C:\Games\FiveReborn\fxserver\resources\frfuel</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down

0 comments on commit 7ad6b1d

Please sign in to comment.