fix all warnings and breaking changes for CS (#2061)

This commit is contained in:
wolfcomp 2024-11-05 06:14:51 +01:00 committed by GitHub
parent b570564258
commit 30d56e4d11
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 24 additions and 14 deletions

View file

@ -71,8 +71,14 @@ public interface IFate : IEquatable<IFate>
/// <summary> /// <summary>
/// Gets a value indicating whether or not this <see cref="Fate"/> has a EXP bonus. /// Gets a value indicating whether or not this <see cref="Fate"/> has a EXP bonus.
/// </summary> /// </summary>
[Obsolete("Use HasBonus instead")]
bool HasExpBonus { get; } bool HasExpBonus { get; }
/// <summary>
/// Gets a value indicating whether or not this <see cref="Fate"/> has a bonus.
/// </summary>
bool HasBonus { get; }
/// <summary> /// <summary>
/// Gets the icon id of this <see cref="Fate"/>. /// Gets the icon id of this <see cref="Fate"/>.
/// </summary> /// </summary>
@ -216,8 +222,12 @@ internal unsafe partial class Fate : IFate
public byte Progress => this.Struct->Progress; public byte Progress => this.Struct->Progress;
/// <inheritdoc/> /// <inheritdoc/>
[Obsolete("Use HasBonus instead")]
public bool HasExpBonus => this.Struct->IsExpBonus; public bool HasExpBonus => this.Struct->IsExpBonus;
/// <inheritdoc/>
public bool HasBonus => this.Struct->IsBonus;
/// <inheritdoc/> /// <inheritdoc/>
public uint IconId => this.Struct->IconId; public uint IconId => this.Struct->IconId;

View file

@ -127,7 +127,7 @@ internal unsafe class NamePlateUpdateContext : INamePlateUpdateContext
/// <summary> /// <summary>
/// Gets a pointer to the NamePlate addon's number array entries as a struct. /// Gets a pointer to the NamePlate addon's number array entries as a struct.
/// </summary> /// </summary>
internal AddonNamePlate.NamePlateIntArrayData* NumberStruct { get; private set; } internal AddonNamePlate.AddonNamePlateNumberArray* NumberStruct { get; private set; }
/// <summary> /// <summary>
/// Gets or sets a value indicating whether any handler in the current context has instantiated a part builder. /// Gets or sets a value indicating whether any handler in the current context has instantiated a part builder.
@ -142,7 +142,7 @@ internal unsafe class NamePlateUpdateContext : INamePlateUpdateContext
{ {
this.Addon = (AddonNamePlate*)args.Addon; this.Addon = (AddonNamePlate*)args.Addon;
this.NumberData = ((NumberArrayData**)args.NumberArrayData)![NamePlateGui.NumberArrayIndex]; this.NumberData = ((NumberArrayData**)args.NumberArrayData)![NamePlateGui.NumberArrayIndex];
this.NumberStruct = (AddonNamePlate.NamePlateIntArrayData*)this.NumberData->IntArray; this.NumberStruct = (AddonNamePlate.AddonNamePlateNumberArray*)this.NumberData->IntArray;
this.StringData = ((StringArrayData**)args.StringArrayData)![NamePlateGui.StringArrayIndex]; this.StringData = ((StringArrayData**)args.StringArrayData)![NamePlateGui.StringArrayIndex];
this.HasParts = false; this.HasParts = false;

View file

@ -1,4 +1,4 @@
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Text; using System.Text;
@ -490,7 +490,7 @@ internal unsafe class NamePlateUpdateHandler : INamePlateUpdateHandler
private AddonNamePlate.NamePlateObject* NamePlateObject => private AddonNamePlate.NamePlateObject* NamePlateObject =>
&this.context.Addon->NamePlateObjectArray[this.NamePlateIndex]; &this.context.Addon->NamePlateObjectArray[this.NamePlateIndex];
private AddonNamePlate.NamePlateIntArrayData.NamePlateObjectIntArrayData* ObjectData => private AddonNamePlate.AddonNamePlateNumberArray.NamePlateObjectIntArrayData* ObjectData =>
this.context.NumberStruct->ObjectData.GetPointer(this.ArrayIndex); this.context.NumberStruct->ObjectData.GetPointer(this.ArrayIndex);
/// <inheritdoc/> /// <inheritdoc/>

View file

@ -63,7 +63,7 @@ public unsafe struct GameInventoryItem : IEquatable<GameInventoryItem>
/// <summary> /// <summary>
/// Gets the quantity of items in this item stack. /// Gets the quantity of items in this item stack.
/// </summary> /// </summary>
public uint Quantity => this.InternalItem.Quantity; public int Quantity => this.InternalItem.Quantity;
/// <summary> /// <summary>
/// Gets the spiritbond of this item. /// Gets the spiritbond of this item.

View file

@ -300,7 +300,7 @@ internal unsafe class UiDebug
{ {
ImGui.Image( ImGui.Image(
new IntPtr(kernelTexture->D3D11ShaderResourceView), new IntPtr(kernelTexture->D3D11ShaderResourceView),
new Vector2(kernelTexture->Width, kernelTexture->Height)); new Vector2(kernelTexture->ActualWidth, kernelTexture->ActualHeight));
ImGui.TreePop(); ImGui.TreePop();
} }
} }
@ -312,8 +312,8 @@ internal unsafe class UiDebug
ImGui.Image( ImGui.Image(
new IntPtr(textureInfo->AtkTexture.KernelTexture->D3D11ShaderResourceView), new IntPtr(textureInfo->AtkTexture.KernelTexture->D3D11ShaderResourceView),
new Vector2( new Vector2(
textureInfo->AtkTexture.KernelTexture->Width, textureInfo->AtkTexture.KernelTexture->ActualWidth,
textureInfo->AtkTexture.KernelTexture->Height)); textureInfo->AtkTexture.KernelTexture->ActualHeight));
ImGui.TreePop(); ImGui.TreePop();
} }
} }

