mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 10:17:22 +01:00
Merge pull request #2460 from goatcorp/api14-rollup
[api14] Rollup changes from master
This commit is contained in:
commit
62b9c1f2a1
4 changed files with 38 additions and 10 deletions
|
|
@ -162,6 +162,9 @@
|
|||
<Exec Command="git -C "$(ProjectDir.Replace('\','\\'))" describe --tags --always --dirty" ConsoleToMSBuild="true">
|
||||
<Output TaskParameter="ConsoleOutput" PropertyName="DalamudGitDescribeOutput" />
|
||||
</Exec>
|
||||
<Exec Command="git -C "$(ProjectDir.Replace('\','\\'))" rev-parse --abbrev-ref HEAD" ConsoleToMSBuild="true">
|
||||
<Output TaskParameter="ConsoleOutput" PropertyName="DalamudGitBranch" />
|
||||
</Exec>
|
||||
<Exec Command="git -C "$(ProjectDir.Replace('\','\\'))\..\lib\FFXIVClientStructs" describe --long --always --dirty" ConsoleToMSBuild="true">
|
||||
<Output TaskParameter="ConsoleOutput" PropertyName="ClientStructsGitDescribeOutput" />
|
||||
</Exec>
|
||||
|
|
@ -169,6 +172,7 @@
|
|||
<PropertyGroup>
|
||||
<CommitCount>$([System.Text.RegularExpressions.Regex]::Replace($(DalamudGitCommitCount), @"\t|\n|\r", ""))</CommitCount>
|
||||
<CommitHash>$([System.Text.RegularExpressions.Regex]::Replace($(DalamudGitCommitHash), @"\t|\n|\r", ""))</CommitHash>
|
||||
<Branch>$([System.Text.RegularExpressions.Regex]::Replace($(DalamudGitBranch), @"\t|\n|\r", ""))</Branch>
|
||||
<SCMVersion>$([System.Text.RegularExpressions.Regex]::Replace($(DalamudGitDescribeOutput), @"\t|\n|\r", ""))</SCMVersion>
|
||||
<CommitHashClientStructs>$([System.Text.RegularExpressions.Regex]::Replace($(ClientStructsGitDescribeOutput), @"\t|\n|\r", ""))</CommitHashClientStructs>
|
||||
</PropertyGroup>
|
||||
|
|
@ -182,6 +186,7 @@
|
|||
<!-- stub out version since it takes a while. -->
|
||||
<PropertyGroup>
|
||||
<SCMVersion>Local build at $([System.DateTime]::Now.ToString(yyyy-MM-dd HH:mm:ss))</SCMVersion>
|
||||
<Branch>???</Branch>
|
||||
<CommitHashClientStructs>???</CommitHashClientStructs>
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
|
|
@ -205,6 +210,10 @@
|
|||
<_Parameter1>GitCommitCount</_Parameter1>
|
||||
<_Parameter2>$(CommitCount)</_Parameter2>
|
||||
</AssemblyAttributes>
|
||||
<AssemblyAttributes Include="AssemblyMetadata" Condition="'$(Branch)' != ''">
|
||||
<_Parameter1>GitBranch</_Parameter1>
|
||||
<_Parameter2>$(Branch)</_Parameter2>
|
||||
</AssemblyAttributes>
|
||||
<AssemblyAttributes Include="AssemblyMetadata" Condition="'$(CommitHashClientStructs)' != ''">
|
||||
<_Parameter1>GitHashClientStructs</_Parameter1>
|
||||
<_Parameter2>$(CommitHashClientStructs)</_Parameter2>
|
||||
|
|
|
|||
|
|
@ -1060,7 +1060,8 @@ internal class DalamudInterface : IInternalDisposableService
|
|||
{
|
||||
ImGui.PushFont(InterfaceManager.MonoFont);
|
||||
|
||||
ImGui.BeginMenu(Util.GetScmVersion(), false);
|
||||
ImGui.BeginMenu(Util.GetBranch() ?? "???", false);
|
||||
ImGui.BeginMenu($"{Util.GetScmVersion()}", false);
|
||||
ImGui.BeginMenu(this.FrameCount.ToString("000000"), false);
|
||||
ImGui.BeginMenu(ImGui.GetIO().Framerate.ToString("000"), false);
|
||||
ImGui.BeginMenu($"W:{Util.FormatBytes(GC.GetTotalMemory(false))}", false);
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@ using Dalamud.Interface.Colors;
|
|||
using Dalamud.Interface.Utility;
|
||||
using Dalamud.Interface.Windowing;
|
||||
using Dalamud.Networking.Http;
|
||||
using Dalamud.Utility;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Dalamud.Interface.Internal.Windows;
|
||||
|
|
@ -44,13 +46,10 @@ public class BranchSwitcherWindow : Window
|
|||
this.branches = await client.GetFromJsonAsync<Dictionary<string, VersionEntry>>(BranchInfoUrl);
|
||||
Debug.Assert(this.branches != null, "this.branches != null");
|
||||
|
||||
var config = Service<DalamudConfiguration>.Get();
|
||||
this.selectedBranchIndex = this.branches!.Any(x => x.Key == config.DalamudBetaKind) ?
|
||||
this.branches.TakeWhile(x => x.Key != config.DalamudBetaKind).Count()
|
||||
var branch = Util.GetBranch();
|
||||
this.selectedBranchIndex = this.branches!.Any(x => x.Value.Track == branch) ?
|
||||
this.branches.TakeWhile(x => x.Value.Track != branch).Count()
|
||||
: 0;
|
||||
|
||||
if (this.branches.ElementAt(this.selectedBranchIndex).Value.Key != config.DalamudBetaKey)
|
||||
this.selectedBranchIndex = 0;
|
||||
});
|
||||
|
||||
base.OnOpen();
|
||||
|
|
@ -88,13 +87,12 @@ public class BranchSwitcherWindow : Window
|
|||
var config = Service<DalamudConfiguration>.Get();
|
||||
config.DalamudBetaKind = pickedBranch.Key;
|
||||
config.DalamudBetaKey = pickedBranch.Value.Key;
|
||||
config.QueueSave();
|
||||
|
||||
// If we exit immediately, we need to write out the new config now
|
||||
Service<DalamudConfiguration>.Get().ForceSave();
|
||||
config.ForceSave();
|
||||
|
||||
var appData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
|
||||
var xlPath = Path.Combine(appData, "XIVLauncher", "XIVLauncher.exe");
|
||||
var xlPath = Path.Combine(appData, "XIVLauncher", "current", "XIVLauncher.exe");
|
||||
|
||||
if (File.Exists(xlPath))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -67,6 +67,7 @@ public static partial class Util
|
|||
private static string? scmVersionInternal;
|
||||
private static string? gitHashInternal;
|
||||
private static string? gitHashClientStructsInternal;
|
||||
private static string? branchInternal;
|
||||
|
||||
private static ulong moduleStartAddr;
|
||||
private static ulong moduleEndAddr;
|
||||
|
|
@ -134,6 +135,25 @@ public static partial class Util
|
|||
return gitHashClientStructsInternal;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Dalamud branch name this version of Dalamud was built from, or null, if this is a Debug build.
|
||||
/// </summary>
|
||||
/// <returns>The branch name.</returns>
|
||||
public static string? GetBranch()
|
||||
{
|
||||
if (branchInternal != null)
|
||||
return branchInternal;
|
||||
|
||||
var asm = typeof(Util).Assembly;
|
||||
var attrs = asm.GetCustomAttributes<AssemblyMetadataAttribute>();
|
||||
|
||||
var gitBranch = attrs.FirstOrDefault(a => a.Key == "GitBranch")?.Value;
|
||||
if (gitBranch == null)
|
||||
return null;
|
||||
|
||||
return branchInternal = gitBranch == "master" ? "release" : gitBranch;
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="DescribeAddress(nint)"/>
|
||||
public static unsafe string DescribeAddress(void* p) => DescribeAddress((nint)p);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue