Get active track from env var, instead of git branch

This commit is contained in:
goaaats 2025-11-26 21:07:49 +01:00
parent 1e7e7c732d
commit 9e5195492e
3 changed files with 20 additions and 8 deletions

View file

@ -1060,7 +1060,7 @@ internal class DalamudInterface : IInternalDisposableService
{
ImGui.PushFont(InterfaceManager.MonoFont);
ImGui.BeginMenu(Util.GetBranch() ?? "???", false);
ImGui.BeginMenu($"{Util.GetActiveTrack() ?? "???"} on {Util.GetGitBranch() ?? "???"}", false);
ImGui.BeginMenu($"{Util.GetScmVersion()}", false);
ImGui.BeginMenu(this.FrameCount.ToString("000000"), false);
ImGui.BeginMenu(ImGui.GetIO().Framerate.ToString("000"), false);

View file

@ -46,10 +46,12 @@ public class BranchSwitcherWindow : Window
this.branches = await client.GetFromJsonAsync<Dictionary<string, VersionEntry>>(BranchInfoUrl);
Debug.Assert(this.branches != null, "this.branches != null");
var branch = Util.GetBranch();
this.selectedBranchIndex = this.branches!.Any(x => x.Value.Track == branch) ?
this.branches.TakeWhile(x => x.Value.Track != branch).Count()
: 0;
var trackName = Util.GetActiveTrack();
this.selectedBranchIndex = this.branches.IndexOf(x => x.Value.Track != trackName);
if (this.selectedBranchIndex == -1)
{
this.selectedBranchIndex = 0;
}
});
base.OnOpen();