mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-15 05:04:15 +01:00
feat: updated changelog
This commit is contained in:
parent
feb1dc0f03
commit
fcf29acc02
8 changed files with 393 additions and 126 deletions
|
|
@ -251,10 +251,9 @@ internal class ChatHandlers : IServiceType
|
||||||
Type = XivChatType.Notice,
|
Type = XivChatType.Notice,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(this.configuration.LastChangelogMajorMinor) || (!ChangelogWindow.WarrantsChangelogForMajorMinor.StartsWith(this.configuration.LastChangelogMajorMinor) && assemblyVersion.StartsWith(ChangelogWindow.WarrantsChangelogForMajorMinor)))
|
if (ChangelogWindow.WarrantsChangelog())
|
||||||
{
|
{
|
||||||
dalamudInterface.OpenChangelogWindow();
|
dalamudInterface.OpenChangelogWindow();
|
||||||
this.configuration.LastChangelogMajorMinor = ChangelogWindow.WarrantsChangelogForMajorMinor;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.configuration.LastVersion = assemblyVersion;
|
this.configuration.LastVersion = assemblyVersion;
|
||||||
|
|
|
||||||
|
|
@ -109,6 +109,14 @@ public abstract class Easing
|
||||||
this.animationTimer.Restart();
|
this.animationTimer.Restart();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Resets the animation.
|
||||||
|
/// </summary>
|
||||||
|
public void Reset()
|
||||||
|
{
|
||||||
|
this.animationTimer.Reset();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Updates the animation.
|
/// Updates the animation.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -259,6 +259,15 @@ public static class ColorHelpers
|
||||||
hsv.A -= amount;
|
hsv.A -= amount;
|
||||||
return HsvToRgb(hsv);
|
return HsvToRgb(hsv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set alpha of a color.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="color">The color.</param>
|
||||||
|
/// <param name="alpha">The alpha value to set.</param>
|
||||||
|
/// <returns>The color with the set alpha value.</returns>
|
||||||
|
public static Vector4 WithAlpha(this Vector4 color, float alpha)
|
||||||
|
=> color with { W = alpha };
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Fade a color.
|
/// Fade a color.
|
||||||
|
|
|
||||||
|
|
@ -209,4 +209,25 @@ public static partial class ImGuiComponents
|
||||||
|
|
||||||
return button;
|
return button;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get width of IconButtonWithText component.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="icon">Icon to use.</param>
|
||||||
|
/// <param name="text">Text to use.</param>
|
||||||
|
/// <returns>Width.</returns>
|
||||||
|
internal static float GetIconButtonWithTextWidth(FontAwesomeIcon icon, string text)
|
||||||
|
{
|
||||||
|
ImGui.PushFont(UiBuilder.IconFont);
|
||||||
|
var iconSize = ImGui.CalcTextSize(icon.ToIconString());
|
||||||
|
ImGui.PopFont();
|
||||||
|
|
||||||
|
var textSize = ImGui.CalcTextSize(text);
|
||||||
|
var dl = ImGui.GetWindowDrawList();
|
||||||
|
var cursor = ImGui.GetCursorScreenPos();
|
||||||
|
|
||||||
|
var iconPadding = 3 * ImGuiHelpers.GlobalScale;
|
||||||
|
|
||||||
|
return iconSize.X + textSize.X + (ImGui.GetStyle().FramePadding.X * 2) + iconPadding;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -94,8 +94,7 @@ internal class DalamudInterface : IDisposable, IServiceType
|
||||||
{
|
{
|
||||||
var interfaceManager = interfaceManagerWithScene.Manager;
|
var interfaceManager = interfaceManagerWithScene.Manager;
|
||||||
this.WindowSystem = new WindowSystem("DalamudCore");
|
this.WindowSystem = new WindowSystem("DalamudCore");
|
||||||
|
|
||||||
this.changelogWindow = new ChangelogWindow() { IsOpen = false };
|
|
||||||
this.colorDemoWindow = new ColorDemoWindow() { IsOpen = false };
|
this.colorDemoWindow = new ColorDemoWindow() { IsOpen = false };
|
||||||
this.componentDemoWindow = new ComponentDemoWindow() { IsOpen = false };
|
this.componentDemoWindow = new ComponentDemoWindow() { IsOpen = false };
|
||||||
this.dataWindow = new DataWindow() { IsOpen = false };
|
this.dataWindow = new DataWindow() { IsOpen = false };
|
||||||
|
|
@ -108,6 +107,7 @@ internal class DalamudInterface : IDisposable, IServiceType
|
||||||
this.selfTestWindow = new SelfTestWindow() { IsOpen = false };
|
this.selfTestWindow = new SelfTestWindow() { IsOpen = false };
|
||||||
this.styleEditorWindow = new StyleEditorWindow() { IsOpen = false };
|
this.styleEditorWindow = new StyleEditorWindow() { IsOpen = false };
|
||||||
this.titleScreenMenuWindow = new TitleScreenMenuWindow() { IsOpen = false };
|
this.titleScreenMenuWindow = new TitleScreenMenuWindow() { IsOpen = false };
|
||||||
|
this.changelogWindow = new ChangelogWindow(this.titleScreenMenuWindow) { IsOpen = false };
|
||||||
this.profilerWindow = new ProfilerWindow() { IsOpen = false };
|
this.profilerWindow = new ProfilerWindow() { IsOpen = false };
|
||||||
this.branchSwitcherWindow = new BranchSwitcherWindow() { IsOpen = false };
|
this.branchSwitcherWindow = new BranchSwitcherWindow() { IsOpen = false };
|
||||||
this.hitchSettingsWindow = new HitchSettingsWindow() { IsOpen = false };
|
this.hitchSettingsWindow = new HitchSettingsWindow() { IsOpen = false };
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,18 @@
|
||||||
using System;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
|
|
||||||
|
using Dalamud.Configuration.Internal;
|
||||||
|
using Dalamud.Interface.Animation.EasingFunctions;
|
||||||
using Dalamud.Interface.Colors;
|
using Dalamud.Interface.Colors;
|
||||||
|
using Dalamud.Interface.Components;
|
||||||
|
using Dalamud.Interface.GameFonts;
|
||||||
using Dalamud.Interface.Utility;
|
using Dalamud.Interface.Utility;
|
||||||
|
using Dalamud.Interface.Utility.Raii;
|
||||||
using Dalamud.Interface.Windowing;
|
using Dalamud.Interface.Windowing;
|
||||||
|
using Dalamud.Plugin.Internal;
|
||||||
using Dalamud.Utility;
|
using Dalamud.Utility;
|
||||||
using ImGuiNET;
|
using ImGuiNET;
|
||||||
using ImGuiScene;
|
|
||||||
|
|
||||||
namespace Dalamud.Interface.Internal.Windows;
|
namespace Dalamud.Interface.Internal.Windows;
|
||||||
|
|
||||||
|
|
@ -16,141 +21,349 @@ namespace Dalamud.Interface.Internal.Windows;
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal sealed class ChangelogWindow : Window, IDisposable
|
internal sealed class ChangelogWindow : Window, IDisposable
|
||||||
{
|
{
|
||||||
/// <summary>
|
private const string WarrantsChangelogForMajorMinor = "9.0.";
|
||||||
/// Whether the latest update warrants a changelog window.
|
|
||||||
/// </summary>
|
|
||||||
public const string WarrantsChangelogForMajorMinor = "7.4.";
|
|
||||||
|
|
||||||
private const string ChangeLog =
|
private const string ChangeLog =
|
||||||
@"• Updated Dalamud for compatibility with Patch 6.3
|
@"• Updated Dalamud for compatibility with Patch 6.5
|
||||||
• Made things more speedy by updating to .NET 7
|
• A lot of behind-the-scenes changes to make Dalamud and plugins more stable and reliable
|
||||||
|
• Added plugin collections, allowing you to create lists of plugins that can be enabled or disabled together
|
||||||
If you note any issues or need help, please check the FAQ, and reach out on our Discord if you need help.
|
• Plugins can now add tooltips and interaction to the server info bar
|
||||||
Thanks and have fun!";
|
• The Dalamud/plugin installer UI has been refreshed
|
||||||
|
";
|
||||||
private const string UpdatePluginsInfo =
|
|
||||||
@"• All of your plugins were disabled automatically, due to this update. This is normal.
|
private readonly TitleScreenMenuWindow tsmWindow;
|
||||||
• Open the plugin installer, then click 'update plugins'. Updated plugins should update and then re-enable themselves.
|
|
||||||
=> Please keep in mind that not all of your plugins may already be updated for the new version.
|
|
||||||
=> If some plugins are displayed with a red cross in the 'Installed Plugins' tab, they may not yet be available.";
|
|
||||||
|
|
||||||
private readonly string assemblyVersion = Util.AssemblyVersion;
|
|
||||||
|
|
||||||
private readonly IDalamudTextureWrap logoTexture;
|
private readonly IDalamudTextureWrap logoTexture;
|
||||||
|
|
||||||
|
private readonly InOutCubic windowFade = new(TimeSpan.FromSeconds(2.5f))
|
||||||
|
{
|
||||||
|
Point1 = Vector2.Zero,
|
||||||
|
Point2 = new Vector2(2f),
|
||||||
|
};
|
||||||
|
|
||||||
|
private readonly InOutCubic bodyFade = new(TimeSpan.FromSeconds(1f))
|
||||||
|
{
|
||||||
|
Point1 = Vector2.Zero,
|
||||||
|
Point2 = Vector2.One,
|
||||||
|
};
|
||||||
|
|
||||||
|
private IDalamudTextureWrap? apiBumpExplainerTexture;
|
||||||
|
private GameFontHandle? bannerFont;
|
||||||
|
|
||||||
|
private State state = State.WindowFadeIn;
|
||||||
|
|
||||||
|
private bool needFadeRestart = false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="ChangelogWindow"/> class.
|
/// Initializes a new instance of the <see cref="ChangelogWindow"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ChangelogWindow()
|
/// <param name="tsmWindow">TSM window.</param>
|
||||||
: base("What's new in Dalamud?", ImGuiWindowFlags.AlwaysAutoResize | ImGuiWindowFlags.NoResize)
|
public ChangelogWindow(TitleScreenMenuWindow tsmWindow)
|
||||||
|
: base("What's new in Dalamud?##ChangelogWindow", ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoTitleBar | ImGuiWindowFlags.NoScrollbar | ImGuiWindowFlags.NoScrollWithMouse, true)
|
||||||
{
|
{
|
||||||
|
this.tsmWindow = tsmWindow;
|
||||||
this.Namespace = "DalamudChangelogWindow";
|
this.Namespace = "DalamudChangelogWindow";
|
||||||
|
|
||||||
this.Size = new Vector2(885, 463);
|
|
||||||
this.SizeCondition = ImGuiCond.Appearing;
|
|
||||||
|
|
||||||
this.logoTexture = Service<Branding>.Get().Logo;
|
this.logoTexture = Service<Branding>.Get().Logo;
|
||||||
|
|
||||||
|
// If we are going to show a changelog, make sure we have the font ready, otherwise it will hitch
|
||||||
|
if (WarrantsChangelog())
|
||||||
|
this.MakeFont();
|
||||||
|
}
|
||||||
|
|
||||||
|
private enum State
|
||||||
|
{
|
||||||
|
WindowFadeIn,
|
||||||
|
ExplainerIntro,
|
||||||
|
ExplainerApiBump,
|
||||||
|
Links,
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Check if a changelog should be shown.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>True if a changelog should be shown.</returns>
|
||||||
|
public static bool WarrantsChangelog()
|
||||||
|
{
|
||||||
|
var configuration = Service<DalamudConfiguration>.Get();
|
||||||
|
var pm = Service<PluginManager>.GetNullable();
|
||||||
|
var pmWantsChangelog = pm?.InstalledPlugins.Any() ?? true;
|
||||||
|
return (string.IsNullOrEmpty(configuration.LastChangelogMajorMinor) ||
|
||||||
|
(!WarrantsChangelogForMajorMinor.StartsWith(configuration.LastChangelogMajorMinor) &&
|
||||||
|
Util.AssemblyVersion.StartsWith(WarrantsChangelogForMajorMinor))) && pmWantsChangelog;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public override void OnOpen()
|
||||||
|
{
|
||||||
|
Service<DalamudInterface>.Get().SetCreditsDarkeningAnimation(true);
|
||||||
|
this.tsmWindow.AllowDrawing = false;
|
||||||
|
|
||||||
|
this.MakeFont();
|
||||||
|
|
||||||
|
this.state = State.WindowFadeIn;
|
||||||
|
this.windowFade.Reset();
|
||||||
|
this.bodyFade.Reset();
|
||||||
|
this.needFadeRestart = true;
|
||||||
|
|
||||||
|
if (this.apiBumpExplainerTexture == null)
|
||||||
|
{
|
||||||
|
var dalamud = Service<Dalamud>.Get();
|
||||||
|
var tm = Service<TextureManager>.Get();
|
||||||
|
this.apiBumpExplainerTexture = tm.GetTextureFromFile(new FileInfo(Path.Combine(dalamud.AssetDirectory.FullName, "UIRes", "changelogApiBump.png")))
|
||||||
|
?? throw new Exception("Could not load api bump explainer.");
|
||||||
|
}
|
||||||
|
|
||||||
|
base.OnOpen();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public override void OnClose()
|
||||||
|
{
|
||||||
|
base.OnClose();
|
||||||
|
|
||||||
|
this.tsmWindow.AllowDrawing = true;
|
||||||
|
Service<DalamudInterface>.Get().SetCreditsDarkeningAnimation(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public override void PreDraw()
|
||||||
|
{
|
||||||
|
ImGui.PushStyleVar(ImGuiStyleVar.WindowBorderSize, 0);
|
||||||
|
ImGui.PushStyleVar(ImGuiStyleVar.WindowPadding, Vector2.Zero);
|
||||||
|
ImGui.PushStyleVar(ImGuiStyleVar.WindowRounding, 10f);
|
||||||
|
|
||||||
|
base.PreDraw();
|
||||||
|
|
||||||
|
if (this.needFadeRestart)
|
||||||
|
{
|
||||||
|
this.windowFade.Restart();
|
||||||
|
this.needFadeRestart = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.windowFade.Update();
|
||||||
|
ImGui.SetNextWindowBgAlpha(Math.Clamp(this.windowFade.EasedPoint.X, 0, 0.9f));
|
||||||
|
|
||||||
|
this.Size = new Vector2(900, 400);
|
||||||
|
this.SizeCondition = ImGuiCond.Always;
|
||||||
|
|
||||||
|
// Center the window on the main viewport
|
||||||
|
var viewportSize = ImGuiHelpers.MainViewport.Size;
|
||||||
|
var windowSize = this.Size!.Value * ImGuiHelpers.GlobalScale;
|
||||||
|
ImGui.SetNextWindowPos(new Vector2(viewportSize.X / 2 - windowSize.X / 2, viewportSize.Y / 2 - windowSize.Y / 2));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public override void PostDraw()
|
||||||
|
{
|
||||||
|
ImGui.PopStyleVar(3);
|
||||||
|
base.PostDraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public override void Draw()
|
public override void Draw()
|
||||||
{
|
{
|
||||||
ImGui.Text($"Dalamud has been updated to version D{this.assemblyVersion}.");
|
void Dismiss()
|
||||||
|
{
|
||||||
ImGuiHelpers.ScaledDummy(10);
|
var configuration = Service<DalamudConfiguration>.Get();
|
||||||
|
configuration.LastChangelogMajorMinor = WarrantsChangelogForMajorMinor;
|
||||||
ImGui.Text("The following changes were introduced:");
|
configuration.QueueSave();
|
||||||
|
}
|
||||||
|
|
||||||
|
var windowSize = ImGui.GetWindowSize();
|
||||||
|
|
||||||
|
var dummySize = 10 * ImGuiHelpers.GlobalScale;
|
||||||
|
ImGui.Dummy(new Vector2(dummySize));
|
||||||
ImGui.SameLine();
|
ImGui.SameLine();
|
||||||
ImGuiHelpers.ScaledDummy(0);
|
|
||||||
var imgCursor = ImGui.GetCursorPos();
|
var logoContainerSize = new Vector2(this.Size!.Value.X * 0.2f - dummySize, this.Size!.Value.Y);
|
||||||
|
using (var child = ImRaii.Child("###logoContainer", logoContainerSize, false))
|
||||||
ImGui.TextWrapped(ChangeLog);
|
|
||||||
|
|
||||||
ImGuiHelpers.ScaledDummy(5);
|
|
||||||
|
|
||||||
ImGui.TextColored(ImGuiColors.DalamudRed, " !!! ATTENTION !!!");
|
|
||||||
|
|
||||||
ImGui.TextWrapped(UpdatePluginsInfo);
|
|
||||||
|
|
||||||
ImGuiHelpers.ScaledDummy(10);
|
|
||||||
|
|
||||||
// ImGui.Text("Thank you for using our tools!");
|
|
||||||
|
|
||||||
// ImGuiHelpers.ScaledDummy(10);
|
|
||||||
|
|
||||||
ImGui.PushFont(UiBuilder.IconFont);
|
|
||||||
|
|
||||||
if (ImGui.Button(FontAwesomeIcon.Download.ToIconString()))
|
|
||||||
{
|
{
|
||||||
Service<DalamudInterface>.Get().OpenPluginInstaller();
|
if (!child)
|
||||||
}
|
return;
|
||||||
|
|
||||||
if (ImGui.IsItemHovered())
|
var logoSize = new Vector2(logoContainerSize.X);
|
||||||
{
|
|
||||||
ImGui.PopFont();
|
// Center the logo in the container
|
||||||
ImGui.SetTooltip("Open Plugin Installer");
|
ImGui.SetCursorPos(new Vector2(logoContainerSize.X / 2 - logoSize.X / 2, logoContainerSize.Y / 2 - logoSize.Y / 2));
|
||||||
ImGui.PushFont(UiBuilder.IconFont);
|
|
||||||
|
using (ImRaii.PushStyle(ImGuiStyleVar.Alpha, Math.Clamp(this.windowFade.EasedPoint.X - 0.5f, 0f, 1f)))
|
||||||
|
{
|
||||||
|
ImGui.Image(this.logoTexture.ImGuiHandle, logoSize);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
ImGui.SameLine();
|
||||||
|
ImGui.Dummy(new Vector2(dummySize));
|
||||||
if (ImGui.Button(FontAwesomeIcon.LaughBeam.ToIconString()))
|
|
||||||
{
|
|
||||||
Util.OpenLink("https://discord.gg/3NMcUV5");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ImGui.IsItemHovered())
|
|
||||||
{
|
|
||||||
ImGui.PopFont();
|
|
||||||
ImGui.SetTooltip("Join our Discord server");
|
|
||||||
ImGui.PushFont(UiBuilder.IconFont);
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGui.SameLine();
|
ImGui.SameLine();
|
||||||
|
|
||||||
if (ImGui.Button(FontAwesomeIcon.Globe.ToIconString()))
|
using (var child = ImRaii.Child("###textContainer", new Vector2((this.Size!.Value.X * 0.8f) - dummySize * 4, this.Size!.Value.Y), false))
|
||||||
{
|
{
|
||||||
Util.OpenLink("https://goatcorp.github.io/faq/");
|
if (!child)
|
||||||
|
return;
|
||||||
|
|
||||||
|
ImGuiHelpers.ScaledDummy(20);
|
||||||
|
|
||||||
|
using (ImRaii.PushStyle(ImGuiStyleVar.Alpha, Math.Clamp(this.windowFade.EasedPoint.X - 1f, 0f, 1f)))
|
||||||
|
{
|
||||||
|
using var font = ImRaii.PushFont(this.bannerFont!.ImFont);
|
||||||
|
|
||||||
|
switch (this.state)
|
||||||
|
{
|
||||||
|
case State.WindowFadeIn:
|
||||||
|
case State.ExplainerIntro:
|
||||||
|
ImGuiHelpers.CenteredText("New And Improved");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case State.ExplainerApiBump:
|
||||||
|
ImGuiHelpers.CenteredText("Plugin Updates");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case State.Links:
|
||||||
|
ImGuiHelpers.CenteredText("Enjoy!");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGuiHelpers.ScaledDummy(8);
|
||||||
|
|
||||||
|
if (this.state == State.WindowFadeIn && this.windowFade.EasedPoint.X > 1.5f)
|
||||||
|
{
|
||||||
|
this.state = State.ExplainerIntro;
|
||||||
|
this.bodyFade.Restart();
|
||||||
|
}
|
||||||
|
|
||||||
|
this.bodyFade.Update();
|
||||||
|
using (ImRaii.PushStyle(ImGuiStyleVar.Alpha, Math.Clamp(this.bodyFade.EasedPoint.X, 0, 1f)))
|
||||||
|
{
|
||||||
|
void DrawNextButton(State nextState)
|
||||||
|
{
|
||||||
|
// Draw big, centered next button at the bottom of the window
|
||||||
|
var buttonHeight = 30 * ImGuiHelpers.GlobalScale;
|
||||||
|
var buttonText = "Next";
|
||||||
|
var buttonWidth = ImGui.CalcTextSize(buttonText).X + 40 * ImGuiHelpers.GlobalScale;
|
||||||
|
ImGui.SetCursorPosY(windowSize.Y - buttonHeight - (20 * ImGuiHelpers.GlobalScale));
|
||||||
|
ImGuiHelpers.CenterCursorFor((int)buttonWidth);
|
||||||
|
|
||||||
|
if (ImGui.Button(buttonText, new Vector2(buttonWidth, buttonHeight)))
|
||||||
|
{
|
||||||
|
this.state = nextState;
|
||||||
|
this.bodyFade.Restart();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (this.state)
|
||||||
|
{
|
||||||
|
case State.WindowFadeIn:
|
||||||
|
case State.ExplainerIntro:
|
||||||
|
ImGui.TextWrapped($"Welcome to Dalamud v{Util.AssemblyVersion}!");
|
||||||
|
ImGuiHelpers.ScaledDummy(5);
|
||||||
|
ImGui.TextWrapped(ChangeLog);
|
||||||
|
|
||||||
|
DrawNextButton(State.ExplainerApiBump);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case State.ExplainerApiBump:
|
||||||
|
ImGui.TextWrapped("Take care! Due to changes in this patch, all of your plugins need to be updated and were disabled automatically.");
|
||||||
|
ImGui.TextWrapped("This is normal and required for major game updates.");
|
||||||
|
ImGuiHelpers.ScaledDummy(5);
|
||||||
|
ImGui.TextWrapped("To update your plugins, open the plugin installer and click 'update plugins'. Updated plugins should update and then re-enable themselves.");
|
||||||
|
ImGuiHelpers.ScaledDummy(5);
|
||||||
|
ImGui.TextWrapped("Please keep in mind that not all of your plugins may already be updated for the new version.");
|
||||||
|
ImGui.TextWrapped("If some plugins are displayed with a red cross in the 'Installed Plugins' tab, they may not yet be available.");
|
||||||
|
|
||||||
|
ImGuiHelpers.ScaledDummy(15);
|
||||||
|
|
||||||
|
ImGuiHelpers.CenterCursorFor(this.apiBumpExplainerTexture!.Width);
|
||||||
|
ImGui.Image(this.apiBumpExplainerTexture.ImGuiHandle, this.apiBumpExplainerTexture.Size);
|
||||||
|
|
||||||
|
DrawNextButton(State.Links);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case State.Links:
|
||||||
|
ImGui.TextWrapped("If you note any issues or need help, please check the FAQ, and reach out on our Discord if you need help.");
|
||||||
|
ImGui.TextWrapped("Enjoy your time with the game and Dalamud!");
|
||||||
|
|
||||||
|
ImGuiHelpers.ScaledDummy(45);
|
||||||
|
|
||||||
|
bool CenteredIconButton(FontAwesomeIcon icon, string text)
|
||||||
|
{
|
||||||
|
var buttonWidth = ImGuiComponents.GetIconButtonWithTextWidth(icon, text);
|
||||||
|
ImGuiHelpers.CenterCursorFor((int)buttonWidth);
|
||||||
|
return ImGuiComponents.IconButtonWithText(icon, text);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CenteredIconButton(FontAwesomeIcon.Download, "Open Plugin Installer"))
|
||||||
|
{
|
||||||
|
Service<DalamudInterface>.Get().OpenPluginInstaller();
|
||||||
|
this.IsOpen = false;
|
||||||
|
Dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGuiHelpers.ScaledDummy(5);
|
||||||
|
|
||||||
|
ImGuiHelpers.CenterCursorFor(
|
||||||
|
(int)(ImGuiComponents.GetIconButtonWithTextWidth(FontAwesomeIcon.Globe, "See the FAQ") +
|
||||||
|
ImGuiComponents.GetIconButtonWithTextWidth(FontAwesomeIcon.LaughBeam, "Join our Discord server") +
|
||||||
|
(5 * ImGuiHelpers.GlobalScale) +
|
||||||
|
(ImGui.GetStyle().ItemSpacing.X * 4)));
|
||||||
|
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Globe, "See the FAQ"))
|
||||||
|
{
|
||||||
|
Util.OpenLink("https://goatcorp.github.io/faq/");
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui.SameLine();
|
||||||
|
ImGuiHelpers.ScaledDummy(5);
|
||||||
|
ImGui.SameLine();
|
||||||
|
|
||||||
|
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.LaughBeam, "Join our Discord server"))
|
||||||
|
{
|
||||||
|
Util.OpenLink("https://discord.gg/3NMcUV5");
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGuiHelpers.ScaledDummy(5);
|
||||||
|
|
||||||
|
if (CenteredIconButton(FontAwesomeIcon.Heart, "Support what we care about"))
|
||||||
|
{
|
||||||
|
Util.OpenLink("https://goatcorp.github.io/faq/support");
|
||||||
|
}
|
||||||
|
|
||||||
|
var buttonHeight = 30 * ImGuiHelpers.GlobalScale;
|
||||||
|
var buttonText = "Close";
|
||||||
|
var buttonWidth = ImGui.CalcTextSize(buttonText).X + 40 * ImGuiHelpers.GlobalScale;
|
||||||
|
ImGui.SetCursorPosY(windowSize.Y - buttonHeight - (20 * ImGuiHelpers.GlobalScale));
|
||||||
|
ImGuiHelpers.CenterCursorFor((int)buttonWidth);
|
||||||
|
|
||||||
|
if (ImGui.Button(buttonText, new Vector2(buttonWidth, buttonHeight)))
|
||||||
|
{
|
||||||
|
this.IsOpen = false;
|
||||||
|
Dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Draw close button in the top right corner
|
||||||
|
ImGui.PushStyleVar(ImGuiStyleVar.FrameRounding, 100f);
|
||||||
|
var btnAlpha = Math.Clamp(this.windowFade.EasedPoint.X - 0.5f, 0f, 1f);
|
||||||
|
ImGui.PushStyleColor(ImGuiCol.Button, ImGuiColors.DalamudRed.WithAlpha(btnAlpha).Desaturate(0.3f));
|
||||||
|
ImGui.PushStyleColor(ImGuiCol.Text, ImGuiColors.DalamudWhite.WithAlpha(btnAlpha));
|
||||||
|
|
||||||
|
var childSize = ImGui.GetWindowSize();
|
||||||
|
var closeButtonSize = 15 * ImGuiHelpers.GlobalScale;
|
||||||
|
ImGui.SetCursorPos(new Vector2(childSize.X - closeButtonSize - (5 * ImGuiHelpers.GlobalScale), 10 * ImGuiHelpers.GlobalScale));
|
||||||
|
if (ImGuiComponents.IconButton(FontAwesomeIcon.Times))
|
||||||
|
{
|
||||||
|
Dismiss();
|
||||||
|
this.IsOpen = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui.PopStyleColor(2);
|
||||||
|
ImGui.PopStyleVar();
|
||||||
|
|
||||||
|
if (ImGui.IsItemHovered())
|
||||||
|
ImGui.SetTooltip("I don't care about this");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui.IsItemHovered())
|
|
||||||
{
|
|
||||||
ImGui.PopFont();
|
|
||||||
ImGui.SetTooltip("See the FAQ");
|
|
||||||
ImGui.PushFont(UiBuilder.IconFont);
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGui.SameLine();
|
|
||||||
|
|
||||||
if (ImGui.Button(FontAwesomeIcon.Heart.ToIconString()))
|
|
||||||
{
|
|
||||||
Util.OpenLink("https://goatcorp.github.io/faq/support");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ImGui.IsItemHovered())
|
|
||||||
{
|
|
||||||
ImGui.PopFont();
|
|
||||||
ImGui.SetTooltip("Support what we care about");
|
|
||||||
ImGui.PushFont(UiBuilder.IconFont);
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGui.PopFont();
|
|
||||||
|
|
||||||
ImGui.SameLine();
|
|
||||||
ImGuiHelpers.ScaledDummy(20, 0);
|
|
||||||
ImGui.SameLine();
|
|
||||||
|
|
||||||
if (ImGui.Button("Close"))
|
|
||||||
{
|
|
||||||
this.IsOpen = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
imgCursor.X += 750;
|
|
||||||
imgCursor.Y -= 30;
|
|
||||||
ImGui.SetCursorPos(imgCursor);
|
|
||||||
|
|
||||||
ImGui.Image(this.logoTexture.ImGuiHandle, new Vector2(100));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -160,4 +373,13 @@ Thanks and have fun!";
|
||||||
{
|
{
|
||||||
this.logoTexture.Dispose();
|
this.logoTexture.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void MakeFont()
|
||||||
|
{
|
||||||
|
if (this.bannerFont == null)
|
||||||
|
{
|
||||||
|
var gfm = Service<GameFontManager>.Get();
|
||||||
|
this.bannerFont = gfm.NewFontRef(new GameFontStyle(GameFontFamilyAndSize.MiedingerMid18));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -63,13 +63,18 @@ internal class TitleScreenMenuWindow : Window, IDisposable
|
||||||
var framework = Service<Framework>.Get();
|
var framework = Service<Framework>.Get();
|
||||||
framework.Update += this.FrameworkOnUpdate;
|
framework.Update += this.FrameworkOnUpdate;
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum State
|
private enum State
|
||||||
{
|
{
|
||||||
Hide,
|
Hide,
|
||||||
Show,
|
Show,
|
||||||
FadeOut,
|
FadeOut,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets a value indicating whether drawing is allowed.
|
||||||
|
/// </summary>
|
||||||
|
public bool AllowDrawing { get; set; } = true;
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public override void PreDraw()
|
public override void PreDraw()
|
||||||
|
|
@ -97,6 +102,9 @@ internal class TitleScreenMenuWindow : Window, IDisposable
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public override void Draw()
|
public override void Draw()
|
||||||
{
|
{
|
||||||
|
if (!this.AllowDrawing)
|
||||||
|
return;
|
||||||
|
|
||||||
var scale = ImGui.GetIO().FontGlobalScale;
|
var scale = ImGui.GetIO().FontGlobalScale;
|
||||||
var entries = Service<TitleScreenMenu>.Get().Entries
|
var entries = Service<TitleScreenMenu>.Get().Entries
|
||||||
.OrderByDescending(x => x.IsInternal)
|
.OrderByDescending(x => x.IsInternal)
|
||||||
|
|
|
||||||
|
|
@ -257,13 +257,7 @@ public abstract class Window
|
||||||
|
|
||||||
if (hasNamespace)
|
if (hasNamespace)
|
||||||
ImGui.PushID(this.Namespace);
|
ImGui.PushID(this.Namespace);
|
||||||
|
|
||||||
this.PreDraw();
|
|
||||||
this.ApplyConditionals();
|
|
||||||
|
|
||||||
if (this.ForceMainWindow)
|
|
||||||
ImGuiHelpers.ForceNextWindowMainViewport();
|
|
||||||
|
|
||||||
if (this.internalLastIsOpen != this.internalIsOpen && this.internalIsOpen)
|
if (this.internalLastIsOpen != this.internalIsOpen && this.internalIsOpen)
|
||||||
{
|
{
|
||||||
this.internalLastIsOpen = this.internalIsOpen;
|
this.internalLastIsOpen = this.internalIsOpen;
|
||||||
|
|
@ -272,6 +266,12 @@ public abstract class Window
|
||||||
if (doSoundEffects && !this.DisableWindowSounds) UIModule.PlaySound(this.OnOpenSfxId, 0, 0, 0);
|
if (doSoundEffects && !this.DisableWindowSounds) UIModule.PlaySound(this.OnOpenSfxId, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.PreDraw();
|
||||||
|
this.ApplyConditionals();
|
||||||
|
|
||||||
|
if (this.ForceMainWindow)
|
||||||
|
ImGuiHelpers.ForceNextWindowMainViewport();
|
||||||
|
|
||||||
var wasFocused = this.IsFocused;
|
var wasFocused = this.IsFocused;
|
||||||
if (wasFocused)
|
if (wasFocused)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue