chore: convert Dalamud to file-scoped namespaces

This commit is contained in:
goat 2022-10-29 15:23:22 +02:00
parent b093323acc
commit 987ff8dc8f
No known key found for this signature in database
GPG key ID: 49E2AA8C6A76498B
368 changed files with 55081 additions and 55450 deletions

View file

@ -8,161 +8,160 @@ using Dalamud.Utility;
using ImGuiNET;
using ImGuiScene;
namespace Dalamud.Interface.Internal.Windows
namespace Dalamud.Interface.Internal.Windows;
/// <summary>
/// For major updates, an in-game Changelog window.
/// </summary>
internal sealed class ChangelogWindow : Window, IDisposable
{
/// <summary>
/// For major updates, an in-game Changelog window.
/// Whether the latest update warrants a changelog window.
/// </summary>
internal sealed class ChangelogWindow : Window, IDisposable
{
/// <summary>
/// Whether the latest update warrants a changelog window.
/// </summary>
public const string WarrantsChangelogForMajorMinor = "7.0.";
public const string WarrantsChangelogForMajorMinor = "7.0.";
private const string ChangeLog =
@"• Updated Dalamud for compatibility with Patch 6.2
private const string ChangeLog =
@"• Updated Dalamud for compatibility with Patch 6.2
Made things more speedy
Plugins can now be toggled off while remaining installed, instead of being removed completely
If you note any issues or need help, please check the FAQ, and reach out on our Discord if you need help.
Thanks and have fun!";
private const string UpdatePluginsInfo =
@"• All of your plugins were disabled automatically, due to this update. This is normal.
private const string UpdatePluginsInfo =
@"• All of your plugins were disabled automatically, due to this update. This is normal.
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 string assemblyVersion = Util.AssemblyVersion;
private readonly TextureWrap logoTexture;
private readonly TextureWrap logoTexture;
/// <summary>
/// Initializes a new instance of the <see cref="ChangelogWindow"/> class.
/// </summary>
public ChangelogWindow()
: base("What's new in Dalamud?", ImGuiWindowFlags.AlwaysAutoResize | ImGuiWindowFlags.NoResize)
/// <summary>
/// Initializes a new instance of the <see cref="ChangelogWindow"/> class.
/// </summary>
public ChangelogWindow()
: base("What's new in Dalamud?", ImGuiWindowFlags.AlwaysAutoResize | ImGuiWindowFlags.NoResize)
{
this.Namespace = "DalamudChangelogWindow";
this.Size = new Vector2(885, 463);
this.SizeCondition = ImGuiCond.Appearing;
var interfaceManager = Service<InterfaceManager>.Get();
var dalamud = Service<Dalamud>.Get();
this.logoTexture =
interfaceManager.LoadImage(Path.Combine(dalamud.AssetDirectory.FullName, "UIRes", "logo.png"))!;
}
/// <inheritdoc/>
public override void Draw()
{
ImGui.Text($"Dalamud has been updated to version D{this.assemblyVersion}.");
ImGuiHelpers.ScaledDummy(10);
ImGui.Text("The following changes were introduced:");
ImGui.SameLine();
ImGuiHelpers.ScaledDummy(0);
var imgCursor = ImGui.GetCursorPos();
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()))
{
this.Namespace = "DalamudChangelogWindow";
this.Size = new Vector2(885, 463);
this.SizeCondition = ImGuiCond.Appearing;
var interfaceManager = Service<InterfaceManager>.Get();
var dalamud = Service<Dalamud>.Get();
this.logoTexture =
interfaceManager.LoadImage(Path.Combine(dalamud.AssetDirectory.FullName, "UIRes", "logo.png"))!;
Service<DalamudInterface>.Get().OpenPluginInstaller();
}
/// <inheritdoc/>
public override void Draw()
if (ImGui.IsItemHovered())
{
ImGui.Text($"Dalamud has been updated to version D{this.assemblyVersion}.");
ImGuiHelpers.ScaledDummy(10);
ImGui.Text("The following changes were introduced:");
ImGui.SameLine();
ImGuiHelpers.ScaledDummy(0);
var imgCursor = ImGui.GetCursorPos();
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 (ImGui.IsItemHovered())
{
ImGui.PopFont();
ImGui.SetTooltip("Open Plugin Installer");
ImGui.PushFont(UiBuilder.IconFont);
}
ImGui.SameLine();
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();
if (ImGui.Button(FontAwesomeIcon.Globe.ToIconString()))
{
Util.OpenLink("https://goatcorp.github.io/faq/");
}
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));
ImGui.SetTooltip("Open Plugin Installer");
ImGui.PushFont(UiBuilder.IconFont);
}
/// <summary>
/// Dispose this window.
/// </summary>
public void Dispose()
ImGui.SameLine();
if (ImGui.Button(FontAwesomeIcon.LaughBeam.ToIconString()))
{
this.logoTexture.Dispose();
Util.OpenLink("https://discord.gg/3NMcUV5");
}
if (ImGui.IsItemHovered())
{
ImGui.PopFont();
ImGui.SetTooltip("Join our Discord server");
ImGui.PushFont(UiBuilder.IconFont);
}
ImGui.SameLine();
if (ImGui.Button(FontAwesomeIcon.Globe.ToIconString()))
{
Util.OpenLink("https://goatcorp.github.io/faq/");
}
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>
/// Dispose this window.
/// </summary>
public void Dispose()
{
this.logoTexture.Dispose();
}
}