Add option to disable blip and nametag display
This commit is contained in:
@ -17,6 +17,8 @@ namespace RageCoop.Client.Menus
|
|||||||
private static readonly NativeCheckboxItem _disableTrafficItem = new NativeCheckboxItem("Disable Traffic (NPCs/Vehicles)", "Local traffic only", Main.Settings.DisableTraffic);
|
private static readonly NativeCheckboxItem _disableTrafficItem = new NativeCheckboxItem("Disable Traffic (NPCs/Vehicles)", "Local traffic only", Main.Settings.DisableTraffic);
|
||||||
private static readonly NativeCheckboxItem _flipMenuItem = new NativeCheckboxItem("Flip menu", Main.Settings.FlipMenu);
|
private static readonly NativeCheckboxItem _flipMenuItem = new NativeCheckboxItem("Flip menu", Main.Settings.FlipMenu);
|
||||||
private static readonly NativeCheckboxItem _disablePauseAlt = new NativeCheckboxItem("Disable Alternate Pause", "Don't freeze game time when Esc pressed", Main.Settings.DisableAlternatePause);
|
private static readonly NativeCheckboxItem _disablePauseAlt = new NativeCheckboxItem("Disable Alternate Pause", "Don't freeze game time when Esc pressed", Main.Settings.DisableAlternatePause);
|
||||||
|
private static readonly NativeCheckboxItem _showBlip = new NativeCheckboxItem("Show player blip", "Show other player's blip on map", Main.Settings.ShowPlayerBlip);
|
||||||
|
private static readonly NativeCheckboxItem _showNametag = new NativeCheckboxItem("Show player nametag", "Show other player's nametag on your screen", Main.Settings.ShowPlayerNameTag);
|
||||||
private static readonly NativeCheckboxItem _disableVoice = new NativeCheckboxItem("Enable voice", "Check your GTA:V settings to find the right key on your keyboard for PushToTalk and talk to your friends", Main.Settings.Voice);
|
private static readonly NativeCheckboxItem _disableVoice = new NativeCheckboxItem("Enable voice", "Check your GTA:V settings to find the right key on your keyboard for PushToTalk and talk to your friends", Main.Settings.Voice);
|
||||||
|
|
||||||
private static readonly NativeItem _menuKey = new NativeItem("Menu Key", "The key to open menu", Main.Settings.MenuKey.ToString());
|
private static readonly NativeItem _menuKey = new NativeItem("Menu Key", "The key to open menu", Main.Settings.MenuKey.ToString());
|
||||||
@ -35,6 +37,16 @@ namespace RageCoop.Client.Menus
|
|||||||
_menuKey.Activated += ChaneMenuKey;
|
_menuKey.Activated += ChaneMenuKey;
|
||||||
_passengerKey.Activated += ChangePassengerKey;
|
_passengerKey.Activated += ChangePassengerKey;
|
||||||
_vehicleSoftLimit.Activated += VehicleSoftLimitActivated;
|
_vehicleSoftLimit.Activated += VehicleSoftLimitActivated;
|
||||||
|
_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(_disableTrafficItem);
|
||||||
Menu.Add(_disablePauseAlt);
|
Menu.Add(_disablePauseAlt);
|
||||||
@ -43,6 +55,8 @@ namespace RageCoop.Client.Menus
|
|||||||
Menu.Add(_menuKey);
|
Menu.Add(_menuKey);
|
||||||
Menu.Add(_passengerKey);
|
Menu.Add(_passengerKey);
|
||||||
Menu.Add(_vehicleSoftLimit);
|
Menu.Add(_vehicleSoftLimit);
|
||||||
|
Menu.Add(_showBlip);
|
||||||
|
Menu.Add(_showNametag);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void DisableVoiceCheckboxChanged(object sender, EventArgs e)
|
private static void DisableVoiceCheckboxChanged(object sender, EventArgs e)
|
||||||
|
@ -293,7 +293,7 @@ namespace RageCoop.Client
|
|||||||
{
|
{
|
||||||
recycle = false;
|
recycle = false;
|
||||||
// Dispatch to script thread
|
// Dispatch to script thread
|
||||||
Main.QueueAction(() => { SyncEvents.HandleEvent(packetType, msg); Peer.Recycle(msg); return true; });
|
Main.QueueAction(() => { SyncEvents.HandleEvent(packetType, msg); return true; });
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -76,5 +76,15 @@ namespace RageCoop.Client
|
|||||||
/// Show the owner name of the entity you're aiming at
|
/// Show the owner name of the entity you're aiming at
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool ShowEntityOwnerName { get; set; } = false;
|
public bool ShowEntityOwnerName { get; set; } = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Show other player's nametag on your screen
|
||||||
|
/// </summary>
|
||||||
|
public bool ShowPlayerNameTag { get; set; } = true;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Show other player's blip on map
|
||||||
|
/// </summary>
|
||||||
|
public bool ShowPlayerBlip { get; set; } = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ namespace RageCoop.Client
|
|||||||
MainPed = p;
|
MainPed = p;
|
||||||
OwnerID = Main.LocalPlayerID;
|
OwnerID = Main.LocalPlayerID;
|
||||||
|
|
||||||
Function.Call(Hash.SET_PED_IS_IGNORED_BY_AUTO_OPEN_DOORS, false);
|
//Function.Call(Hash.SET_PED_IS_IGNORED_BY_AUTO_OPEN_DOORS, false);
|
||||||
MainPed.SetConfigFlag((int)PedConfigFlags.CPED_CONFIG_FLAG_DisableHurt, true);
|
MainPed.SetConfigFlag((int)PedConfigFlags.CPED_CONFIG_FLAG_DisableHurt, true);
|
||||||
// MainPed.SetConfigFlag((int)PedConfigFlags.CPED_CONFIG_FLAG_DisableMelee, true);
|
// MainPed.SetConfigFlag((int)PedConfigFlags.CPED_CONFIG_FLAG_DisableMelee, true);
|
||||||
|
|
||||||
@ -76,12 +76,13 @@ namespace RageCoop.Client
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((byte)BlipColor == 255) && (PedBlip != null))
|
if (!Main.Settings.ShowPlayerBlip && (byte)BlipColor != 255) BlipColor = (BlipColor)255;
|
||||||
|
if ((byte)BlipColor == 255 && PedBlip != null)
|
||||||
{
|
{
|
||||||
PedBlip.Delete();
|
PedBlip.Delete();
|
||||||
PedBlip = null;
|
PedBlip = null;
|
||||||
}
|
}
|
||||||
else if (((byte)BlipColor != 255) && PedBlip == null)
|
else if ((byte)BlipColor != 255 && PedBlip == null)
|
||||||
{
|
{
|
||||||
PedBlip = MainPed.AddBlip();
|
PedBlip = MainPed.AddBlip();
|
||||||
|
|
||||||
@ -170,7 +171,7 @@ namespace RageCoop.Client
|
|||||||
|
|
||||||
private void RenderNameTag()
|
private void RenderNameTag()
|
||||||
{
|
{
|
||||||
if (!Owner.DisplayNameTag || (MainPed == null) || !MainPed.IsVisible || !MainPed.IsInRange(Main.PlayerPosition, 40f))
|
if (!Owner.DisplayNameTag || !Main.Settings.ShowPlayerNameTag || MainPed == null || !MainPed.IsVisible || !MainPed.IsInRange(Main.PlayerPosition, 40f))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -597,6 +598,8 @@ namespace RageCoop.Client
|
|||||||
MainPed.Task.StandStill(2000);
|
MainPed.Task.StandStill(2000);
|
||||||
LastMoving = false;
|
LastMoving = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (MainPed.IsTaskActive(TaskType.CTaskDiveToGround)) MainPed.Task.ClearAll();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
SmoothTransition();
|
SmoothTransition();
|
||||||
|
@ -277,7 +277,7 @@ namespace RageCoop.Client
|
|||||||
{
|
{
|
||||||
ProjectilesByHandle.Remove(p.Handle);
|
ProjectilesByHandle.Remove(p.Handle);
|
||||||
}
|
}
|
||||||
Main.Logger.Debug($"Removing projectile {sp.ID}. Reason:{reason}");
|
//Main.Logger.Debug($"Removing projectile {sp.ID}. Reason:{reason}");
|
||||||
if (sp.Exploded) p.Explode();
|
if (sp.Exploded) p.Explode();
|
||||||
}
|
}
|
||||||
ProjectilesByID.Remove(id);
|
ProjectilesByID.Remove(id);
|
||||||
|
Reference in New Issue
Block a user