1
Fork 0
mirror of https://github.com/thegeneralist01/Scene-Manager-DevRepo synced 2026-01-11 15:40:29 +01:00

Removed GetPaths() method from PathMainMenu and updated references to paths list.

This commit is contained in:
Rich Dunne 2020-09-15 13:49:10 -06:00
parent 3c636c1564
commit 2241e107de
6 changed files with 42 additions and 41 deletions

View file

@ -34,7 +34,7 @@ namespace SceneManager
// Need to unsubscribe from these or else there will be duplicate firings if the user left the menu, then re-entered
ResetEventHandlerSubscriptions();
var currentPath = PathMainMenu.GetPaths()[PathMainMenu.editPath.Value - 1];
var currentPath = PathMainMenu.paths[PathMainMenu.editPath.Value-1];
//Logger.Log($"Current path: {currentPath.Number}");
editWaypoint = new UIMenuNumericScrollerItem<int>("Edit Waypoint", "", currentPath.Waypoints.First().Number, currentPath.Waypoints.Last().Number, 1);
@ -95,7 +95,7 @@ namespace SceneManager
private static void EditWaypoint_OnScrollerChanged(UIMenu sender, UIMenuScrollerItem scrollerItem, int first, int last)
{
var currentPath = PathMainMenu.GetPaths()[PathMainMenu.editPath.Value - 1];
var currentPath = PathMainMenu.paths[PathMainMenu.editPath.Index];
var currentWaypoint = currentPath.Waypoints[editWaypoint.Value - 1];
if (scrollerItem == editWaypoint)
@ -136,7 +136,7 @@ namespace SceneManager
private static void EditWaypoint_OnItemSelected(UIMenu sender, UIMenuItem selectedItem, int index)
{
var currentPath = PathMainMenu.GetPaths()[PathMainMenu.editPath.Index];
var currentPath = PathMainMenu.paths[PathMainMenu.editPath.Index];
var currentWaypoint = currentPath.Waypoints[editWaypoint.Index];
if (selectedItem == updateWaypoint)
@ -160,7 +160,7 @@ namespace SceneManager
if (selectedItem == addAsNewWaypoint)
{
var pathIndex = PathMainMenu.GetPaths().IndexOf(currentPath);
var pathIndex = PathMainMenu.paths.IndexOf(currentPath);
var drivingFlag = drivingFlags[changeWaypointType.Index];
var blip = PathCreationMenu.CreateWaypointBlip(pathIndex, drivingFlag);
if (!currentPath.IsEnabled)