Skip to content

Commit

Permalink
Automatic code cleanup pass
Browse files Browse the repository at this point in the history
- Optimize all imports
- Remove a broken translation from JP
- Automated code cleanup
  • Loading branch information
KazWolfe committed Feb 19, 2024
1 parent f33552c commit b80df1d
Show file tree
Hide file tree
Showing 41 changed files with 20 additions and 68 deletions.
2 changes: 0 additions & 2 deletions FFXIVPlugin/ActionExecutor/FixedCommandStrategy.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;

using Lumina.Excel;
using XIVDeck.FFXIVPlugin.Base;
using XIVDeck.FFXIVPlugin.Game.Chat;
using XIVDeck.FFXIVPlugin.Resources.Localization;

namespace XIVDeck.FFXIVPlugin.ActionExecutor;
Expand Down
2 changes: 0 additions & 2 deletions FFXIVPlugin/ActionExecutor/Strategies/EmoteStrategy.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using FFXIVClientStructs.FFXIV.Client.Game;
using FFXIVClientStructs.FFXIV.Client.UI.Misc;
using Lumina.Excel.GeneratedSheets;
using XIVDeck.FFXIVPlugin.ActionExecutor.Payloads;
using XIVDeck.FFXIVPlugin.Base;
using XIVDeck.FFXIVPlugin.Exceptions;
using XIVDeck.FFXIVPlugin.Game;
using XIVDeck.FFXIVPlugin.Game.Chat;
using XIVDeck.FFXIVPlugin.Game.Managers;
using XIVDeck.FFXIVPlugin.Resources.Localization;
using XIVDeck.FFXIVPlugin.Utils.Game;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
using System;
using FFXIVClientStructs.FFXIV.Client.UI.Misc;
using FFXIVClientStructs.FFXIV.Client.UI.Misc;
using Lumina.Excel.GeneratedSheets;
using XIVDeck.FFXIVPlugin.Base;
using XIVDeck.FFXIVPlugin.Game.Managers;
using XIVDeck.FFXIVPlugin.Resources.Localization;

namespace XIVDeck.FFXIVPlugin.ActionExecutor.Strategies;

Expand Down
1 change: 0 additions & 1 deletion FFXIVPlugin/ActionExecutor/Strategies/GearsetStrategy.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;

using FFXIVClientStructs.FFXIV.Client.UI.Misc;
using XIVDeck.FFXIVPlugin.ActionExecutor.Payloads;
using XIVDeck.FFXIVPlugin.Base;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;

using FFXIVClientStructs.FFXIV.Client.Game.UI;
using FFXIVClientStructs.FFXIV.Client.UI.Misc;
using Lumina.Excel;
using Lumina.Excel.GeneratedSheets;
using XIVDeck.FFXIVPlugin.Base;
using XIVDeck.FFXIVPlugin.Exceptions;
using XIVDeck.FFXIVPlugin.Game.Chat;
using XIVDeck.FFXIVPlugin.Game.Managers;
using XIVDeck.FFXIVPlugin.Resources.Localization;

Expand Down
1 change: 0 additions & 1 deletion FFXIVPlugin/ActionExecutor/Strategies/MacroStrategy.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Collections.Generic;

using FFXIVClientStructs.FFXIV.Client.UI.Misc;
using FFXIVClientStructs.FFXIV.Client.UI.Shell;
using XIVDeck.FFXIVPlugin.Base;
Expand Down
5 changes: 1 addition & 4 deletions FFXIVPlugin/ActionExecutor/Strategies/MarkerStrategy.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
using System;

using FFXIVClientStructs.FFXIV.Client.UI.Misc;
using FFXIVClientStructs.FFXIV.Client.UI.Misc;
using XIVDeck.FFXIVPlugin.Base;
using XIVDeck.FFXIVPlugin.Game.Managers;

using Marker = XIVDeck.FFXIVPlugin.Game.Data.Marker;

namespace XIVDeck.FFXIVPlugin.ActionExecutor.Strategies;
Expand Down
1 change: 0 additions & 1 deletion FFXIVPlugin/ActionExecutor/Strategies/MinionStrategy.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;

using FFXIVClientStructs.FFXIV.Client.UI.Misc;
using Lumina.Excel.GeneratedSheets;
using XIVDeck.FFXIVPlugin.Base;
Expand Down
2 changes: 0 additions & 2 deletions FFXIVPlugin/ActionExecutor/Strategies/MountStrategy.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;

