diff --git a/SceneManager/Menus/PathMainMenu.cs b/SceneManager/Menus/PathMainMenu.cs index f60b559..bd9a0b8 100644 --- a/SceneManager/Menus/PathMainMenu.cs +++ b/SceneManager/Menus/PathMainMenu.cs @@ -10,7 +10,8 @@ namespace SceneManager static class PathMainMenu { public static UIMenu pathMainMenu { get; private set; } - private static UIMenuItem createNewPath, deleteAllPaths; + public static UIMenuItem createNewPath { get; private set; } + private static UIMenuItem deleteAllPaths; public static UIMenuListScrollerItem editPath { get; private set; } public static UIMenuListScrollerItem directDriver { get; private set; } public static UIMenuListScrollerItem dismissDriver { get; private set; } @@ -82,32 +83,6 @@ namespace SceneManager pathsNum.Insert(indexToInsertAt, pathNum); } - public static void RefreshMenu() - { - //trafficRemoveWaypoint.Enabled = true; - pathMainMenu.Clear(); - pathMainMenu.AddItem(createNewPath = new UIMenuItem("Continue Creating Current Path")); - createNewPath.ForeColor = Color.Gold; - pathMainMenu.AddItem(deleteAllPaths = new UIMenuItem("Delete All Paths")); - deleteAllPaths.ForeColor = Color.Gold; - pathMainMenu.AddItem(directDriver = new UIMenuListScrollerItem("Direct nearest driver to path", "")); - directDriver.ForeColor = Color.Gold; - pathMainMenu.AddItem(dismissDriver = new UIMenuListScrollerItem("Dismiss nearest driver", "")); - dismissDriver.ForeColor = Color.Gold; - - if (GetPaths().Count == 8) - { - createNewPath.Enabled = false; - } - if (GetPaths().Count == 0) - { - editPath.Enabled = false; - deleteAllPaths.Enabled = false; - disableAllPaths.Enabled = false; - directDriver.Enabled = false; - } - } - private static bool VehicleAndDriverValid(this Vehicle v) { if (v && v.HasDriver && v.Driver && v.Driver.IsAlive) @@ -196,7 +171,7 @@ namespace SceneManager { if (selectedItem == createNewPath) { - RefreshMenu(); + createNewPath.Text = "Continue Creating Current Path"; pathMainMenu.Visible = false; PathCreationMenu.pathCreationMenu.Visible = true; @@ -212,11 +187,8 @@ namespace SceneManager } else if (paths.ElementAtOrDefault(i) == null) { + // Do we only want to do this once the first waypoint is added? PathCreationMenu.AddNewPathToPathsCollection(paths, i); - //Game.LogTrivial($"Creating path {i + 1}"); - //Game.DisplayNotification($"~o~Scene Manager\n~y~[Creating]~w~ Path {i + 1} started."); - //paths.Insert(i, new Path(i + 1, false)); - //PathCreationMenu.trafficRemoveWaypoint.Enabled = false; if (SettingsMenu.debugGraphics.Checked) {