From 39f7bf6b95b7e54d601adad97d5c0e579674bc7c Mon Sep 17 00:00:00 2001 From: Rich Dunne Date: Sun, 6 Dec 2020 07:28:43 -0700 Subject: [PATCH] Added using for SceneManager.Object and SceneManager.Utils. Removed unnecessary code for RNUIMouseInputHandler after having added InputManager dependency. ImportPath menu item hidden for release. --- SceneManager/Menus/PathMainMenu.cs | 41 ++++++++---------------------- 1 file changed, 10 insertions(+), 31 deletions(-) diff --git a/SceneManager/Menus/PathMainMenu.cs b/SceneManager/Menus/PathMainMenu.cs index 6f348fc..79b0c8a 100644 --- a/SceneManager/Menus/PathMainMenu.cs +++ b/SceneManager/Menus/PathMainMenu.cs @@ -1,37 +1,29 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Drawing; using System.Linq; -using System.Windows.Forms; using Rage; using RAGENativeUI; using RAGENativeUI.Elements; +using SceneManager.Objects; +using SceneManager.Utils; namespace SceneManager { - - - static class PathMainMenu + internal static class PathMainMenu { - internal static List paths = new List() { }; + internal static List paths = new List(); + internal static List importedPaths = new List(); private static string[] dismissOptions = new string[] { "From path", "From waypoint", "From world" }; - //private static List dismissOptions = new List() { "From path", "From waypoint", "From world" }; - internal static UIMenu pathMainMenu = new UIMenu("Scene Manager", "~o~Path Manager Main Menu"); internal static UIMenuItem createNewPath; + internal static UIMenuListScrollerItem importPath; internal static UIMenuItem deleteAllPaths = new UIMenuItem("Delete All Paths"); internal static UIMenuNumericScrollerItem editPath; internal static UIMenuListScrollerItem directOptions = new UIMenuListScrollerItem("Direct driver to path's", "", new[] { "First waypoint", "Nearest waypoint" }); internal static UIMenuNumericScrollerItem directDriver; - internal static UIMenuListScrollerItem dismissDriver = new UIMenuListScrollerItem("Dismiss nearest driver", $"~b~From path: ~w~AI will be released from the path{Environment.NewLine}~b~From waypoint: ~w~AI will skip their current waypoint task{Environment.NewLine}~b~From world: ~w~AI will be removed from the world.", dismissOptions); + internal static UIMenuListScrollerItem dismissDriver = new UIMenuListScrollerItem("Dismiss nearest driver", $"~b~From path: ~w~AI will be released from the path\n~b~From waypoint: ~w~AI will skip their current waypoint task\n~b~From world: ~w~AI will be removed from the world.", dismissOptions); internal static UIMenuCheckboxItem disableAllPaths = new UIMenuCheckboxItem("Disable All Paths", false); - internal enum Delete - { - Single, - All - } - internal static void InstantiateMenu() { pathMainMenu.ParentMenu = MainMenu.mainMenu; @@ -48,8 +40,9 @@ namespace SceneManager pathMainMenu.AddItem(createNewPath = new UIMenuItem("Create New Path")); createNewPath.ForeColor = Color.Gold; + //pathMainMenu.AddItem(importPath = new UIMenuListScrollerItem("Import Path", "Import a saved path", importedPaths)); + //importPath.ForeColor = Color.Gold; pathMainMenu.AddItem(editPath = new UIMenuNumericScrollerItem("Edit Path", "", 1, paths.Count, 1)); - editPath.Index = 0; editPath.ForeColor = Color.Gold; pathMainMenu.AddItem(disableAllPaths); disableAllPaths.Enabled = true; @@ -421,20 +414,6 @@ namespace SceneManager private static void PathMenu_OnMenuOpen(UIMenu menu) { var scrollerItems = new List { directOptions, directDriver, dismissDriver, editPath }; - var checkboxItems = new Dictionary() - { - { disableAllPaths, DisableAllPaths } - }; - - var selectItems = new Dictionary() - { - { createNewPath, GoToPathCreationMenu }, - { editPath, GoToEditPathMenu }, - { deleteAllPaths, DeleteAllPaths }, - { directDriver, DirectDriver }, - { dismissDriver, DismissDriver } - }; - RNUIMouseInputHandler.Initialize(menu, scrollerItems); } }