View file

@ -153,7 +153,7 @@ internal class FateTableWidget : IDataWindowWidget
} }
ImGui.TableNextColumn(); // HasExpBonus ImGui.TableNextColumn(); // HasExpBonus
ImGui.TextUnformatted(fate.HasExpBonus.ToString()); ImGui.TextUnformatted(fate.HasBonus.ToString());
ImGui.TableNextColumn(); // Position ImGui.TableNextColumn(); // Position
DrawCopyableText(fate.Position.ToString(), "Click to copy Position"); DrawCopyableText(fate.Position.ToString(), "Click to copy Position");

View file

@ -141,7 +141,7 @@ internal class ContextMenuAgingStep : IAgingStep
OnClicked = (IMenuItemClickedArgs a) => OnClicked = (IMenuItemClickedArgs a) =>
{ {
SeString name; SeString name;
uint count; int count;
var targetItem = (a.Target as MenuTargetInventory)!.TargetItem; var targetItem = (a.Target as MenuTargetInventory)!.TargetItem;
if (targetItem is { } item) if (targetItem is { } item)
{ {

View file

@ -287,7 +287,7 @@ public abstract class Window
this.IsFocused = false; this.IsFocused = false;
if (doSoundEffects && !this.DisableWindowSounds) UIModule.PlaySound(this.OnCloseSfxId, 0, 0, 0); if (doSoundEffects && !this.DisableWindowSounds) UIGlobals.PlaySoundEffect(this.OnCloseSfxId);
} }
return; return;
@ -307,7 +307,7 @@ public abstract class Window
this.internalLastIsOpen = this.internalIsOpen; this.internalLastIsOpen = this.internalIsOpen;
this.OnOpen(); this.OnOpen();
if (doSoundEffects && !this.DisableWindowSounds) UIModule.PlaySound(this.OnOpenSfxId, 0, 0, 0); if (doSoundEffects && !this.DisableWindowSounds) UIGlobals.PlaySoundEffect(this.OnOpenSfxId);
} }
this.PreDraw(); this.PreDraw();

View file

@ -40,7 +40,7 @@ public static class StringExtensions
public static bool IsValidCharacterName(this string value, bool includeLegacy = true) public static bool IsValidCharacterName(this string value, bool includeLegacy = true)
{ {
if (string.IsNullOrEmpty(value)) return false; if (string.IsNullOrEmpty(value)) return false;
if (!FFXIVClientStructs.FFXIV.Client.UI.UIModule.IsPlayerCharacterName(value)) return false; if (!FFXIVClientStructs.FFXIV.Client.UI.UIGlobals.IsValidPlayerCharacterName(value)) return false;
return includeLegacy || value.Length <= 21; return includeLegacy || value.Length <= 21;
} }
} }

@ -1 +1 @@
Subproject commit 7c5f04e346067f7a316ad9072fb8260122ba80f0 Subproject commit e59323cf39e6acffd385006c156fa0105c255b54