From c93d7f16ed20082a23ef778f9cd4d116e5c371df Mon Sep 17 00:00:00 2001 From: goat Date: Sun, 2 Jul 2023 18:30:15 +0200 Subject: [PATCH] chore: fix warnings --- Dalamud/Game/ClientState/Fates/FateTable.cs | 2 +- .../Game/ClientState/Objects/TargetManager.cs | 1 + Dalamud/Interface/Internal/InterfaceManager.cs | 8 ++++---- .../Windows/Data/Widgets/NetworkMonitorWidget.cs | 2 ++ .../PluginInstaller/ProfileManagerWidget.cs | 16 +++++++++------- .../SelfTest/AgingSteps/TargetAgingStep.cs | 4 ++-- Dalamud/Plugin/Services/IDataManager.cs | 1 + 7 files changed, 20 insertions(+), 14 deletions(-) diff --git a/Dalamud/Game/ClientState/Fates/FateTable.cs b/Dalamud/Game/ClientState/Fates/FateTable.cs index 8416f0ffb..53196d5df 100644 --- a/Dalamud/Game/ClientState/Fates/FateTable.cs +++ b/Dalamud/Game/ClientState/Fates/FateTable.cs @@ -17,7 +17,7 @@ namespace Dalamud.Game.ClientState.Fates; [ServiceManager.BlockingEarlyLoadedService] #pragma warning disable SA1015 [ResolveVia] -#pragma warning enable SA1015 +#pragma warning restore SA1015 public sealed partial class FateTable : IServiceType, IFateTable { private readonly ClientStateAddressResolver address; diff --git a/Dalamud/Game/ClientState/Objects/TargetManager.cs b/Dalamud/Game/ClientState/Objects/TargetManager.cs index c4c1e3822..ff1bdc5ba 100644 --- a/Dalamud/Game/ClientState/Objects/TargetManager.cs +++ b/Dalamud/Game/ClientState/Objects/TargetManager.cs @@ -3,6 +3,7 @@ using System; using Dalamud.Game.ClientState.Objects.Types; using Dalamud.IoC; using Dalamud.IoC.Internal; +#pragma warning disable CS0618 namespace Dalamud.Game.ClientState.Objects; diff --git a/Dalamud/Interface/Internal/InterfaceManager.cs b/Dalamud/Interface/Internal/InterfaceManager.cs index 5de5f52de..6bb45b325 100644 --- a/Dalamud/Interface/Internal/InterfaceManager.cs +++ b/Dalamud/Interface/Internal/InterfaceManager.cs @@ -1147,10 +1147,10 @@ internal class InterfaceManager : IDisposable, IServiceType var dPadRight = gamepadState.Raw(GamepadButtons.DpadRight) != 0; var dPadDown = gamepadState.Raw(GamepadButtons.DpadDown) != 0; var dPadLeft = gamepadState.Raw(GamepadButtons.DpadLeft) != 0; - var leftStickUp = gamepadState.LeftStickUp; - var leftStickRight = gamepadState.LeftStickRight; - var leftStickDown = gamepadState.LeftStickDown; - var leftStickLeft = gamepadState.LeftStickLeft; + var leftStickUp = gamepadState.LeftStick.Y > 0 ? gamepadState.LeftStick.Y / 100f : 0; + var leftStickRight = gamepadState.LeftStick.X > 0 ? gamepadState.LeftStick.X / 100f : 0; + var leftStickDown = gamepadState.LeftStick.Y < 0 ? -gamepadState.LeftStick.Y / 100f : 0; + var leftStickLeft = gamepadState.LeftStick.X < 0 ? -gamepadState.LeftStick.X / 100f : 0; var l1Button = gamepadState.Raw(GamepadButtons.L1) != 0; var l2Button = gamepadState.Raw(GamepadButtons.L2) != 0; var r1Button = gamepadState.Raw(GamepadButtons.R1) != 0; diff --git a/Dalamud/Interface/Internal/Windows/Data/Widgets/NetworkMonitorWidget.cs b/Dalamud/Interface/Internal/Windows/Data/Widgets/NetworkMonitorWidget.cs index ce1559fc8..01d0b1759 100644 --- a/Dalamud/Interface/Internal/Windows/Data/Widgets/NetworkMonitorWidget.cs +++ b/Dalamud/Interface/Internal/Windows/Data/Widgets/NetworkMonitorWidget.cs @@ -18,7 +18,9 @@ namespace Dalamud.Interface.Internal.Windows.Data; /// internal class NetworkMonitorWidget : IDataWindowWidget { +#pragma warning disable SA1313 private readonly record struct NetworkPacketData(ushort OpCode, NetworkMessageDirection Direction, uint SourceActorId, uint TargetActorId) +#pragma warning restore SA1313 { public readonly IReadOnlyList Data = Array.Empty(); diff --git a/Dalamud/Interface/Internal/Windows/PluginInstaller/ProfileManagerWidget.cs b/Dalamud/Interface/Internal/Windows/PluginInstaller/ProfileManagerWidget.cs index db455b985..e73287ee9 100644 --- a/Dalamud/Interface/Internal/Windows/PluginInstaller/ProfileManagerWidget.cs +++ b/Dalamud/Interface/Internal/Windows/PluginInstaller/ProfileManagerWidget.cs @@ -87,18 +87,20 @@ internal class ProfileManagerWidget if (scrolling) { ImGuiHelpers.SafeTextWrapped(Locs.TutorialParagraphOne); - ImGuiHelpers.ScaledDummy(3); + ImGuiHelpers.ScaledDummy(5); ImGuiHelpers.SafeTextWrapped(Locs.TutorialParagraphTwo); - ImGuiHelpers.ScaledDummy(3); + ImGuiHelpers.ScaledDummy(5); ImGuiHelpers.SafeTextWrapped(Locs.TutorialParagraphThree); - ImGuiHelpers.ScaledDummy(3); + ImGuiHelpers.ScaledDummy(5); ImGuiHelpers.SafeTextWrapped(Locs.TutorialParagraphFour); - ImGuiHelpers.ScaledDummy(3); + ImGuiHelpers.ScaledDummy(5); ImGuiHelpers.SafeTextWrapped(Locs.TutorialCommands); ImGui.BulletText(Locs.TutorialCommandsEnable); ImGui.BulletText(Locs.TutorialCommandsDisable); ImGui.BulletText(Locs.TutorialCommandsToggle); ImGuiHelpers.SafeTextWrapped(Locs.TutorialCommandsEnd); + + ImGuiHelpers.ScaledDummy(5); var buttonWidth = 120f; ImGui.SetCursorPosX((ImGui.GetWindowWidth() - buttonWidth) / 2); @@ -564,9 +566,6 @@ internal class ProfileManagerWidget public static string ErrorCouldNotChangeState => Loc.Localize("ProfileManagerCouldNotChangeState", "Could not change plugin state."); - public static string NotInstalled(string name) => - Loc.Localize("ProfileManagerNotInstalled", "{0} (Not Installed)").Format(name); - public static string TutorialTitle => Loc.Localize("ProfileManagerTutorial", "About Collections"); @@ -596,5 +595,8 @@ internal class ProfileManagerWidget public static string TutorialCommandsEnd => Loc.Localize("ProfileManagerTutorialCommandsEnd", "If you run multiple of these commands, they will be executed in order."); + + public static string NotInstalled(string name) => + Loc.Localize("ProfileManagerNotInstalled", "{0} (Not Installed)").Format(name); } } diff --git a/Dalamud/Interface/Internal/Windows/SelfTest/AgingSteps/TargetAgingStep.cs b/Dalamud/Interface/Internal/Windows/SelfTest/AgingSteps/TargetAgingStep.cs index 1e66ac19e..0a1b4d91d 100644 --- a/Dalamud/Interface/Internal/Windows/SelfTest/AgingSteps/TargetAgingStep.cs +++ b/Dalamud/Interface/Internal/Windows/SelfTest/AgingSteps/TargetAgingStep.cs @@ -23,8 +23,8 @@ internal class TargetAgingStep : IAgingStep switch (this.step) { case 0: - targetManager.ClearTarget(); - targetManager.ClearFocusTarget(); + targetManager.Target = null; + targetManager.FocusTarget = null; this.step++; diff --git a/Dalamud/Plugin/Services/IDataManager.cs b/Dalamud/Plugin/Services/IDataManager.cs index 69a3e9a21..fa8c5bf43 100644 --- a/Dalamud/Plugin/Services/IDataManager.cs +++ b/Dalamud/Plugin/Services/IDataManager.cs @@ -1,4 +1,5 @@ using System.Collections.ObjectModel; + using ImGuiScene; using Lumina; using Lumina.Data;