feat: add staging/beta key

This commit is contained in:
goaaats 2022-01-02 21:16:44 +01:00
parent 0200468149
commit 25e01599ec
No known key found for this signature in database
GPG key ID: F18F057873895461
3 changed files with 21 additions and 9 deletions

View file

@ -16,6 +16,11 @@ namespace Dalamud.Configuration.Internal
[Serializable]
internal sealed class DalamudConfiguration
{
/// <summary>
/// Currently used beta key for Dalamud staging builds.
/// </summary>
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;
/// <summary>
/// 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.
/// </summary>
public bool DoDalamudTest { get; set; } = false;
public string? DalamudBetaKey { get; set; } = null;
/// <summary>
/// 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;
/// <summary>
/// Gets or sets the kind of beta to download when <see cref="DoDalamudTest"/> is set to true.
/// Gets or sets the kind of beta to download when <see cref="DalamudBetaKey"/> matches the server value.
/// </summary>
public string DalamudBetaKind { get; set; }

View file

@ -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();
}

View file

@ -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<ThirdPartyRepoSettings> ThirdRepo { get; set; }
public List<ThirdPartyRepoSettings> ThirdRepo => new();
public bool HasThirdRepo { get; set; }
}
}
}