mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
feat: show client structs hash in Game submenu
This commit is contained in:
parent
9588e12619
commit
6a977fb59e
4 changed files with 33 additions and 3 deletions
|
|
@ -105,16 +105,22 @@
|
|||
<PropertyGroup>
|
||||
<!-- temp file for the git version (lives in "obj" folder)-->
|
||||
<VerFile>$(IntermediateOutputPath)gitver</VerFile>
|
||||
<VerFileClientStructs>$(IntermediateOutputPath)csver</VerFileClientStructs>
|
||||
</PropertyGroup>
|
||||
<!-- write the hash to the temp file.-->
|
||||
<Exec Command="git -C "$(ProjectDir.Replace('\','\\'))" describe --long --always --dirty > $(VerFile)" />
|
||||
<Exec Command="git -C "$(ProjectDir.Replace('\','\\'))\..\lib\FFXIVClientStructs" describe --long --always --dirty > $(VerFileClientStructs)" />
|
||||
<!-- read the version into the GitVersion itemGroup-->
|
||||
<ReadLinesFromFile File="$(VerFile)">
|
||||
<Output TaskParameter="Lines" ItemName="GitVersion" />
|
||||
</ReadLinesFromFile>
|
||||
<ReadLinesFromFile File="$(VerFileClientStructs)">
|
||||
<Output TaskParameter="Lines" ItemName="GitVersionClientStructs" />
|
||||
</ReadLinesFromFile>
|
||||
<!-- Set the BuildHash property to contain the GitVersion, if it wasn't already set.-->
|
||||
<PropertyGroup>
|
||||
<BuildHash>@(GitVersion)</BuildHash>
|
||||
<BuildHashClientStructs>@(GitVersionClientStructs)</BuildHashClientStructs>
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
<Target Name="WriteGitHash" BeforeTargets="CoreCompile">
|
||||
|
|
@ -132,6 +138,10 @@
|
|||
<_Parameter1>GitHash</_Parameter1>
|
||||
<_Parameter2>$(BuildHash)</_Parameter2>
|
||||
</AssemblyAttributes>
|
||||
<AssemblyAttributes Include="AssemblyMetadata">
|
||||
<_Parameter1>GitHashClientStructs</_Parameter1>
|
||||
<_Parameter2>$(BuildHashClientStructs)</_Parameter2>
|
||||
</AssemblyAttributes>
|
||||
</ItemGroup>
|
||||
<!-- writes the attribute to the customAssemblyInfo file -->
|
||||
<WriteCodeFragment Language="C#" OutputFile="$(CustomAssemblyInfoFile)" AssemblyAttributes="@(AssemblyAttributes)" />
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ namespace Dalamud.Game.Network.Structures
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Category of this ResultDialog packet.
|
||||
/// Gets the category of this ResultDialog packet.
|
||||
/// </summary>
|
||||
public uint Category { get; private set; }
|
||||
|
||||
|
|
|
|||
|
|
@ -507,6 +507,7 @@ namespace Dalamud.Interface.Internal
|
|||
var startInfo = Service<DalamudStartInfo>.Get();
|
||||
ImGui.MenuItem(Util.AssemblyVersion, false);
|
||||
ImGui.MenuItem(startInfo.GameVersion.ToString(), false);
|
||||
ImGui.MenuItem($"CS: {Util.GetGitHashClientStructs()}", false);
|
||||
|
||||
ImGui.EndMenu();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,8 @@ namespace Dalamud.Utility
|
|||
/// </summary>
|
||||
public static class Util
|
||||
{
|
||||
private static string gitHashInternal;
|
||||
private static string? gitHashInternal;
|
||||
private static string? gitHashClientStructsInternal;
|
||||
|
||||
/// <summary>
|
||||
/// Gets an httpclient for usage.
|
||||
|
|
@ -48,11 +49,29 @@ namespace Dalamud.Utility
|
|||
var asm = typeof(Util).Assembly;
|
||||
var attrs = asm.GetCustomAttributes<AssemblyMetadataAttribute>();
|
||||
|
||||
gitHashInternal = attrs.FirstOrDefault(a => a.Key == "GitHash")?.Value;
|
||||
gitHashInternal = attrs.First(a => a.Key == "GitHash").Value;
|
||||
|
||||
return gitHashInternal;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the git hash value from the assembly
|
||||
/// or null if it cannot be found.
|
||||
/// </summary>
|
||||
/// <returns>The git hash of the assembly.</returns>
|
||||
public static string GetGitHashClientStructs()
|
||||
{
|
||||
if (gitHashClientStructsInternal != null)
|
||||
return gitHashClientStructsInternal;
|
||||
|
||||
var asm = typeof(Util).Assembly;
|
||||
var attrs = asm.GetCustomAttributes<AssemblyMetadataAttribute>();
|
||||
|
||||
gitHashClientStructsInternal = attrs.First(a => a.Key == "GitHashClientStructs").Value;
|
||||
|
||||
return gitHashClientStructsInternal;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Read memory from an offset and hexdump them via Serilog.
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue