From 7ad6b1da491b731d19c97b727af259d49c4e4e46 Mon Sep 17 00:00:00 2001 From: Alexander Kukhta Date: Fri, 22 Sep 2017 08:11:52 +0300 Subject: [PATCH] Make hud displaying optional --- FRFuel.cs | 9 ++++++++- FRFuel.csproj | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/FRFuel.cs b/FRFuel.cs index c5df167..1f62da5 100644 --- a/FRFuel.cs +++ b/FRFuel.cs @@ -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 /// @@ -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 } @@ -377,7 +381,10 @@ public void ControlEngine(Vehicle vehicle) /// 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); diff --git a/FRFuel.csproj b/FRFuel.csproj index b1294a6..ab88628 100644 --- a/FRFuel.csproj +++ b/FRFuel.csproj @@ -66,7 +66,7 @@ - copy /y $(TargetPath) C:\Games\FiveReborn\server\resources\frfuel + copy /y $(TargetPath) C:\Games\FiveReborn\fxserver\resources\frfuel