mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 10:17:22 +01:00
Get active track from env var, instead of git branch
This commit is contained in:
parent
1e7e7c732d
commit
9e5195492e
3 changed files with 20 additions and 8 deletions
|
|
@ -1060,7 +1060,7 @@ internal class DalamudInterface : IInternalDisposableService
|
||||||
{
|
{
|
||||||
ImGui.PushFont(InterfaceManager.MonoFont);
|
ImGui.PushFont(InterfaceManager.MonoFont);
|
||||||
|
|
||||||
ImGui.BeginMenu(Util.GetBranch() ?? "???", false);
|
ImGui.BeginMenu($"{Util.GetActiveTrack() ?? "???"} on {Util.GetGitBranch() ?? "???"}", false);
|
||||||
ImGui.BeginMenu($"{Util.GetScmVersion()}", false);
|
ImGui.BeginMenu($"{Util.GetScmVersion()}", false);
|
||||||
ImGui.BeginMenu(this.FrameCount.ToString("000000"), false);
|
ImGui.BeginMenu(this.FrameCount.ToString("000000"), false);
|
||||||
ImGui.BeginMenu(ImGui.GetIO().Framerate.ToString("000"), false);
|
ImGui.BeginMenu(ImGui.GetIO().Framerate.ToString("000"), false);
|
||||||
|
|
|
||||||
|
|
@ -46,10 +46,12 @@ public class BranchSwitcherWindow : Window
|
||||||
this.branches = await client.GetFromJsonAsync<Dictionary<string, VersionEntry>>(BranchInfoUrl);
|
this.branches = await client.GetFromJsonAsync<Dictionary<string, VersionEntry>>(BranchInfoUrl);
|
||||||
Debug.Assert(this.branches != null, "this.branches != null");
|
Debug.Assert(this.branches != null, "this.branches != null");
|
||||||
|
|
||||||
var branch = Util.GetBranch();
|
var trackName = Util.GetActiveTrack();
|
||||||
this.selectedBranchIndex = this.branches!.Any(x => x.Value.Track == branch) ?
|
this.selectedBranchIndex = this.branches.IndexOf(x => x.Value.Track != trackName);
|
||||||
this.branches.TakeWhile(x => x.Value.Track != branch).Count()
|
if (this.selectedBranchIndex == -1)
|
||||||
: 0;
|
{
|
||||||
|
this.selectedBranchIndex = 0;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
base.OnOpen();
|
base.OnOpen();
|
||||||
|
|
|
||||||
|
|
@ -140,10 +140,10 @@ public static partial class Util
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the Dalamud branch name this version of Dalamud was built from, or null, if this is a Debug build.
|
/// Gets the Git branch name this version of Dalamud was built from, or null, if this is a Debug build.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>The branch name.</returns>
|
/// <returns>The branch name.</returns>
|
||||||
public static string? GetBranch()
|
public static string? GetGitBranch()
|
||||||
{
|
{
|
||||||
if (branchInternal != null)
|
if (branchInternal != null)
|
||||||
return branchInternal;
|
return branchInternal;
|
||||||
|
|
@ -155,7 +155,17 @@ public static partial class Util
|
||||||
if (gitBranch == null)
|
if (gitBranch == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return branchInternal = gitBranch == "master" ? "release" : gitBranch;
|
return branchInternal = gitBranch;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the active Dalamud track, if this instance was launched through XIVLauncher and used a version
|
||||||
|
/// downloaded from webservices.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>The name of the track, or null.</returns>
|
||||||
|
internal static string? GetActiveTrack()
|
||||||
|
{
|
||||||
|
return Environment.GetEnvironmentVariable("DALAMUD_BRANCH");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc cref="DescribeAddress(nint)"/>
|
/// <inheritdoc cref="DescribeAddress(nint)"/>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue