Add Xenon Headlights Color Sync (#45)

This commit is contained in:
Hydraxonn
2023-03-20 11:13:43 -04:00
committed by GitHub
parent e6718cec58
commit db7146e00e
5 changed files with 15 additions and 1 deletions

View File

@ -30,6 +30,7 @@ namespace RageCoop.Client
internal byte RadioStation = 255;
internal string LicensePlate { get; set; }
internal int Livery { get; set; } = -1;
internal byte HeadlightColor { get; set; } = 255;
internal VehicleDataFlags Flags { get; set; }
internal ushort ExtrasMask;
@ -74,6 +75,7 @@ namespace RageCoop.Client
private bool _lastHornActive;
private bool _lastTransformed;
private int _lastLivery = -1;
private byte _lastHeadlightColor = 255;
private Vector3 _predictedPosition;
#endregion

View File

@ -3,6 +3,7 @@ using System.Linq;
using GTA;
using GTA.Math;
using GTA.Native;
using GTA.UI;
using RageCoop.Core;
using static ICSharpCode.SharpZipLib.Zip.ExtendedUnixData;
@ -151,6 +152,11 @@ namespace RageCoop.Client
_lastLivery = Livery;
}
if (_lastHeadlightColor != HeadlightColor)
{
Call(SET_VEHICLE_XENON_LIGHT_COLOR_INDEX, MainVehicle.Handle, HeadlightColor);
_lastHeadlightColor = HeadlightColor;
}
MainVehicle.SetDamageModel(DamageModel);
if (MainVehicle.Handle == V?.Handle && Util.GetPlayerRadioIndex() != RadioStation)