diff --git a/Dalamud/Configuration/Internal/DalamudConfiguration.cs b/Dalamud/Configuration/Internal/DalamudConfiguration.cs index b4263679e..05cb48e3c 100644 --- a/Dalamud/Configuration/Internal/DalamudConfiguration.cs +++ b/Dalamud/Configuration/Internal/DalamudConfiguration.cs @@ -16,6 +16,11 @@ namespace Dalamud.Configuration.Internal [Serializable] internal sealed class DalamudConfiguration { + /// + /// Currently used beta key for Dalamud staging builds. + /// + public const string DalamudCurrentBetaKey = "Testing6015"; + private static readonly JsonSerializerSettings SerializerSettings = new() { TypeNameHandling = TypeNameHandling.All, @@ -78,9 +83,9 @@ namespace Dalamud.Configuration.Internal public bool DoPluginTest { get; set; } = false; /// - /// Gets or sets a value indicating whether or not Dalamud testing builds should be used. + /// Gets or sets a key to opt into Dalamud staging builds. /// - public bool DoDalamudTest { get; set; } = false; + public string? DalamudBetaKey { get; set; } = null; /// /// Gets or sets a value indicating whether or not XL should download the Dalamud .NET runtime. @@ -198,7 +203,7 @@ namespace Dalamud.Configuration.Internal public bool IsAntiAntiDebugEnabled { get; set; } = false; /// - /// Gets or sets the kind of beta to download when is set to true. + /// Gets or sets the kind of beta to download when matches the server value. /// public string DalamudBetaKind { get; set; } diff --git a/Dalamud/Interface/Internal/DalamudInterface.cs b/Dalamud/Interface/Internal/DalamudInterface.cs index 88adc16b6..7501fec43 100644 --- a/Dalamud/Interface/Internal/DalamudInterface.cs +++ b/Dalamud/Interface/Internal/DalamudInterface.cs @@ -384,8 +384,10 @@ namespace Dalamud.Interface.Internal if (config.DoDalamudTest) { #endif +#pragma warning disable SA1137 ImGui.SetCursorPos(cursor); ImGui.Image(this.logoTexture.ImGuiHandle, imageSize); +#pragma warning restore SA1137 #if !DEBUG } #endif @@ -519,9 +521,10 @@ namespace Dalamud.Interface.Internal ImGui.Separator(); - if (ImGui.MenuItem("Enable Dalamud testing", string.Empty, configuration.DoDalamudTest)) + var isBeta = configuration.DalamudBetaKey == DalamudConfiguration.DalamudCurrentBetaKey; + if (ImGui.MenuItem("Enable Dalamud testing", string.Empty, isBeta)) { - configuration.DoDalamudTest ^= true; + configuration.DalamudBetaKey = isBeta ? null : DalamudConfiguration.DalamudCurrentBetaKey; configuration.Save(); } diff --git a/Dalamud/Support/Troubleshooting.cs b/Dalamud/Support/Troubleshooting.cs index 8034bb979..c68d4e0ab 100644 --- a/Dalamud/Support/Troubleshooting.cs +++ b/Dalamud/Support/Troubleshooting.cs @@ -70,10 +70,10 @@ namespace Dalamud.Support DalamudGitHash = Util.GetGitHash(), GameVersion = startInfo.GameVersion.ToString(), Language = startInfo.Language.ToString(), - DoDalamudTest = configuration.DoDalamudTest, + BetaKey = configuration.DalamudBetaKey, DoPluginTest = configuration.DoPluginTest, InterfaceLoaded = interfaceManager?.IsReady ?? false, - ThirdRepo = configuration.ThirdRepoList, + HasThirdRepo = configuration.ThirdRepoList is { Count: > 0 }, ForcedMinHook = EnvironmentConfiguration.DalamudForceMinHook, }; @@ -107,7 +107,9 @@ namespace Dalamud.Support public string Language { get; set; } - public bool DoDalamudTest { get; set; } + public bool DoDalamudTest => false; + + public string? BetaKey { get; set; } public bool DoPluginTest { get; set; } @@ -115,7 +117,9 @@ namespace Dalamud.Support public bool ForcedMinHook { get; set; } - public List ThirdRepo { get; set; } + public List ThirdRepo => new(); + + public bool HasThirdRepo { get; set; } } } }