mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-16 05:34:16 +01:00
feat: add changelog window
This commit is contained in:
parent
196217f1d5
commit
6a539ee46c
3 changed files with 127 additions and 3 deletions
|
|
@ -237,6 +237,7 @@ namespace Dalamud {
|
||||||
private bool isImguiDrawCreditsWindow = false;
|
private bool isImguiDrawCreditsWindow = false;
|
||||||
private bool isImguiDrawSettingsWindow = false;
|
private bool isImguiDrawSettingsWindow = false;
|
||||||
private bool isImguiDrawPluginStatWindow = false;
|
private bool isImguiDrawPluginStatWindow = false;
|
||||||
|
private bool isImguiDrawChangelogWindow = false;
|
||||||
|
|
||||||
private DalamudLogWindow logWindow;
|
private DalamudLogWindow logWindow;
|
||||||
private DalamudDataWindow dataWindow;
|
private DalamudDataWindow dataWindow;
|
||||||
|
|
@ -244,6 +245,7 @@ namespace Dalamud {
|
||||||
private DalamudSettingsWindow settingsWindow;
|
private DalamudSettingsWindow settingsWindow;
|
||||||
private PluginInstallerWindow pluginWindow;
|
private PluginInstallerWindow pluginWindow;
|
||||||
private DalamudPluginStatWindow pluginStatWindow;
|
private DalamudPluginStatWindow pluginStatWindow;
|
||||||
|
private DalamudChangelogWindow changelogWindow;
|
||||||
|
|
||||||
private void BuildDalamudUi()
|
private void BuildDalamudUi()
|
||||||
{
|
{
|
||||||
|
|
@ -284,6 +286,10 @@ namespace Dalamud {
|
||||||
{
|
{
|
||||||
OnOpenSettingsCommand(null, null);
|
OnOpenSettingsCommand(null, null);
|
||||||
}
|
}
|
||||||
|
if (ImGui.MenuItem("Open Changelog window"))
|
||||||
|
{
|
||||||
|
OpenChangelog();
|
||||||
|
}
|
||||||
ImGui.MenuItem("Draw ImGui demo", "", ref this.isImguiDrawDemoWindow);
|
ImGui.MenuItem("Draw ImGui demo", "", ref this.isImguiDrawDemoWindow);
|
||||||
if (ImGui.MenuItem("Dump ImGui info"))
|
if (ImGui.MenuItem("Dump ImGui info"))
|
||||||
OnDebugImInfoCommand(null, null);
|
OnDebugImInfoCommand(null, null);
|
||||||
|
|
@ -431,6 +437,20 @@ namespace Dalamud {
|
||||||
this.pluginStatWindow = null;
|
this.pluginStatWindow = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.isImguiDrawChangelogWindow)
|
||||||
|
{
|
||||||
|
this.isImguiDrawChangelogWindow = this.changelogWindow != null && this.changelogWindow.Draw();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
internal void OpenPluginInstaller() {
|
||||||
|
this.pluginWindow = new PluginInstallerWindow(this, this.StartInfo.GameVersion);
|
||||||
|
this.isImguiDrawPluginWindow = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
internal void OpenChangelog() {
|
||||||
|
this.changelogWindow = new DalamudChangelogWindow(this);
|
||||||
|
this.isImguiDrawChangelogWindow = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ReplaceExceptionHandler() {
|
private void ReplaceExceptionHandler() {
|
||||||
|
|
@ -442,7 +462,7 @@ namespace Dalamud {
|
||||||
Log.Debug("Reset ExceptionFilter, old: {0}", oldFilter);
|
Log.Debug("Reset ExceptionFilter, old: {0}", oldFilter);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private void SetupCommands() {
|
private void SetupCommands() {
|
||||||
CommandManager.AddHandler("/xldclose", new CommandInfo(OnUnloadCommand) {
|
CommandManager.AddHandler("/xldclose", new CommandInfo(OnUnloadCommand) {
|
||||||
|
|
@ -716,8 +736,7 @@ namespace Dalamud {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnOpenInstallerCommand(string command, string arguments) {
|
private void OnOpenInstallerCommand(string command, string arguments) {
|
||||||
this.pluginWindow = new PluginInstallerWindow(this, this.StartInfo.GameVersion);
|
OpenPluginInstaller();
|
||||||
this.isImguiDrawPluginWindow = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnOpenCreditsCommand(string command, string arguments)
|
private void OnOpenCreditsCommand(string command, string arguments)
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ using Dalamud.Game.Chat;
|
||||||
using Dalamud.Game.Chat.SeStringHandling;
|
using Dalamud.Game.Chat.SeStringHandling;
|
||||||
using Dalamud.Game.Chat.SeStringHandling.Payloads;
|
using Dalamud.Game.Chat.SeStringHandling.Payloads;
|
||||||
using Dalamud.Game.Internal.Libc;
|
using Dalamud.Game.Internal.Libc;
|
||||||
|
using Dalamud.Interface;
|
||||||
using Dalamud.Plugin;
|
using Dalamud.Plugin;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
|
|
||||||
|
|
@ -225,6 +226,8 @@ namespace Dalamud.Game {
|
||||||
Type = XivChatType.Notice
|
Type = XivChatType.Notice
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.dalamud.OpenChangelog();
|
||||||
|
|
||||||
this.dalamud.Configuration.LastVersion = assemblyVersion;
|
this.dalamud.Configuration.LastVersion = assemblyVersion;
|
||||||
this.dalamud.Configuration.Save();
|
this.dalamud.Configuration.Save();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
102
Dalamud/Interface/DalamudChangelogWindow.cs
Normal file
102
Dalamud/Interface/DalamudChangelogWindow.cs
Normal file
|
|
@ -0,0 +1,102 @@
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Numerics;
|
||||||
|
using Dalamud.Plugin;
|
||||||
|
using ImGuiNET;
|
||||||
|
using Lumina.Data.Parsing.Layer;
|
||||||
|
|
||||||
|
namespace Dalamud.Interface {
|
||||||
|
class DalamudChangelogWindow : IDisposable {
|
||||||
|
private readonly Dalamud dalamud;
|
||||||
|
private string assemblyVersion = Util.AssemblyVersion;
|
||||||
|
|
||||||
|
private const bool WarrantsChangelog = true;
|
||||||
|
private const string ChangeLog =
|
||||||
|
@"* All plugin windows now hide together with the in-game UI when you toggle it.
|
||||||
|
You can change this behaviour with /xlsettings under the ""Look&Feel"" tab.
|
||||||
|
* The ""Item hovering"" feature, which was previously broken due to patch 5.3 is now working again.
|
||||||
|
* Added some extra infos about the state of the addon to the log, so we can help you better in case you encounter crashes.
|
||||||
|
* Added this changelog window.";
|
||||||
|
|
||||||
|
public DalamudChangelogWindow(Dalamud dalamud) {
|
||||||
|
this.dalamud = dalamud;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool Draw() {
|
||||||
|
var doDraw = true;
|
||||||
|
|
||||||
|
if (!WarrantsChangelog)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
ImGui.PushID("DalamudChangelogWindow");
|
||||||
|
ImGui.Begin("What's new in XIVLauncher?", ref doDraw, ImGuiWindowFlags.AlwaysAutoResize | ImGuiWindowFlags.NoResize);
|
||||||
|
|
||||||
|
ImGui.Text($"The in-game addon has been updated to version D{this.assemblyVersion}.");
|
||||||
|
|
||||||
|
ImGui.Dummy(new Vector2(10, 10));
|
||||||
|
|
||||||
|
ImGui.Text("The following changes were introduced:");
|
||||||
|
ImGui.Text(ChangeLog);
|
||||||
|
|
||||||
|
ImGui.Dummy(new Vector2(10, 10));
|
||||||
|
|
||||||
|
ImGui.Text("Thank you for using our tools!");
|
||||||
|
|
||||||
|
ImGui.Dummy(new Vector2(10, 10));
|
||||||
|
|
||||||
|
ImGui.PushFont(InterfaceManager.IconFont);
|
||||||
|
|
||||||
|
if (ImGui.Button(FontAwesomeIcon.Download.ToIconString()))
|
||||||
|
this.dalamud.OpenPluginInstaller();
|
||||||
|
|
||||||
|
if (ImGui.IsItemHovered()) {
|
||||||
|
ImGui.PopFont();
|
||||||
|
ImGui.SetTooltip("Open Plugin Installer");
|
||||||
|
ImGui.PushFont(InterfaceManager.IconFont);
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui.SameLine();
|
||||||
|
|
||||||
|
if (ImGui.Button(FontAwesomeIcon.LaughBeam.ToIconString()))
|
||||||
|
Process.Start("https://discord.gg/3NMcUV5");
|
||||||
|
|
||||||
|
if (ImGui.IsItemHovered()) {
|
||||||
|
ImGui.PopFont();
|
||||||
|
ImGui.SetTooltip("Join our Discord server");
|
||||||
|
ImGui.PushFont(InterfaceManager.IconFont);
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui.SameLine();
|
||||||
|
|
||||||
|
if (ImGui.Button(FontAwesomeIcon.Globe.ToIconString()))
|
||||||
|
Process.Start("https://github.com/goatcorp/FFXIVQuickLauncher");
|
||||||
|
|
||||||
|
if (ImGui.IsItemHovered()) {
|
||||||
|
ImGui.PopFont();
|
||||||
|
ImGui.SetTooltip("See our GitHub repository");
|
||||||
|
ImGui.PushFont(InterfaceManager.IconFont);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ImGui.PopFont();
|
||||||
|
|
||||||
|
ImGui.SameLine();
|
||||||
|
ImGui.Dummy(new Vector2(20, 0));
|
||||||
|
ImGui.SameLine();
|
||||||
|
|
||||||
|
if (ImGui.Button("Close")) {
|
||||||
|
doDraw = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui.End();
|
||||||
|
ImGui.PopID();
|
||||||
|
|
||||||
|
return doDraw;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue