Merge branch '1.6-pre-alpha' of https://github.com/RAGECOOP/RAGECOOP-V into 1.6-pre-alpha

This commit is contained in:
Sardelka9515 2023-03-23 22:30:42 +08:00
commit 3944d41e85
5 changed files with 15 additions and 1 deletions

View File

@ -350,6 +350,7 @@ namespace RageCoop.Client
v.RadioStation = packet.RadioStation;
v.LicensePlate = packet.LicensePlate;
v.Livery = packet.Livery;
v.HeadlightColor = packet.HeadlightColor;
v.ExtrasMask = packet.ExtrasMask;
}
v.SetLastSynced(full);

View File

@ -136,6 +136,7 @@ namespace RageCoop.Client
packet.LockStatus = veh.LockStatus;
packet.LicensePlate = Call<string>(GET_VEHICLE_NUMBER_PLATE_TEXT, veh);
packet.Livery = Call<int>(GET_VEHICLE_LIVERY, veh);
packet.HeadlightColor = (byte)Call<int>(GET_VEHICLE_XENON_LIGHT_COLOR_INDEX, veh);
packet.ExtrasMask = v.GetVehicleExtras();
packet.RadioStation = v.MainVehicle == LastV
? Util.GetPlayerRadioIndex() : byte.MaxValue;

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;
internal byte ToggleModsMask;
@ -75,6 +76,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;
@ -159,6 +160,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)

View File

@ -101,6 +101,8 @@ namespace RageCoop.Core
m.Write((byte)(Livery + 1));
m.Write(HeadlightColor);
m.Write(ExtrasMask);
}
}
@ -176,6 +178,8 @@ namespace RageCoop.Core
Livery = m.ReadByte() - 1;
HeadlightColor = m.ReadByte();
ExtrasMask = m.ReadUInt16();
}
@ -202,7 +206,7 @@ namespace RageCoop.Core
public VehicleLockStatus LockStatus { get; set; }
public int Livery { get; set; } = -1;
public byte HeadlightColor { get; set; } = 255;
public byte RadioStation { get; set; } = 255;
public string LicensePlate { get; set; }