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

Adding waypoint no longer resets the waypoint type, fixed a bug and crash with remove waypoint option. Functional version before major menu updates

This commit is contained in:
Rich Dunne 2020-06-15 17:28:46 -06:00
parent 071ac92ba0
commit 33b9dcb0d3
4 changed files with 9 additions and 7 deletions

View file

@ -1,7 +1,7 @@
using System.Windows.Forms;
using Rage;
[assembly: Rage.Attributes.Plugin("Scene Manager V1.7", Author = "Rich", Description = "Manage your scenes with custom AI traffic pathing and cone placement.")]
[assembly: Rage.Attributes.Plugin("Scene Manager V2.0", Author = "Rich", Description = "Manage your scenes with custom AI traffic pathing and cone placement.")]
namespace SceneManager
{

View file

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.7.0.0")]
[assembly: AssemblyFileVersion("1.7.0.0")]
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]

View file

@ -451,7 +451,7 @@ namespace SceneManager
deleteAllPaths.Enabled = false;
directDriver.Enabled = false;
}
_menuPool.RefreshIndex();
//_menuPool.RefreshIndex(); // Disabling this to stop resetting waypoint menu after waypoint is added
}
if (selectedItem == trafficRemoveWaypoint)
@ -466,7 +466,7 @@ namespace SceneManager
paths[i].WaypointData.RemoveAt(paths[i].WaypointData.IndexOf(paths[i].WaypointData.Last()));
// If the path has no waypoints, disable the menu option to remove a waypoint
if (paths[0].WaypointData.Count == 0)
if (paths[i].WaypointData.Count == 0)
{
trafficRemoveWaypoint.Enabled = false;
}
@ -498,7 +498,7 @@ namespace SceneManager
else
{
Game.LogTrivial($"[Path Error] A minimum of 2 waypoints is required.");
Game.DisplayNotification($"~o~Scene Manager\n~r~[Error]~w~ A minimum of 2 waypoints is required.");
Game.DisplayNotification($"~o~Scene Manager\n~r~[Error]~w~ A minimum of 2 waypoints or one stop waypoint is required to create a path.");
foreach (WaypointData wd in paths[i].WaypointData)
{
wd.WaypointBlip.Delete();

View file

@ -35,7 +35,7 @@ namespace SceneManager
while (waypointData.ElementAtOrDefault(0) != null)
{
Game.DisplaySubtitle($"Vehicles in collection: {ControlledVehicles.Count()}");
//Game.DisplaySubtitle($"Vehicles in collection: {ControlledVehicles.Count()}");
// Getting vehicles within 3f of waypoint
try
{
@ -240,6 +240,7 @@ namespace SceneManager
return (from x in World.GetAllVehicles() where !x.IsTrailer && x.DistanceTo(OriginPosition) < radius select x).ToArray();
}
// Driving styles https://gtaforums.com/topic/822314-guide-driving-styles/
[Flags]
public enum EDrivingFlags
{
@ -253,6 +254,7 @@ namespace SceneManager
IgnoreRoads = 4194304,
AvoidHighways = 536870912,
Normal = StopForVehicles | StopForPeds | AvoidEmptyVehicles | StopForTrafficLights | UseBlinkers,
//TotalControl = AllowMedianCrossing | AllowWrongWay | DriveAroundObjects | DriveAroundPeds | DriveBySight | FollowTraffic | IgnorePathfinding
}
public static void SetDriveTaskDrivingFlags(this Ped ped, EDrivingFlags flags)