diff --git a/SceneManager/Menus/BarrierMenu.cs b/SceneManager/Menus/BarrierMenu.cs index cca1c5a..6c96eb0 100644 --- a/SceneManager/Menus/BarrierMenu.cs +++ b/SceneManager/Menus/BarrierMenu.cs @@ -14,15 +14,15 @@ namespace SceneManager.Menus { private static List TrafficLightList { get; } = new List() { TrafficLight.Green, TrafficLight.Red, TrafficLight.Yellow, TrafficLight.None }; internal static UIMenu Menu { get; } = new UIMenu("Scene Manager", "~o~Barrier Management"); - internal static UIMenuListScrollerItem BarrierList { get; } = new UIMenuListScrollerItem("Spawn Barrier", "", Settings.Barriers.Keys); // Settings.barrierKeys + internal static UIMenuListScrollerItem BarrierList { get; } = new UIMenuListScrollerItem("Spawn Barrier", "", Settings.BarrierModels.Keys); // Settings.barrierKeys internal static UIMenuNumericScrollerItem RotateBarrier { get; } = new UIMenuNumericScrollerItem("Rotate Barrier", "", 0, 350, 10); - // ADD CHECKBOX FOR BARRIER TO STOP TRAFFIC? ADD 3D MARKER TO SHOW WHERE TRAFFIC WILL STOP. ONLY NEED ONE CONE TO DO IT PER LANE internal static UIMenuCheckboxItem Invincible { get; } = new UIMenuCheckboxItem("Indestructible", false, "If checked, the barrier will not break, or will be harder to break. The barrier will still able to be moved around."); internal static UIMenuCheckboxItem Immobile { get; } = new UIMenuCheckboxItem("Immobile", false, "If checked, the barrier will be frozen in place."); internal static UIMenuNumericScrollerItem BarrierTexture { get; } = new UIMenuNumericScrollerItem("Change Texture", "If the barrier has multiple textures, changing this value will apply them to the barrier.", 0, 15, 1); internal static UIMenuCheckboxItem SetBarrierLights { get; } = new UIMenuCheckboxItem("Enable Barrier Lights", Settings.EnableBarrierLightsDefaultOn, "If the barrier has functional lights, checking this option will turn them on."); internal static UIMenuCheckboxItem BelongsToPath { get; } = new UIMenuCheckboxItem("Belongs to Path", false, "If checked, the barrier will be saved with the path when the path is exported."); internal static UIMenuListScrollerItem AddToPath { get; private set; } + internal static UIMenuListScrollerItem AddUnassignedToPath { get; private set; } internal static UIMenuListScrollerItem SetBarrierTrafficLight { get; } = new UIMenuListScrollerItem("Set Barrier Traffic Light", "", TrafficLightList); internal static UIMenuListScrollerItem RemoveBarrierOptions { get; } = new UIMenuListScrollerItem("Remove Barrier", "", new[] { "Last Barrier", "Nearest Barrier", "All Barriers" }); internal static UIMenuItem ResetBarriers { get; } = new UIMenuItem("Reset Barriers", "Reset all spawned barriers to their original position and rotation"); @@ -38,7 +38,7 @@ namespace SceneManager.Menus Menu.OnMenuOpen += BarrierMenu_OnMenuOpen; } - internal static void BuildMenu() + internal static void Build() { Menu.Clear(); @@ -63,10 +63,15 @@ namespace SceneManager.Menus BelongsToPath.Enabled = PathManager.Paths.Count() > 0 ? true : false; BelongsToPath.Checked = false; - AddToPath = new UIMenuListScrollerItem("Path", "The path the barrier will be saved with when the path is exported.", PathManager.Paths.Select(x => x.Name)); + AddToPath = new UIMenuListScrollerItem("Path", "The path the barrier will be saved with when the path is exported.", PathManager.Paths.Where(x => x != null).Select(x => x.Name)); Menu.AddItem(AddToPath); AddToPath.Enabled = BelongsToPath.Checked; + AddUnassignedToPath = new UIMenuListScrollerItem("Add Unassigned Barriers to Path", "The path to add all unassigned barriers to.", PathManager.Paths.Where(x => x != null).Select(x => x.Name)); + Menu.AddItem(AddUnassignedToPath); + AddUnassignedToPath.ForeColor = Color.Gold; + AddUnassignedToPath.Enabled = BarrierManager.Barriers.Any(x => x.Path == null); + Menu.AddItem(RemoveBarrierOptions); RemoveBarrierOptions.ForeColor = Color.Gold; RemoveBarrierOptions.Enabled = BarrierManager.Barriers.Count() != 0; @@ -138,19 +143,21 @@ namespace SceneManager.Menus { if (selectedItem == BarrierList) { - //SpawnBarrier(); BarrierManager.SpawnBarrier(); } + if (selectedItem == AddUnassignedToPath) + { + BarrierManager.AddBarrierToPath(); + } + if (selectedItem == RemoveBarrierOptions) { - //RemoveBarrier(); BarrierManager.RemoveBarrier(RemoveBarrierOptions.Index); } if (selectedItem == ResetBarriers) { - //ResetBarriers(); BarrierManager.ResetBarriers(); } }