using FFXIVClientStructs.FFXIV.Client.UI.Misc;
using Lumina.Excel.GeneratedSheets;
using XIVDeck.FFXIVPlugin.Base;
using XIVDeck.FFXIVPlugin.Exceptions;
using XIVDeck.FFXIVPlugin.Game;
using XIVDeck.FFXIVPlugin.Game.Chat;
using XIVDeck.FFXIVPlugin.Game.Managers;
using XIVDeck.FFXIVPlugin.Resources.Localization;
using XIVDeck.FFXIVPlugin.Utils;
Expand Down
1 change: 0 additions & 1 deletion FFXIVPlugin/ActionExecutor/Strategies/OrnamentStrategy.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.Collections.Generic;
using System.Linq;

using FFXIVClientStructs.FFXIV.Client.UI.Misc;
using Lumina.Excel.GeneratedSheets;
using XIVDeck.FFXIVPlugin.Base;
Expand Down
4 changes: 1 addition & 3 deletions FFXIVPlugin/ActionExecutor/Strategies/WaymarkStrategy.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;

using FFXIVClientStructs.FFXIV.Client.UI.Misc;
using FFXIVClientStructs.FFXIV.Client.UI.Misc;
using Lumina.Excel.GeneratedSheets;
using XIVDeck.FFXIVPlugin.Base;
using XIVDeck.FFXIVPlugin.Game.Managers;
Expand Down
3 changes: 0 additions & 3 deletions FFXIVPlugin/Base/Injections.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using System.Diagnostics.CodeAnalysis;
using Dalamud.Game;
using Dalamud.Game.ClientState.Conditions;
using Dalamud.Game.Gui;
using Dalamud.Game.Gui.Toast;
using Dalamud.IoC;
using Dalamud.Plugin;
using Dalamud.Plugin.Services;
Expand Down
3 changes: 1 addition & 2 deletions FFXIVPlugin/Base/PluginConfig.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#nullable enable
using System;
using System;
using Dalamud.Configuration;
using EmbedIO;
using Newtonsoft.Json;
Expand Down
3 changes: 0 additions & 3 deletions FFXIVPlugin/Game/Chat/ChatHelper.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
using System;
using System.Runtime.InteropServices;
using System.Text;
using Dalamud.Utility.Signatures;
using FFXIVClientStructs.FFXIV.Client.System.Framework;
using FFXIVClientStructs.FFXIV.Client.System.Memory;
using FFXIVClientStructs.FFXIV.Client.System.String;
using FFXIVClientStructs.FFXIV.Client.UI;
using XIVDeck.FFXIVPlugin.Base;
Expand Down
1 change: 0 additions & 1 deletion FFXIVPlugin/Game/Chat/ErrorNotifier.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using Dalamud.Game.Text.SeStringHandling;

using XIVDeck.FFXIVPlugin.Base;
using XIVDeck.FFXIVPlugin.Resources.Localization;

Expand Down
3 changes: 1 addition & 2 deletions FFXIVPlugin/Game/DalamudHooks.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using XIVDeck.FFXIVPlugin.Game.Chat;
using XIVDeck.FFXIVPlugin.Game.Chat;
using XIVDeck.FFXIVPlugin.Server.Messages.Outbound;

namespace XIVDeck.FFXIVPlugin.Game;
Expand Down
1 change: 0 additions & 1 deletion FFXIVPlugin/Game/GameHooks.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using Dalamud.Hooking;

using Dalamud.Utility.Signatures;
using FFXIVClientStructs.FFXIV.Client.UI.Misc;
using XIVDeck.FFXIVPlugin.Base;
Expand Down
1 change: 0 additions & 1 deletion FFXIVPlugin/Game/Managers/HotbarManager.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Runtime.InteropServices;

using FFXIVClientStructs.FFXIV.Client.System.Framework;
using FFXIVClientStructs.FFXIV.Client.UI;
using FFXIVClientStructs.FFXIV.Client.UI.Misc;
Expand Down
1 change: 0 additions & 1 deletion FFXIVPlugin/Game/Managers/IconManager.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.IO;

using Lumina.Data.Files;
using XIVDeck.FFXIVPlugin.Base;
using XIVDeck.FFXIVPlugin.IPC.Subscribers;
Expand Down
1 change: 0 additions & 1 deletion FFXIVPlugin/Game/UnlockState.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using FFXIVClientStructs.FFXIV.Client.Game.UI;
using FFXIVClientStructs.FFXIV.Client.System.Framework;
using Lumina.Excel.GeneratedSheets;
using Swan;
using XIVDeck.FFXIVPlugin.Base;

