From 14378211b6c0d4117beb6d855381966077bab7e4 Mon Sep 17 00:00:00 2001 From: Rich Dunne Date: Thu, 1 Oct 2020 06:05:05 -0600 Subject: [PATCH] CreateWaypointBlip is now a local function and not referenced elsewhere --- SceneManager/Menus/PathCreationMenu.cs | 64 +++++++++++++------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/SceneManager/Menus/PathCreationMenu.cs b/SceneManager/Menus/PathCreationMenu.cs index 8d220c8..7fcec61 100644 --- a/SceneManager/Menus/PathCreationMenu.cs +++ b/SceneManager/Menus/PathCreationMenu.cs @@ -94,11 +94,11 @@ namespace SceneManager if (collectorWaypoint.Checked) { - PathMainMenu.paths[pathIndex].Waypoints.Add(new Waypoint(firstNonNullPath, waypointNumber, Game.LocalPlayer.Character.Position, SetDriveSpeedForWaypoint(), drivingFlags[waypointType.Index], CreateWaypointBlip(pathIndex, drivingFlags[waypointType.Index]), true, collectorRadius.Value, speedZoneRadius.Value)); + PathMainMenu.paths[pathIndex].Waypoints.Add(new Waypoint(firstNonNullPath, waypointNumber, Game.LocalPlayer.Character.Position, SetDriveSpeedForWaypoint(), drivingFlags[waypointType.Index], CreateWaypointBlip(), true, collectorRadius.Value, speedZoneRadius.Value)); } else { - PathMainMenu.paths[pathIndex].Waypoints.Add(new Waypoint(firstNonNullPath, waypointNumber, Game.LocalPlayer.Character.Position, SetDriveSpeedForWaypoint(), drivingFlags[waypointType.Index], CreateWaypointBlip(pathIndex, drivingFlags[waypointType.Index]))); + PathMainMenu.paths[pathIndex].Waypoints.Add(new Waypoint(firstNonNullPath, waypointNumber, Game.LocalPlayer.Character.Position, SetDriveSpeedForWaypoint(), drivingFlags[waypointType.Index], CreateWaypointBlip())); } Logger.Log($"[Path {pathNumber}] Waypoint {waypointNumber} ({drivingFlags[waypointType.Index].ToString()}) added"); @@ -125,6 +125,36 @@ namespace SceneManager return convertedSpeed; } + + Blip CreateWaypointBlip() + { + var spriteNumericalEnum = pathIndex + 17; // 17 because the numerical value of these sprites are always 17 more than the path index + var blip = new Blip(Game.LocalPlayer.Character.Position) + { + Scale = 0.5f, + Sprite = (BlipSprite)spriteNumericalEnum + }; + + if (collectorWaypoint.Checked) + { + blip.Color = Color.Blue; + } + else if (drivingFlags[waypointType.Index] == VehicleDrivingFlags.StopAtDestination) + { + blip.Color = Color.Red; + } + else + { + blip.Color = Color.Green; + } + + if (!SettingsMenu.mapBlips.Checked) + { + blip.Alpha = 0f; + } + + return blip; + } } if (selectedItem == trafficRemoveWaypoint) @@ -228,36 +258,6 @@ namespace SceneManager } } - internal static Blip CreateWaypointBlip(int pathIndex, VehicleDrivingFlags drivingFlag) - { - var spriteNumericalEnum = pathIndex + 17; // 17 because the numerical value of these sprites are always 17 more than the path index - var blip = new Blip(Game.LocalPlayer.Character.Position) - { - Scale = 0.5f, - Sprite = (BlipSprite)spriteNumericalEnum - }; - - if (collectorWaypoint.Checked) - { - blip.Color = Color.Blue; - } - else if (drivingFlag == VehicleDrivingFlags.StopAtDestination) - { - blip.Color = Color.Red; - } - else - { - blip.Color = Color.Green; - } - - if (!SettingsMenu.mapBlips.Checked) - { - blip.Alpha = 0f; - } - - return blip; - } - internal static void AddNewPathToPathsCollection(List paths, int pathIndex) { var pathNum = pathIndex + 1;