Save blip and nametag settings

This commit is contained in:
sardelka9515
2022-11-20 16:29:11 +08:00
parent 979be4cfa8
commit 598790dedd
2 changed files with 14 additions and 5 deletions

View File

@ -31,8 +31,8 @@ namespace RageCoop.Client.Menus
private static readonly NativeCheckboxItem _showBlip = new NativeCheckboxItem("Show player blip",
"Show other player's nametag on your screen, only effective if server didn't disable nametag display",
Main.Settings.ShowPlayerBlip);
Main.Settings.ShowPlayerBlip);
private static readonly NativeCheckboxItem _showNametag = new NativeCheckboxItem("Show player nametag",
"Show other player's blip on map, can be overridden by server resource ",
Main.Settings.ShowPlayerNameTag);
@ -59,8 +59,16 @@ namespace RageCoop.Client.Menus
_menuKey.Activated += ChaneMenuKey;
_passengerKey.Activated += ChangePassengerKey;
_vehicleSoftLimit.Activated += VehicleSoftLimitActivated;
_showBlip.Activated += (s, e) => Main.Settings.ShowPlayerBlip = _showBlip.Checked;
_showNametag.Activated += (s, e) => Main.Settings.ShowPlayerNameTag = _showNametag.Checked;
_showBlip.Activated += (s, e) =>
{
Main.Settings.ShowPlayerBlip = _showBlip.Checked;
Util.SaveSettings();
};
_showNametag.Activated += (s, e) =>
{
Main.Settings.ShowPlayerNameTag = _showNametag.Checked;
Util.SaveSettings();
};
Menu.Add(_disableTrafficItem);
Menu.Add(_disablePauseAlt);

View File

@ -161,7 +161,8 @@ namespace RageCoop.Client
_predictedPosition = Predict(Position);
var current = MainVehicle.ReadPosition();
var distSquared = current.DistanceToSquared(_predictedPosition);
var cali = _predictedPosition - current + 0.5f * (Velocity - MainVehicle.Velocity);
var cali = _predictedPosition - current;
if (!IsTrain) { cali += 0.5f * (Velocity - MainVehicle.Velocity); }
if (distSquared > 10 * 10)
{
MainVehicle.Position = _predictedPosition;