namespace XIVDeck.FFXIVPlugin.Game;
Expand Down
4 changes: 2 additions & 2 deletions FFXIVPlugin/Game/Watchers/HotbarWatcher.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using Dalamud.Game;
using Dalamud.Plugin.Services;
using FFXIVClientStructs.FFXIV.Client.System.Framework;
using FFXIVClientStructs.FFXIV.Client.UI.Misc;
using XIVDeck.FFXIVPlugin.Base;
using XIVDeck.FFXIVPlugin.Game.Managers;
Expand All @@ -19,7 +19,7 @@ public HotbarWatcher() {

private unsafe void OnGameUpdate(IFramework framework) {
var hotbarModule =
FFXIVClientStructs.FFXIV.Client.System.Framework.Framework.Instance()->GetUiModule()->
Framework.Instance()->GetUiModule()->
GetRaptureHotbarModule();

List<MicroHotbarSlot> updatedSlots = new();
Expand Down
1 change: 0 additions & 1 deletion FFXIVPlugin/Game/Watchers/VolumeWatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Dalamud.Game.Config;

using XIVDeck.FFXIVPlugin.Base;
using XIVDeck.FFXIVPlugin.Game.Data;
using XIVDeck.FFXIVPlugin.Server.Messages.Outbound;
Expand Down
1 change: 0 additions & 1 deletion FFXIVPlugin/IPC/IPCManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System.Reflection;
using XIVDeck.FFXIVPlugin.Base;


namespace XIVDeck.FFXIVPlugin.IPC;

public class IPCManager : IDisposable {
Expand Down
1 change: 0 additions & 1 deletion FFXIVPlugin/IPC/Subscribers/PenumbraIPC.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Linq;

using Dalamud.Plugin.Ipc;
using Dalamud.Plugin.Ipc.Exceptions;
using XIVDeck.FFXIVPlugin.Base;
Expand Down
3 changes: 0 additions & 3 deletions FFXIVPlugin/IPC/Subscribers/TippyIPC.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;

using Dalamud.Plugin.Ipc;
using XIVDeck.FFXIVPlugin.Base;

Expand Down Expand Up @@ -48,8 +47,6 @@ private void _initializeIpc() {
}

var versionEndpoint = Injections.PluginInterface.GetIpcSubscriber<int>("Tippy.APIVersion");

// this line may explode with an exception, but that should be fine as we'd normally catch that higher up./
var version = versionEndpoint.InvokeFunc();

this._tippyApiVersionSubscriber = versionEndpoint;
Expand Down
3 changes: 0 additions & 3 deletions FFXIVPlugin/Resources/Localization/UIStrings.ja.resx
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,6 @@
<data name="SetupNag_ResolutionHelp" xml:space="preserve">
<value>まだインストールしていない場合は、GitHubから付属の XIVDeck Stream Deck プラグインをダウンロードしてインストールしてください。</value>
</data>
<data name="SetupNag_AlreadyInstalledHelp" xml:space="preserve">
<value>XIVDeck Stream Deck プラグインが既にインストールされている場合、設定からポートが正しく設定されていることを確認してください。また、少なくとも1つのボタンを作成してください。</value>
</data>
<data name="SetupNag_CurrentPort" xml:space="preserve">
<value>現在のポート: {0}</value>
</data>
Expand Down
1 change: 0 additions & 1 deletion FFXIVPlugin/Server/Controllers/ActionController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

using EmbedIO;
using EmbedIO.Routing;
using EmbedIO.WebApi;
Expand Down
1 change: 0 additions & 1 deletion FFXIVPlugin/Server/Controllers/ClassController.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.Collections.Generic;
using System.Linq;

using EmbedIO;
using EmbedIO.Routing;
using EmbedIO.WebApi;
Expand Down
1 change: 0 additions & 1 deletion FFXIVPlugin/Server/Helpers/AuthHelper.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Security.Principal;
using System.Threading.Tasks;

using EmbedIO;
using XIVDeck.FFXIVPlugin.Base;
using XIVDeck.FFXIVPlugin.Resources.Localization;
Expand Down
1 change: 0 additions & 1 deletion FFXIVPlugin/Server/Helpers/WSOpcodeAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Reflection;

using Newtonsoft.Json;
using XIVDeck.FFXIVPlugin.Base;
using XIVDeck.FFXIVPlugin.Resources.Localization;
Expand Down
1 change: 0 additions & 1 deletion FFXIVPlugin/Server/Messages/Inbound/WSInitOpcode.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.Reflection;
using System.Threading.Tasks;

using EmbedIO.WebSockets;
using Newtonsoft.Json;
using XIVDeck.FFXIVPlugin.Base;
Expand Down
1 change: 0 additions & 1 deletion FFXIVPlugin/Server/Types/SerializableGameClass.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;

using Lumina.Excel;
using Lumina.Excel.GeneratedSheets;
using Newtonsoft.Json;
Expand Down
1 change: 0 additions & 1 deletion FFXIVPlugin/Server/XIVDeckWSServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;

using EmbedIO.WebSockets;
using Newtonsoft.Json;
using XIVDeck.FFXIVPlugin.Base;
Expand Down
9 changes: 5 additions & 4 deletions FFXIVPlugin/Server/XIVDeckWebServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
using System.Net.Sockets;
using System.Threading;
using System.Threading.Tasks;

using Dalamud.Utility;
using EmbedIO;
using Swan.Logging;
using XIVDeck.FFXIVPlugin.Base;
using XIVDeck.FFXIVPlugin.Exceptions;
using XIVDeck.FFXIVPlugin.Game.Chat;
Expand All @@ -30,7 +31,7 @@ public class XIVDeckWebServer : IXIVDeckServer {
private XIVDeckWSServer? _wsServer;

public XIVDeckWebServer(XIVDeckPlugin plugin) {
Swan.Logging.Logger.RegisterLogger(this._logShim);
Logger.RegisterLogger(this._logShim);
this._plugin = plugin;
}

Expand Down Expand Up @@ -87,7 +88,7 @@ public void StopServer() {
public void Dispose() {
this.StopServer();

Swan.Logging.Logger.UnregisterLogger(this._logShim);
Logger.UnregisterLogger(this._logShim);
this._logShim.Dispose();

GC.SuppressFinalize(this);
Expand All @@ -106,7 +107,7 @@ private static HttpListenerMode GetListenerMode() {

// If you're wondering why this is here despite the below line doing the same thing, it's legacy just in case
// I want to swap the default listener for a specific operating system class.
if (Dalamud.Utility.Util.IsWine()) {
if (Util.IsWine()) {
Injections.PluginLog.Information("Linux environment detected; using EmbedIO listener.");
return HttpListenerMode.EmbedIO;
}
Expand Down
1 change: 0 additions & 1 deletion FFXIVPlugin/UI/ChatLinkWiring.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System.Reflection;
using Dalamud.Game.Text.SeStringHandling;
using Dalamud.Game.Text.SeStringHandling.Payloads;

using XIVDeck.FFXIVPlugin.Base;

namespace XIVDeck.FFXIVPlugin.UI;
Expand Down
1 change: 0 additions & 1 deletion FFXIVPlugin/UI/Windows/NagWindow.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Numerics;
using Dalamud.Interface;
using Dalamud.Interface.Utility;
using Dalamud.Interface.Windowing;
using ImGuiNET;
Expand Down
3 changes: 2 additions & 1 deletion FFXIVPlugin/UI/Windows/Nags/ForcedUpdateNag.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Dalamud.Interface.Colors;
using Dalamud.Interface.Components;
using Dalamud.Utility;
using ImGuiNET;
using XIVDeck.FFXIVPlugin.Resources.Localization;
using XIVDeck.FFXIVPlugin.Utils;
Expand Down Expand Up @@ -43,7 +44,7 @@ protected override void _internalDraw() {
}
ImGui.SameLine();
if (ImGui.Button(UIStrings.ForcedUpdateNag_SupportButton)) {
Dalamud.Utility.Util.OpenLink(Constants.GoatPlaceDiscord);
Util.OpenLink(Constants.GoatPlaceDiscord);
}
ImGuiComponents.HelpMarker(UIStrings.ForcedUpdateNag_BypassInstructions);
}
Expand Down
3 changes: 2 additions & 1 deletion FFXIVPlugin/UI/Windows/Nags/SetupNag.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Dalamud.Interface;
using Dalamud.Interface.Colors;
using Dalamud.Interface.Components;
using Dalamud.Utility;
using ImGuiNET;
using XIVDeck.FFXIVPlugin.Resources.Localization;
using XIVDeck.FFXIVPlugin.Utils;
Expand Down Expand Up @@ -73,7 +74,7 @@ protected override void _internalDraw() {
ImGui.TextColored(ImGuiColors.DalamudGrey, UIStrings.ForcedUpdateNag_SupportInfo);
ImGui.SameLine();
if (ImGuiComponents.IconButton(FontAwesomeIcon.Headset)) {
Dalamud.Utility.Util.OpenLink(Constants.GoatPlaceDiscord);
Util.OpenLink(Constants.GoatPlaceDiscord);
}
if (ImGui.IsItemHovered()) ImGui.SetTooltip(UIStrings.SetupNag_JoinDiscord);

Expand Down
Loading

0 comments on commit b80df1d

Please sign in to comment.