From ff36f08d0c7bfeea4a6463a42e31ef87b88041d2 Mon Sep 17 00:00:00 2001 From: Kaz Wolfe Date: Mon, 4 Aug 2025 21:11:06 -0700 Subject: [PATCH] bump cs, fix warnings --- .../ClientState/Aetherytes/AetheryteEntry.cs | 2 +- .../ClientState/Conditions/ConditionFlag.cs | 6 ++++-- .../ClientState/Objects/Types/BattleChara.cs | 4 ++-- Dalamud/Game/ClientState/Party/PartyMember.cs | 2 +- Dalamud/Game/Gui/ContextMenu/ContextMenu.cs | 4 ++-- Dalamud/Game/Gui/GameGui.cs | 2 +- .../Game/Network/Internal/NetworkHandlers.cs | 2 +- Dalamud/Game/SigScanner.cs | 1 + Dalamud/Interface/Internal/InterfaceManager.cs | 6 +++--- .../Data/Widgets/AtkArrayDataBrowserWidget.cs | 17 ++++++++--------- .../Windows/StyleEditor/StyleEditorWindow.cs | 3 ++- lib/FFXIVClientStructs | 2 +- 12 files changed, 27 insertions(+), 24 deletions(-) diff --git a/Dalamud/Game/ClientState/Aetherytes/AetheryteEntry.cs b/Dalamud/Game/ClientState/Aetherytes/AetheryteEntry.cs index 244989476..89dd8b8b1 100644 --- a/Dalamud/Game/ClientState/Aetherytes/AetheryteEntry.cs +++ b/Dalamud/Game/ClientState/Aetherytes/AetheryteEntry.cs @@ -97,7 +97,7 @@ internal sealed class AetheryteEntry : IAetheryteEntry public uint GilCost => this.data.GilCost; /// - public bool IsFavourite => this.data.IsFavourite != 0; + public bool IsFavourite => this.data.IsFavourite; /// public bool IsSharedHouse => this.data.IsSharedHouse; diff --git a/Dalamud/Game/ClientState/Conditions/ConditionFlag.cs b/Dalamud/Game/ClientState/Conditions/ConditionFlag.cs index aa6de6e7a..316887e33 100644 --- a/Dalamud/Game/ClientState/Conditions/ConditionFlag.cs +++ b/Dalamud/Game/ClientState/Conditions/ConditionFlag.cs @@ -65,7 +65,8 @@ public enum ConditionFlag /// RidingPillion = 10, - [Obsolete("Renamed to RidingPillion", true)] Mounted2 = 10, + [Obsolete("Renamed to RidingPillion", true)] + Mounted2 = 10, /// /// Unable to execute command while in that position. @@ -429,7 +430,8 @@ public enum ConditionFlag /// MountImmobile = 88, - [Obsolete("Renamed to MountImmobile", true)] InThisState88 = 88, + [Obsolete("Renamed to MountImmobile", true)] + InThisState88 = 88, /// /// Unable to execute command in this state. diff --git a/Dalamud/Game/ClientState/Objects/Types/BattleChara.cs b/Dalamud/Game/ClientState/Objects/Types/BattleChara.cs index efd8b5b3b..238c81a72 100644 --- a/Dalamud/Game/ClientState/Objects/Types/BattleChara.cs +++ b/Dalamud/Game/ClientState/Objects/Types/BattleChara.cs @@ -77,10 +77,10 @@ internal unsafe class BattleChara : Character, IBattleChara public StatusList StatusList => new(this.Struct->GetStatusManager()); /// - public bool IsCasting => this.Struct->GetCastInfo()->IsCasting > 0; + public bool IsCasting => this.Struct->GetCastInfo()->IsCasting; /// - public bool IsCastInterruptible => this.Struct->GetCastInfo()->Interruptible > 0; + public bool IsCastInterruptible => this.Struct->GetCastInfo()->Interruptible; /// public byte CastActionType => (byte)this.Struct->GetCastInfo()->ActionType; diff --git a/Dalamud/Game/ClientState/Party/PartyMember.cs b/Dalamud/Game/ClientState/Party/PartyMember.cs index cf620a7ef..65b752808 100644 --- a/Dalamud/Game/ClientState/Party/PartyMember.cs +++ b/Dalamud/Game/ClientState/Party/PartyMember.cs @@ -128,7 +128,7 @@ internal unsafe class PartyMember : IPartyMember /// /// Gets the position of the party member. /// - public Vector3 Position => new(this.Struct->X, this.Struct->Y, this.Struct->Z); + public Vector3 Position => this.Struct->Position; /// /// Gets the content ID of the party member. diff --git a/Dalamud/Game/Gui/ContextMenu/ContextMenu.cs b/Dalamud/Game/Gui/ContextMenu/ContextMenu.cs index fb78e6b80..7512f4160 100644 --- a/Dalamud/Game/Gui/ContextMenu/ContextMenu.cs +++ b/Dalamud/Game/Gui/ContextMenu/ContextMenu.cs @@ -451,14 +451,14 @@ internal sealed unsafe class ContextMenu : IInternalDisposableService, IContextM case ContextMenuType.Default: { var ownerAddonId = ((AgentContext*)this.SelectedAgent)->OwnerAddon; - module->OpenAddon(this.AddonContextSubNameId, (uint)valueCount, values, this.SelectedAgent, 71, checked((ushort)ownerAddonId), 4); + module->OpenAddon(this.AddonContextSubNameId, (uint)valueCount, values, &this.SelectedAgent->AtkEventInterface, 71, checked((ushort)ownerAddonId), 4); break; } case ContextMenuType.Inventory: { var ownerAddonId = ((AgentInventoryContext*)this.SelectedAgent)->OwnerAddonId; - module->OpenAddon(this.AddonContextSubNameId, (uint)valueCount, values, this.SelectedAgent, 0, checked((ushort)ownerAddonId), 4); + module->OpenAddon(this.AddonContextSubNameId, (uint)valueCount, values, &this.SelectedAgent->AtkEventInterface, 0, checked((ushort)ownerAddonId), 4); break; } diff --git a/Dalamud/Game/Gui/GameGui.cs b/Dalamud/Game/Gui/GameGui.cs index eeb9fb572..415dd44c6 100644 --- a/Dalamud/Game/Gui/GameGui.cs +++ b/Dalamud/Game/Gui/GameGui.cs @@ -295,7 +295,7 @@ internal sealed unsafe class GameGui : IInternalDisposableService, IGameGui return ret; } - private void HandleActionHoverDetour(AgentActionDetail* hoverState, FFXIVClientStructs.FFXIV.Client.UI.Agent.ActionKind actionKind, uint actionId, int a4, byte a5) + private void HandleActionHoverDetour(AgentActionDetail* hoverState, FFXIVClientStructs.FFXIV.Client.UI.Agent.ActionKind actionKind, uint actionId, int a4, bool a5) { this.handleActionHoverHook.Original(hoverState, actionKind, actionId, a4, a5); this.HoveredAction.ActionKind = (HoverActionKind)actionKind; diff --git a/Dalamud/Game/Network/Internal/NetworkHandlers.cs b/Dalamud/Game/Network/Internal/NetworkHandlers.cs index 7d6304655..9b85d0ff3 100644 --- a/Dalamud/Game/Network/Internal/NetworkHandlers.cs +++ b/Dalamud/Game/Network/Internal/NetworkHandlers.cs @@ -275,7 +275,7 @@ internal unsafe class NetworkHandlers : IInternalDisposableService if (uploaderId == 0) { var playerState = PlayerState.Instance(); - if (playerState->IsLoaded == 1) + if (playerState->IsLoaded) { uploaderId = playerState->ContentId; } diff --git a/Dalamud/Game/SigScanner.cs b/Dalamud/Game/SigScanner.cs index 77d312aec..dc1e54e77 100644 --- a/Dalamud/Game/SigScanner.cs +++ b/Dalamud/Game/SigScanner.cs @@ -7,6 +7,7 @@ using System.Linq; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Threading; + using Iced.Intel; using Newtonsoft.Json; using Serilog; diff --git a/Dalamud/Interface/Internal/InterfaceManager.cs b/Dalamud/Interface/Internal/InterfaceManager.cs index c096b428f..72c964062 100644 --- a/Dalamud/Interface/Internal/InterfaceManager.cs +++ b/Dalamud/Interface/Internal/InterfaceManager.cs @@ -518,15 +518,15 @@ internal partial class InterfaceManager : IInternalDisposableService /// Safely invoke . internal void InvokeGlobalScaleChanged() - => DefaultGlobalScaleChanged.InvokeSafely(); + => this.DefaultGlobalScaleChanged.InvokeSafely(); /// Safely invoke . internal void InvokeFontChanged() - => DefaultFontChanged.InvokeSafely(); + => this.DefaultFontChanged.InvokeSafely(); /// Safely invoke . internal void InvokeStyleChanged() - => DefaultStyleChanged.InvokeSafely(); + => this.DefaultStyleChanged.InvokeSafely(); private static InterfaceManager WhenFontsReady() { diff --git a/Dalamud/Interface/Internal/Windows/Data/Widgets/AtkArrayDataBrowserWidget.cs b/Dalamud/Interface/Internal/Windows/Data/Widgets/AtkArrayDataBrowserWidget.cs index e0e3305b3..c3074e807 100644 --- a/Dalamud/Interface/Internal/Windows/Data/Widgets/AtkArrayDataBrowserWidget.cs +++ b/Dalamud/Interface/Internal/Windows/Data/Widgets/AtkArrayDataBrowserWidget.cs @@ -81,11 +81,10 @@ internal unsafe class AtkArrayDataBrowserWidget : IDataWindowWidget var stringArrayData = (StringArrayData*)arrays[arrayIndex]; for (var rowIndex = 0; rowIndex < arrays[arrayIndex]->Size; rowIndex++) { - var isNull = (nint)stringArrayData->StringArray[rowIndex] == 0; - if (isNull) + if (!stringArrayData->StringArray[rowIndex].HasValue) continue; - if (new ReadOnlySeStringSpan(stringArrayData->StringArray[rowIndex]).ExtractText().Contains(this.searchTerm, StringComparison.InvariantCultureIgnoreCase)) + if (new ReadOnlySeStringSpan(stringArrayData->StringArray[rowIndex].Value).ExtractText().Contains(this.searchTerm, StringComparison.InvariantCultureIgnoreCase)) rowsFound++; } @@ -289,7 +288,7 @@ internal unsafe class AtkArrayDataBrowserWidget : IDataWindowWidget for (var i = 0; i < array->Size; i++) { - var isNull = (nint)array->StringArray[i] == 0; + var isNull = !array->StringArray[i].HasValue; if (isNull && this.hideUnsetStringArrayEntries) continue; @@ -298,7 +297,7 @@ internal unsafe class AtkArrayDataBrowserWidget : IDataWindowWidget if (isNull) continue; - if (!new ReadOnlySeStringSpan(array->StringArray[i]).ExtractText().Contains(this.searchTerm, StringComparison.InvariantCultureIgnoreCase)) + if (!new ReadOnlySeStringSpan(array->StringArray[i].Value).ExtractText().Contains(this.searchTerm, StringComparison.InvariantCultureIgnoreCase)) continue; } @@ -312,7 +311,7 @@ internal unsafe class AtkArrayDataBrowserWidget : IDataWindowWidget if (this.showTextAddress) { if (!isNull) - WidgetUtil.DrawCopyableText($"0x{(nint)array->StringArray[i]:X}", "Copy text address"); + WidgetUtil.DrawCopyableText($"0x{(nint)array->StringArray[i].Value:X}", "Copy text address"); } else { @@ -322,7 +321,7 @@ internal unsafe class AtkArrayDataBrowserWidget : IDataWindowWidget ImGui.TableNextColumn(); // Managed if (!isNull) { - ImGui.Text(((nint)array->StringArray[i] != 0 && array->ManagedStringArray[i] == array->StringArray[i]).ToString()); + ImGui.Text((array->StringArray[i].HasValue && array->ManagedStringArray[i].Value == array->StringArray[i]).ToString()); } ImGui.TableNextColumn(); // Text @@ -330,11 +329,11 @@ internal unsafe class AtkArrayDataBrowserWidget : IDataWindowWidget { if (this.showMacroString) { - WidgetUtil.DrawCopyableText(new ReadOnlySeStringSpan(array->StringArray[i]).ToString(), "Copy text"); + WidgetUtil.DrawCopyableText(new ReadOnlySeStringSpan(array->StringArray[i].Value).ToString(), "Copy text"); } else { - ImGuiHelpers.SeStringWrapped(new ReadOnlySeStringSpan(array->StringArray[i])); + ImGuiHelpers.SeStringWrapped(new ReadOnlySeStringSpan(array->StringArray[i].Value)); } } } diff --git a/Dalamud/Interface/Internal/Windows/StyleEditor/StyleEditorWindow.cs b/Dalamud/Interface/Internal/Windows/StyleEditor/StyleEditorWindow.cs index 09106fd0e..f9e8022a1 100644 --- a/Dalamud/Interface/Internal/Windows/StyleEditor/StyleEditorWindow.cs +++ b/Dalamud/Interface/Internal/Windows/StyleEditor/StyleEditorWindow.cs @@ -254,7 +254,8 @@ public class StyleEditorWindow : Window ImGui.Text("Alignment"u8); changes |= ImGui.SliderFloat2("WindowTitleAlign", ref style.WindowTitleAlign, 0.0f, 1.0f, "%.2f"); var windowMenuButtonPosition = (int)style.WindowMenuButtonPosition + 1; - if (ImGui.Combo("WindowMenuButtonPosition"u8, ref windowMenuButtonPosition, ["None", "Left", "Right"])) { + if (ImGui.Combo("WindowMenuButtonPosition"u8, ref windowMenuButtonPosition, ["None", "Left", "Right"])) + { style.WindowMenuButtonPosition = (ImGuiDir)(windowMenuButtonPosition - 1); changes = true; } diff --git a/lib/FFXIVClientStructs b/lib/FFXIVClientStructs index 294254960..0904cf9f8 160000 --- a/lib/FFXIVClientStructs +++ b/lib/FFXIVClientStructs @@ -1 +1 @@ -Subproject commit 2942549605a0b1c7dfb274afabfe7db0332415bc +Subproject commit 0904cf9f8e612722fe7bd56cfd1c4e54cea48218