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

Fixed blip colors not updating correctly when a waypoint is updated. Fixed 3D waypoints not drawing when the setting is disabled then re-enabled. Fixed a crash when blip setting is disabled then re-enabled.

This commit is contained in:
Rich Dunne 2020-10-11 14:59:46 -06:00
parent a06a2bbebe
commit 57a65e9031

View file

@ -16,7 +16,6 @@ namespace SceneManager
internal int Number { get; set; } internal int Number { get; set; }
internal Vector3 Position { get; set; } internal Vector3 Position { get; set; }
internal float Speed { get; set; } internal float Speed { get; set; }
//internal VehicleDrivingFlags DrivingFlag { get; set; }
internal DrivingFlagType DrivingFlagType { get; private set; } internal DrivingFlagType DrivingFlagType { get; private set; }
internal bool IsStopWaypoint { get; set; } internal bool IsStopWaypoint { get; set; }
internal Blip Blip { get; } internal Blip Blip { get; }
@ -34,7 +33,6 @@ namespace SceneManager
Number = waypointNum; Number = waypointNum;
Position = waypointPos; Position = waypointPos;
Speed = speed; Speed = speed;
//DrivingFlag = drivingFlag;
DrivingFlagType = drivingFlag; DrivingFlagType = drivingFlag;
IsStopWaypoint = stopWaypoint; IsStopWaypoint = stopWaypoint;
Blip = waypointBlip; Blip = waypointBlip;
@ -85,7 +83,7 @@ namespace SceneManager
cv.Dismiss(DismissOption.FromWaypoint); cv.Dismiss(DismissOption.FromWaypoint);
} }
} }
else if(!IsStopWaypoint && stopWaypoint) else if(stopWaypoint && !IsStopWaypoint)
{ {
Blip.Color = Color.Red; Blip.Color = Color.Red;
} }
@ -124,6 +122,14 @@ namespace SceneManager
else else
{ {
IsCollector = false; IsCollector = false;
if (IsStopWaypoint)
{
Blip.Color = Color.Red;
}
else
{
Blip.Color = Color.Green;
}
RemoveSpeedZone(); RemoveSpeedZone();
if (CollectorRadiusBlip) if (CollectorRadiusBlip)
{ {
@ -181,7 +187,9 @@ namespace SceneManager
// This is called once when the waypoint is created // This is called once when the waypoint is created
GameFiber.StartNew(() => GameFiber.StartNew(() =>
{ {
while (SettingsMenu.threeDWaypoints.Checked && EnableWaypointMarker && Path.Waypoints.Contains(this)) while (true)
{
if(SettingsMenu.threeDWaypoints.Checked && EnableWaypointMarker && Path.Waypoints.Contains(this))
{ {
if (EditWaypointMenu.editWaypointMenu.Visible && PathMainMenu.editPath.Value == Path.Number && EditWaypointMenu.editWaypoint.Value == Number) if (EditWaypointMenu.editWaypointMenu.Visible && PathMainMenu.editPath.Value == Path.Number && EditWaypointMenu.editWaypoint.Value == Number)
{ {
@ -233,6 +241,7 @@ namespace SceneManager
Rage.Native.NativeFunction.Natives.DRAW_MARKER(1, Position.X, Position.Y, Position.Z - 1, 0, 0, 0, 0, 0, 0, 1f, 1f, markerHeight, 65, 255, 65, 100, false, false, 2, false, 0, 0, false); Rage.Native.NativeFunction.Natives.DRAW_MARKER(1, Position.X, Position.Y, Position.Z - 1, 0, 0, 0, 0, 0, 0, 1f, 1f, markerHeight, 65, 255, 65, 100, false, false, 2, false, 0, 0, false);
} }
} }
}
GameFiber.Yield(); GameFiber.Yield();
} }
@ -241,23 +250,41 @@ namespace SceneManager
internal void EnableBlip() internal void EnableBlip()
{ {
if(!PathMainMenu.paths.Where(p => p == Path).First().IsEnabled) if(!Path.IsEnabled)
{
if (Blip)
{ {
Blip.Alpha = 0.5f; Blip.Alpha = 0.5f;
}
if (CollectorRadiusBlip)
{
CollectorRadiusBlip.Alpha = 0.25f; CollectorRadiusBlip.Alpha = 0.25f;
} }
}
else else
{
if (Blip)
{ {
Blip.Alpha = 1.0f; Blip.Alpha = 1.0f;
}
if (CollectorRadiusBlip)
{
CollectorRadiusBlip.Alpha = 0.5f; CollectorRadiusBlip.Alpha = 0.5f;
} }
}
} }
internal void DisableBlip() internal void DisableBlip()
{
if (Blip)
{ {
Blip.Alpha = 0; Blip.Alpha = 0;
}
if (CollectorRadiusBlip)
{
CollectorRadiusBlip.Alpha = 0; CollectorRadiusBlip.Alpha = 0;
} }
} }
}
} }