mirror of
https://github.com/thegeneralist01/Scene-Manager-DevRepo
synced 2026-01-11 23:50:29 +01:00
Removed DismissOption.FromDirect
This commit is contained in:
parent
772e618628
commit
080701b0b1
2 changed files with 4 additions and 35 deletions
|
|
@ -13,8 +13,7 @@ namespace SceneManager
|
||||||
FromPath = 0,
|
FromPath = 0,
|
||||||
FromWaypoint = 1,
|
FromWaypoint = 1,
|
||||||
FromWorld = 2,
|
FromWorld = 2,
|
||||||
FromDirect = 3,
|
FromPlayer = 3
|
||||||
FromPlayer = 4
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static class PathMainMenu
|
static class PathMainMenu
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ using System.Linq;
|
||||||
|
|
||||||
namespace SceneManager
|
namespace SceneManager
|
||||||
{
|
{
|
||||||
public class CollectedVehicle
|
internal class CollectedVehicle
|
||||||
{
|
{
|
||||||
internal Ped Driver { get; set; }
|
internal Ped Driver { get; set; }
|
||||||
internal Vehicle Vehicle { get; set; }
|
internal Vehicle Vehicle { get; set; }
|
||||||
|
|
@ -14,7 +14,7 @@ namespace SceneManager
|
||||||
internal bool Dismissed { get; set; } = false;
|
internal bool Dismissed { get; set; } = false;
|
||||||
internal bool Directed { get; set; } = false;
|
internal bool Directed { get; set; } = false;
|
||||||
internal bool SkipWaypoint { get; set; } = false;
|
internal bool SkipWaypoint { get; set; } = false;
|
||||||
internal bool ReadyForDirectTasks { get; set; } = false;
|
internal bool ReadyForDirectTasks { get; set; } = true;
|
||||||
|
|
||||||
internal CollectedVehicle(Vehicle vehicle, Path path, Waypoint currentWaypoint)
|
internal CollectedVehicle(Vehicle vehicle, Path path, Waypoint currentWaypoint)
|
||||||
{
|
{
|
||||||
|
|
@ -83,16 +83,11 @@ namespace SceneManager
|
||||||
DismissFromWaypoint();
|
DismissFromWaypoint();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(dismissOption == DismissOption.FromPath)
|
if (dismissOption == DismissOption.FromPath)
|
||||||
{
|
{
|
||||||
DismissFromPath();
|
DismissFromPath();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(dismissOption == DismissOption.FromDirect)
|
|
||||||
{
|
|
||||||
DismissFromDirect();
|
|
||||||
}
|
|
||||||
|
|
||||||
void DismissFromWorld()
|
void DismissFromWorld()
|
||||||
{
|
{
|
||||||
Game.LogTrivial($"Dismissed {Vehicle.Model.Name} from the world");
|
Game.LogTrivial($"Dismissed {Vehicle.Model.Name} from the world");
|
||||||
|
|
@ -176,31 +171,6 @@ namespace SceneManager
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DismissFromDirect()
|
|
||||||
{
|
|
||||||
Logger.Log($"Dismissing from direct.");
|
|
||||||
ReadyForDirectTasks = false;
|
|
||||||
GameFiber.StartNew(() =>
|
|
||||||
{
|
|
||||||
var nearestCollectorWaypoint = Path.Waypoints.Where(wp => wp.IsCollector).OrderBy(wp => Vehicle.DistanceTo2D(wp.Position)).FirstOrDefault();
|
|
||||||
if (nearestCollectorWaypoint != null)
|
|
||||||
{
|
|
||||||
// Enabling this will keep the menu, but the dismissed vehicle is immediately re - collected
|
|
||||||
while (nearestCollectorWaypoint != null && Vehicle && Driver && Vehicle.FrontPosition.DistanceTo2D(nearestCollectorWaypoint.Position) <= nearestCollectorWaypoint.CollectorRadius)
|
|
||||||
{
|
|
||||||
//Game.LogTrivial($"{Vehicle.Model.Name} is within 2x collector radius, cannot be fully dismissed yet.");
|
|
||||||
GameFiber.Yield();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Logger.Log($"Nearest collector is null");
|
|
||||||
}
|
|
||||||
|
|
||||||
ReadyForDirectTasks = true;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue