Skip to content

Commit

Permalink
Fixed flashing highbeams option not saving to preferences
Browse files Browse the repository at this point in the history
  • Loading branch information
TomGrobbe committed May 3, 2018
1 parent 50b7a91 commit b4e98dc
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
16 changes: 12 additions & 4 deletions vMenu/FunctionsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -234,14 +234,13 @@ private async Task PlayerOptions()
}
}
#endregion
#region OnTick Vehicle Tasks
#region Vehicle Options Tasks
/// <summary>
/// Manage all vehicle related tasks.
/// </summary>
/// <returns></returns>
private async Task VehicleOptions()
{

// Vehicle options. Only run vehicle options if the vehicle options menu has actually been created.
if (MainMenu.VehicleOptionsMenu != null && cf.IsAllowed(Permission.VOMenu))
{
Expand Down Expand Up @@ -342,7 +341,6 @@ private async Task VehicleOptions()
vehicle.AreHighBeamsOn = false;
}
}

}
// When the player is not inside a vehicle:
else
Expand Down Expand Up @@ -597,6 +595,11 @@ private async Task DeathNotifications()
}
#endregion

#region Update Location for location display
/// <summary>
/// Updates the location for location display.
/// </summary>
/// <returns></returns>
private async Task UpdateLocation()
{
if (MainMenu.MiscSettingsMenu != null)
Expand Down Expand Up @@ -632,7 +635,12 @@ private async Task UpdateLocation()
}
}
}
#endregion

#region ShowLocation
/// <summary>
/// Show location function to show the player's location.
/// </summary>
private void ShowLocation()
{
// Create the default prefix.
Expand Down Expand Up @@ -688,7 +696,7 @@ private void ShowLocation()
cf.DrawTextOnScreen($"~c~{th}:{tm}", 0.208f + safeZoneSizeX, 0.9748f - safeZoneSizeY, 0.40f, Alignment.Center);
}
#endregion

#endregion
#region Voice Chat Tasks
/// <summary>
/// Run all voice chat options tasks
Expand Down
11 changes: 10 additions & 1 deletion vMenu/UserDefaults.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ public static bool VehicleGodMode
get { return GetSettingsBool("vehicleGodMode"); }
set { SetSavedSettingsBool("vehicleGodMode", value); }
}
public static bool VehicleSpecialGodMode
{
get { return GetSettingsBool("VehicleSpecialGodMode"); }
set { SetSavedSettingsBool("VehicleSpecialGodMode", value); }
}

public static bool VehicleEngineAlwaysOn
{
Expand Down Expand Up @@ -184,7 +189,6 @@ public static bool ShowCurrentSpeaker
}
#endregion


#endregion


Expand Down Expand Up @@ -313,6 +317,8 @@ public static void SaveSettings()

MiscShowLocation = MainMenu.MiscSettingsMenu.ShowLocation;
prefs.Add("MiscShowLocation", MainMenu.MiscSettingsMenu.ShowLocation);


}

if (MainMenu.VehicleOptionsMenu != null)
Expand All @@ -328,6 +334,9 @@ public static void SaveSettings()

VehicleNoSiren = MainMenu.VehicleOptionsMenu.VehicleNoSiren;
prefs.Add("VehicleNoSiren", MainMenu.VehicleOptionsMenu.VehicleNoSiren);

VehicleHighbeamsOnHonk = MainMenu.VehicleOptionsMenu.FlashHighbeamsOnHonk;
prefs.Add("vehicleHighbeamsOnHonk", MainMenu.VehicleOptionsMenu.FlashHighbeamsOnHonk);
}

if (MainMenu.VehicleSpawnerMenu != null)
Expand Down
4 changes: 2 additions & 2 deletions vMenu/menus/VehicleOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ private void CreateMenu()
UIMenuCheckboxItem vehicleFreeze = new UIMenuCheckboxItem("Freeze Vehicle", VehicleFrozen, "Freeze your vehicle's position.");
UIMenuCheckboxItem torqueEnabled = new UIMenuCheckboxItem("Enable Torque Multiplier", VehicleTorqueMultiplier, "Enables the torque multiplier selected from the list below.");
UIMenuCheckboxItem powerEnabled = new UIMenuCheckboxItem("Enable Power Multiplier", VehiclePowerMultiplier, "Enables the power multiplier selected from the list below.");
UIMenuCheckboxItem highbeamsOnHonk = new UIMenuCheckboxItem("Flash Highbeams On Honk", FlashHighbeamsOnHonk, "Turn on your highbeams on your vehicle when honking your horn. " +
"Does not work during the day when you have your lights turned off.");
UIMenuCheckboxItem highbeamsOnHonk = new UIMenuCheckboxItem("Flash Highbeams On Honk", FlashHighbeamsOnHonk, "Turn on your highbeams on your vehicle when honking your horn." +
" Does not work during the day when you have your lights turned off.");

// Create buttons.
UIMenuItem fixVehicle = new UIMenuItem("Repair Vehicle", "Repair any visual and physical damage present on your vehicle.");
Expand Down

0 comments on commit b4e98dc

Please sign in to comment.