Skip to content

Commit 7ad6b1d

Browse files
committed
Make hud displaying optional
1 parent cba1c40 commit 7ad6b1d

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

FRFuel.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public class FRFuel : BaseScript
5353
protected Vehicle LastVehicle { get => lastVehicle; set => lastVehicle = value; }
5454

5555
protected Config Config { get; set; }
56+
protected bool showHud = true;
5657
#endregion
5758

5859
/// <summary>
@@ -124,8 +125,11 @@ protected void LoadConfig()
124125

125126
Config = new Config(configContent);
126127

128+
showHud = Config.Get("ShowHud", "true") == "true";
129+
127130
#if DEBUG
128131
Debug.WriteLine($"CreatePickups: {Config.Get("CreatePickups", "true")}");
132+
Debug.WriteLine($"ShowHud: {Config.Get("ShowHud", "true")}");
129133
#endif
130134
}
131135

@@ -377,7 +381,10 @@ public void ControlEngine(Vehicle vehicle)
377381
/// <param name="playerPed"></param>
378382
public void RenderUI(Ped playerPed)
379383
{
380-
hud.RenderBar(playerPed.CurrentVehicle.FuelLevel, fuelTankCapacity);
384+
if (showHud)
385+
{
386+
hud.RenderBar(playerPed.CurrentVehicle.FuelLevel, fuelTankCapacity);
387+
}
381388

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

FRFuel.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
</ItemGroup>
6767
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
6868
<PropertyGroup>
69-
<PostBuildEvent>copy /y $(TargetPath) C:\Games\FiveReborn\server\resources\frfuel</PostBuildEvent>
69+
<PostBuildEvent>copy /y $(TargetPath) C:\Games\FiveReborn\fxserver\resources\frfuel</PostBuildEvent>
7070
</PropertyGroup>
7171
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
7272
Other similar extension points exist, see Microsoft.Common.targets.

0 commit comments

Comments
 (0)