Add option to show entity owner
This commit is contained in:
@ -18,6 +18,7 @@ namespace RageCoop.Client
|
|||||||
Alignment = Main.Settings.FlipMenu ? GTA.UI.Alignment.Right : GTA.UI.Alignment.Left
|
Alignment = Main.Settings.FlipMenu ? GTA.UI.Alignment.Right : GTA.UI.Alignment.Left
|
||||||
};
|
};
|
||||||
public static NativeItem SimulatedLatencyItem = new NativeItem("Simulated network latency", "Simulated network latency in ms (one way)", "0");
|
public static NativeItem SimulatedLatencyItem = new NativeItem("Simulated network latency", "Simulated network latency in ms (one way)", "0");
|
||||||
|
public static NativeCheckboxItem ShowOwnerItem = new NativeCheckboxItem("Show entity owner", "Show the owner name of the entity you're aiming at", false);
|
||||||
private static readonly NativeCheckboxItem ShowNetworkInfoItem = new NativeCheckboxItem("Show Network Info", Networking.ShowNetworkInfo);
|
private static readonly NativeCheckboxItem ShowNetworkInfoItem = new NativeCheckboxItem("Show Network Info", Networking.ShowNetworkInfo);
|
||||||
|
|
||||||
static DebugMenu()
|
static DebugMenu()
|
||||||
@ -43,9 +44,11 @@ namespace RageCoop.Client
|
|||||||
}
|
}
|
||||||
catch(Exception ex) { Main.Logger.Error(ex); }
|
catch(Exception ex) { Main.Logger.Error(ex); }
|
||||||
};
|
};
|
||||||
ShowNetworkInfoItem.CheckboxChanged += (s,e) => { Networking.ShowNetworkInfo = ShowNetworkInfoItem.Checked; };
|
ShowNetworkInfoItem.CheckboxChanged += (s, e) => { Networking.ShowNetworkInfo = ShowNetworkInfoItem.Checked; };
|
||||||
|
ShowOwnerItem.CheckboxChanged += (s, e) => { Main.Settings.ShowEntityOwnerName = ShowOwnerItem.Checked; Util.SaveSettings(); };
|
||||||
Menu.Add(SimulatedLatencyItem);
|
Menu.Add(SimulatedLatencyItem);
|
||||||
Menu.Add(ShowNetworkInfoItem);
|
Menu.Add(ShowNetworkInfoItem);
|
||||||
|
Menu.Add(ShowOwnerItem);
|
||||||
Menu.AddSubMenu(DiagnosticMenu);
|
Menu.AddSubMenu(DiagnosticMenu);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ using System.Resources;
|
|||||||
|
|
||||||
|
|
||||||
// Version informationr(
|
// Version informationr(
|
||||||
[assembly: AssemblyVersion("1.5.3.120")]
|
[assembly: AssemblyVersion("1.5.3.122")]
|
||||||
[assembly: AssemblyFileVersion("1.5.3.120")]
|
[assembly: AssemblyFileVersion("1.5.3.122")]
|
||||||
[assembly: NeutralResourcesLanguageAttribute( "en-US" )]
|
[assembly: NeutralResourcesLanguageAttribute( "en-US" )]
|
||||||
|
|
||||||
|
@ -71,5 +71,10 @@ namespace RageCoop.Client
|
|||||||
/// The directory where log and resources downloaded from server will be placed.
|
/// The directory where log and resources downloaded from server will be placed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string DataDirectory { get; set; } = "Scripts\\RageCoop\\Data";
|
public string DataDirectory { get; set; } = "Scripts\\RageCoop\\Data";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Show the owner name of the entity you're aiming at
|
||||||
|
/// </summary>
|
||||||
|
public bool ShowEntityOwnerName { get; set; } = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -58,6 +58,32 @@ namespace RageCoop.Client
|
|||||||
// Sets a value that determines how aggressive the ocean waves will be.
|
// Sets a value that determines how aggressive the ocean waves will be.
|
||||||
// Values of 2.0 or more make for very aggressive waves like you see during a thunderstorm.
|
// Values of 2.0 or more make for very aggressive waves like you see during a thunderstorm.
|
||||||
Function.Call(Hash.SET_DEEP_OCEAN_SCALER, 0.0f); // Works only ~200 meters around the player
|
Function.Call(Hash.SET_DEEP_OCEAN_SCALER, 0.0f); // Works only ~200 meters around the player
|
||||||
|
|
||||||
|
if (Main.Settings.ShowEntityOwnerName)
|
||||||
|
{
|
||||||
|
unsafe
|
||||||
|
{
|
||||||
|
int handle;
|
||||||
|
if (Function.Call<bool>(Hash.GET_ENTITY_PLAYER_IS_FREE_AIMING_AT, 0, &handle))
|
||||||
|
{
|
||||||
|
var entity = Entity.FromHandle(handle);
|
||||||
|
if (entity != null)
|
||||||
|
{
|
||||||
|
var owner = "invalid";
|
||||||
|
if (entity.EntityType == EntityType.Vehicle)
|
||||||
|
{
|
||||||
|
owner = (entity as Vehicle).GetSyncEntity()?.Owner?.Username ?? "unknown";
|
||||||
|
}
|
||||||
|
if (entity.EntityType == EntityType.Ped)
|
||||||
|
{
|
||||||
|
owner = (entity as Ped).GetSyncEntity()?.Owner?.Username ?? "unknown";
|
||||||
|
}
|
||||||
|
GTA.UI.Screen.ShowHelpTextThisFrame("Entity owner: " + owner);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public static void Traffic(bool enable)
|
public static void Traffic(bool enable)
|
||||||
{
|
{
|
||||||
|
@ -15,7 +15,7 @@ using System.Resources;
|
|||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
// Version information
|
// Version information
|
||||||
[assembly: AssemblyVersion("1.5.3.106")]
|
[assembly: AssemblyVersion("1.5.3.107")]
|
||||||
[assembly: AssemblyFileVersion("1.5.3.106")]
|
[assembly: AssemblyFileVersion("1.5.3.107")]
|
||||||
[assembly: NeutralResourcesLanguageAttribute( "en-US" )]
|
[assembly: NeutralResourcesLanguageAttribute( "en-US" )]
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user