Merge branch 'feature/branchswitcher' into net5

This commit is contained in:
goat 2022-07-10 17:32:14 +02:00
commit 082aa2f0b1
No known key found for this signature in database
GPG key ID: 7773BB5B43BA52E5
4 changed files with 157 additions and 17 deletions

View file

@ -56,6 +56,7 @@ namespace Dalamud.Interface.Internal
private readonly StyleEditorWindow styleEditorWindow;
private readonly TitleScreenMenuWindow titleScreenMenuWindow;
private readonly ProfilerWindow profilerWindow;
private readonly BranchSwitcherWindow branchSwitcherWindow;
private readonly TextureWrap logoTexture;
private readonly TextureWrap tsmLogoTexture;
@ -100,6 +101,7 @@ namespace Dalamud.Interface.Internal
this.styleEditorWindow = new StyleEditorWindow() { IsOpen = false };
this.titleScreenMenuWindow = new TitleScreenMenuWindow() { IsOpen = false };
this.profilerWindow = new ProfilerWindow() { IsOpen = false };
this.branchSwitcherWindow = new BranchSwitcherWindow() { IsOpen = false };
this.WindowSystem.AddWindow(this.changelogWindow);
this.WindowSystem.AddWindow(this.colorDemoWindow);
@ -116,6 +118,7 @@ namespace Dalamud.Interface.Internal
this.WindowSystem.AddWindow(this.styleEditorWindow);
this.WindowSystem.AddWindow(this.titleScreenMenuWindow);
this.WindowSystem.AddWindow(this.profilerWindow);
this.WindowSystem.AddWindow(this.branchSwitcherWindow);
ImGuiManagedAsserts.AssertsEnabled = configuration.AssertsEnabledAtStartup;
this.isImGuiDrawDevMenu = this.isImGuiDrawDevMenu || configuration.DevBarOpenAtStartup;
@ -139,7 +142,7 @@ namespace Dalamud.Interface.Internal
tsm.AddEntryCore(Loc.Localize("TSMDalamudPlugins", "Plugin Installer"), this.tsmLogoTexture, () => this.pluginWindow.IsOpen = true);
tsm.AddEntryCore(Loc.Localize("TSMDalamudSettings", "Dalamud Settings"), this.tsmLogoTexture, () => this.settingsWindow.IsOpen = true);
if (configuration.IsConventionalStaging)
if (!configuration.DalamudBetaKind.IsNullOrEmpty())
{
tsm.AddEntryCore(Loc.Localize("TSMDalamudDevMenu", "Developer Menu"), this.tsmLogoTexture, () => this.isImGuiDrawDevMenu = true);
}
@ -266,6 +269,11 @@ namespace Dalamud.Interface.Internal
/// </summary>
public void OpenProfiler() => this.profilerWindow.IsOpen = true;
/// <summary>
/// Opens the <see cref="BranchSwitcherWindow"/>
/// </summary>
public void OpenBranchSwitcher() => this.branchSwitcherWindow.IsOpen = true;
#endregion
#region Close
@ -618,17 +626,15 @@ namespace Dalamud.Interface.Internal
ImGui.Separator();
var isBeta = configuration.DalamudBetaKey == DalamudConfiguration.DalamudCurrentBetaKey;
if (ImGui.MenuItem("Enable Dalamud testing", string.Empty, isBeta))
if (ImGui.MenuItem("Open Dalamud branch switcher"))
{
configuration.DalamudBetaKey = isBeta ? null : DalamudConfiguration.DalamudCurrentBetaKey;
configuration.Save();
this.OpenBranchSwitcher();
}
var startInfo = Service<DalamudStartInfo>.Get();
ImGui.MenuItem(Util.AssemblyVersion, false);
ImGui.MenuItem(startInfo.GameVersion.ToString(), false);
ImGui.MenuItem($"CS: {Util.GetGitHashClientStructs()}", false);
ImGui.MenuItem($"D: {Util.GetGitHash()} CS: {Util.GetGitHashClientStructs()}", false);
ImGui.EndMenu();
}