mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-24 01:19:18 +01:00
pi: show a warning if a non-release dalamud version is outdated
This commit is contained in:
parent
baa875f516
commit
10f9f0b37b
2 changed files with 110 additions and 5 deletions
|
|
@ -135,6 +135,8 @@ internal class PluginInstallerWindow : Window, IDisposable
|
|||
private LoadingIndicatorKind loadingIndicatorKind = LoadingIndicatorKind.Unknown;
|
||||
|
||||
private string verifiedCheckmarkHoveredPlugin = string.Empty;
|
||||
|
||||
private string? staleDalamudNewVersion = null;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PluginInstallerWindow"/> class.
|
||||
|
|
@ -292,6 +294,20 @@ internal class PluginInstallerWindow : Window, IDisposable
|
|||
}
|
||||
|
||||
this.profileManagerWidget.Reset();
|
||||
|
||||
// TODO: Actually check if we are on a tag-0 version here. We might be opted into a beta but have a wrong key.
|
||||
if (this.staleDalamudNewVersion == null && !Service<DalamudConfiguration>.Get().DalamudBetaKind.IsNullOrEmpty())
|
||||
{
|
||||
Service<DalamudReleases>.Get().GetVersionForCurrentTrack().ContinueWith(t =>
|
||||
{
|
||||
if (!t.IsCompletedSuccessfully)
|
||||
return;
|
||||
|
||||
var versionInfo = t.Result;
|
||||
if (versionInfo.AssemblyVersion != Util.GetGitHash())
|
||||
this.staleDalamudNewVersion = versionInfo.AssemblyVersion;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
|
@ -1488,8 +1504,7 @@ internal class PluginInstallerWindow : Window, IDisposable
|
|||
return;
|
||||
}
|
||||
|
||||
var pm = Service<PluginManager>.Get();
|
||||
if (pm.SafeMode)
|
||||
void DrawWarningIcon()
|
||||
{
|
||||
ImGuiHelpers.ScaledDummy(10);
|
||||
|
||||
|
|
@ -1498,15 +1513,34 @@ internal class PluginInstallerWindow : Window, IDisposable
|
|||
ImGuiHelpers.CenteredText(FontAwesomeIcon.ExclamationTriangle.ToIconString());
|
||||
ImGui.PopFont();
|
||||
ImGui.PopStyleColor();
|
||||
|
||||
var lines = Locs.SafeModeDisclaimer.Split('\n');
|
||||
}
|
||||
|
||||
void DrawLinesCentered(string text)
|
||||
{
|
||||
var lines = text.Split('\n');
|
||||
foreach (var line in lines)
|
||||
{
|
||||
ImGuiHelpers.CenteredText(line);
|
||||
}
|
||||
}
|
||||
|
||||
var pm = Service<PluginManager>.Get();
|
||||
if (pm.SafeMode)
|
||||
{
|
||||
DrawWarningIcon();
|
||||
DrawLinesCentered(Locs.SafeModeDisclaimer);
|
||||
|
||||
ImGuiHelpers.ScaledDummy(10);
|
||||
}
|
||||
|
||||
if (this.staleDalamudNewVersion != null)
|
||||
{
|
||||
DrawWarningIcon();
|
||||
DrawLinesCentered("A new version of Dalamud is available.\n" +
|
||||
"Please restart the game to ensure compatibility with updated plugins.\n" +
|
||||
$"old: {Util.GetGitHash()} new: {this.staleDalamudNewVersion}");
|
||||
|
||||
ImGuiHelpers.ScaledDummy(10);
|
||||
ImGui.Separator();
|
||||
}
|
||||
|
||||
ImGui.PushStyleVar(ImGuiStyleVar.ItemSpacing, ImGuiHelpers.ScaledVector2(1, 3));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue