Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass through existing saved vehicle's category when replacing #404

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions vMenu/CommonFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1496,7 +1496,7 @@ public struct VehicleInfo
/// <summary>
/// Saves the vehicle the player is currently in to the client's kvp storage.
/// </summary>
public static async void SaveVehicle(string updateExistingSavedVehicleName = null)
public static async void SaveVehicle(string updateExistingSavedVehicleName = null, string existingCatergory = null)
{
// Only continue if the player is in a vehicle.
if (Game.PlayerPed.IsInVehicle())
Expand Down Expand Up @@ -1584,7 +1584,7 @@ public static async void SaveVehicle(string updateExistingSavedVehicleName = nul
bulletProofTires = !veh.CanTiresBurst,
headlightColor = VehicleOptions.GetHeadlightsColorForVehicle(veh),
enveffScale = GetVehicleEnveffScale(veh.Handle),
Category = "Uncategorized"
Category = string.IsNullOrEmpty(existingCatergory) ? "Uncategorized" : existingCatergory
};

#endregion
Expand Down
2 changes: 1 addition & 1 deletion vMenu/menus/SavedVehicles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ string ChangeCallback(MenuDynamicListItem item, bool left)
{
replaceButtonPressedCount = 0;
item.Label = "";
SaveVehicle(currentlySelectedVehicle.Key.Substring(4));
SaveVehicle(currentlySelectedVehicle.Key.Substring(4), currentlySelectedVehicle.Value.Category);
selectedVehicleMenu.GoBack();
Notify.Success("Your saved vehicle has been replaced with your current vehicle.");
}
Expand Down