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

Updated references to waypoint driving flag. Edit Waypoint menu no longer rebuilds when a waypoint is updated.

This commit is contained in:
Rich Dunne 2020-10-10 20:07:54 -06:00
parent 075856fbce
commit 423dc57fcb

View file

@ -65,7 +65,7 @@ namespace SceneManager
editWaypointMenu.AddItem(stopWaypointType = new UIMenuCheckboxItem("Is this a Stop waypoint?", currentWaypoint.IsStopWaypoint, "If checked, vehicles will drive to this waypoint, then stop.")); editWaypointMenu.AddItem(stopWaypointType = new UIMenuCheckboxItem("Is this a Stop waypoint?", currentWaypoint.IsStopWaypoint, "If checked, vehicles will drive to this waypoint, then stop."));
editWaypointMenu.AddItem(directWaypointBehavior); editWaypointMenu.AddItem(directWaypointBehavior);
if(currentWaypoint.DrivingFlag == (VehicleDrivingFlags)17040299) if(currentWaypoint.DrivingFlagType == DrivingFlagType.Direct)
{ {
directWaypointBehavior.Checked = true; directWaypointBehavior.Checked = true;
} }
@ -110,7 +110,7 @@ namespace SceneManager
changeWaypointSpeed.Value = (int)MathHelper.ConvertMetersPerSecondToMilesPerHour(currentWaypoint.Speed); changeWaypointSpeed.Value = (int)MathHelper.ConvertMetersPerSecondToMilesPerHour(currentWaypoint.Speed);
stopWaypointType.Checked = currentWaypoint.IsStopWaypoint; stopWaypointType.Checked = currentWaypoint.IsStopWaypoint;
directWaypointBehavior.Checked = currentWaypoint.DrivingFlag == (VehicleDrivingFlags)17040299 ? true : false; directWaypointBehavior.Checked = currentWaypoint.DrivingFlagType == DrivingFlagType.Direct ? true : false;
collectorWaypoint.Checked = currentWaypoint.IsCollector; collectorWaypoint.Checked = currentWaypoint.IsCollector;
changeCollectorRadius.Enabled = collectorWaypoint.Checked ? true : false; changeCollectorRadius.Enabled = collectorWaypoint.Checked ? true : false;
changeCollectorRadius.Value = (int)currentWaypoint.CollectorRadius; changeCollectorRadius.Value = (int)currentWaypoint.CollectorRadius;
@ -152,7 +152,7 @@ namespace SceneManager
{ {
var currentPath = PathMainMenu.paths[PathMainMenu.editPath.Index]; var currentPath = PathMainMenu.paths[PathMainMenu.editPath.Index];
var currentWaypoint = currentPath.Waypoints[editWaypoint.Index]; var currentWaypoint = currentPath.Waypoints[editWaypoint.Index];
VehicleDrivingFlags drivingFlag = directWaypointBehavior.Checked ? (VehicleDrivingFlags)17040299 : (VehicleDrivingFlags)263075; DrivingFlagType drivingFlag = directWaypointBehavior.Checked ? DrivingFlagType.Direct : DrivingFlagType.Normal;
if (selectedItem == updateWaypoint) if (selectedItem == updateWaypoint)
{ {
@ -165,12 +165,13 @@ namespace SceneManager
currentWaypoint.UpdateWaypoint(currentWaypoint, drivingFlag, stopWaypointType.Checked, SetDriveSpeedForWaypoint(), collectorWaypoint.Checked, changeCollectorRadius.Value, changeSpeedZoneRadius.Value, updateWaypointPosition.Checked); currentWaypoint.UpdateWaypoint(currentWaypoint, drivingFlag, stopWaypointType.Checked, SetDriveSpeedForWaypoint(), collectorWaypoint.Checked, changeCollectorRadius.Value, changeSpeedZoneRadius.Value, updateWaypointPosition.Checked);
} }
Logger.Log($"Path {currentPath.Number} Waypoint {currentWaypoint.Number} updated [Driving style: {(DrivingFlagType)drivingFlag} | Stop waypoint: {stopWaypointType.Checked} | Speed: {changeWaypointSpeed.Value} | Collector: {currentWaypoint.IsCollector}]"); Logger.Log($"Path {currentPath.Number} Waypoint {currentWaypoint.Number} updated [Driving style: {drivingFlag} | Stop waypoint: {stopWaypointType.Checked} | Speed: {changeWaypointSpeed.Value} | Collector: {currentWaypoint.IsCollector}]");
updateWaypointPosition.Checked = false; updateWaypointPosition.Checked = false;
Game.DisplayNotification($"~o~Scene Manager\n~g~[Success]~w~ Waypoint {currentWaypoint.Number} updated."); Game.DisplayNotification($"~o~Scene Manager\n~g~[Success]~w~ Waypoint {currentWaypoint.Number} updated.");
BuildEditWaypointMenu(); // Why am I rebuilding the menu??
//BuildEditWaypointMenu();
} }
if (selectedItem == addAsNewWaypoint) if (selectedItem == addAsNewWaypoint)
@ -244,7 +245,7 @@ namespace SceneManager
{ {
currentWaypoint.Remove(); currentWaypoint.Remove();
currentPath.Waypoints.Remove(currentWaypoint); currentPath.Waypoints.Remove(currentWaypoint);
Logger.Log($"[Path {currentPath.Number}] Waypoint {currentWaypoint.Number} ({currentWaypoint.DrivingFlag}) removed"); Logger.Log($"[Path {currentPath.Number}] Waypoint {currentWaypoint.Number} ({currentWaypoint.DrivingFlagType}) removed");
foreach (Waypoint wp in currentPath.Waypoints) foreach (Waypoint wp in currentPath.Waypoints)
{ {