fix some warnings

This commit is contained in:
goat 2024-11-04 15:01:09 +01:00
parent 0c87717ffc
commit 8956bd54a9
9 changed files with 27 additions and 16 deletions

View file

@ -52,7 +52,7 @@ public enum AddonEvent
PostDraw,
/// <summary>
/// An event that is fired immediately before an addon is finalized via <see cref="AtkUnitBase.Finalize"/> and
/// An event that is fired immediately before an addon is finalized via <see cref="AtkUnitBase.Finalizer"/> and
/// destroyed. After this event, the addon will destruct its UI node data as well as free any allocated memory.
/// This event can be used for cleanup and tracking tasks.
/// </summary>

View file

@ -4,6 +4,7 @@ using Dalamud.Data;
using Dalamud.Game.ClientState.Resolvers;
using Dalamud.Game.Text.SeStringHandling;
using Dalamud.Memory;
using Dalamud.Utility;
namespace Dalamud.Game.ClientState.Fates;
@ -70,7 +71,13 @@ public interface IFate : IEquatable<IFate>
/// <summary>
/// Gets a value indicating whether or not this <see cref="Fate"/> has a EXP bonus.
/// </summary>
[Api11ToDo("Remove this")]
bool HasExpBonus { get; }
/// <summary>
/// Gets a value indicating whether or not this <see cref="Fate"/> has a EXP bonus.
/// </summary>
bool HasBonus { get; }
/// <summary>
/// Gets the icon id of this <see cref="Fate"/>.
@ -215,7 +222,10 @@ internal unsafe partial class Fate : IFate
public byte Progress => this.Struct->Progress;
/// <inheritdoc/>
public bool HasExpBonus => this.Struct->IsExpBonus;
public bool HasExpBonus => this.Struct->IsBonus;
/// <inheritdoc/>
public bool HasBonus => this.Struct->IsBonus;
/// <inheritdoc/>
public uint IconId => this.Struct->IconId;

View file

@ -127,7 +127,7 @@ internal unsafe class NamePlateUpdateContext : INamePlateUpdateContext
/// <summary>
/// Gets a pointer to the NamePlate addon's number array entries as a struct.
/// </summary>
internal AddonNamePlate.NamePlateIntArrayData* NumberStruct { get; private set; }
internal AddonNamePlate.AddonNamePlateNumberArray* NumberStruct { get; private set; }
/// <summary>
/// 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.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.HasParts = false;

View file

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

View file

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

View file

@ -172,7 +172,7 @@ internal unsafe partial class ImageNodeTree : ResNodeTree
var cursorScreenPos = ImGui.GetCursorScreenPos();
var cursorLocalPos = ImGui.GetCursorPos();
ImGui.Image(new(this.TexData.Texture->D3D11ShaderResourceView), new(this.TexData.Texture->Width, this.TexData.Texture->Height));
ImGui.Image(new(this.TexData.Texture->D3D11ShaderResourceView), new(this.TexData.Texture->ActualWidth, this.TexData.Texture->ActualHeight));
for (uint p = 0; p < this.TexData.PartsList->PartCount; p++)
{
@ -197,8 +197,8 @@ internal unsafe partial class ImageNodeTree : ResNodeTree
ImGui.TableHeadersRow();
var tWidth = this.TexData.Texture->Width;
var tHeight = this.TexData.Texture->Height;
var tWidth = this.TexData.Texture->ActualWidth;
var tHeight = this.TexData.Texture->ActualHeight;
var textureSize = new Vector2(tWidth, tHeight);
for (ushort i = 0; i < this.TexData.PartCount; i++)

View file

@ -287,7 +287,7 @@ public abstract class Window
this.IsFocused = false;
if (doSoundEffects && !this.DisableWindowSounds) UIModule.PlaySound(this.OnCloseSfxId, 0, 0, 0);
if (doSoundEffects && !this.DisableWindowSounds) UIGlobals.PlaySoundEffect(this.OnCloseSfxId, 0, 0, 0);
}
return;
@ -307,7 +307,7 @@ public abstract class Window
this.internalLastIsOpen = this.internalIsOpen;
this.OnOpen();
if (doSoundEffects && !this.DisableWindowSounds) UIModule.PlaySound(this.OnOpenSfxId, 0, 0, 0);
if (doSoundEffects && !this.DisableWindowSounds) UIGlobals.PlaySoundEffect(this.OnOpenSfxId, 0, 0, 0);
}
this.PreDraw();
@ -347,7 +347,7 @@ public abstract class Window
}
catch (Exception ex)
{
Log.Error(ex, $"Error during Draw(): {this.WindowName}");
Log.Error(ex, "Error during Draw(): {WindowName}", this.WindowName);
}
}

View file

@ -9,7 +9,6 @@ namespace Dalamud.Plugin.Ipc;
/// </summary>
public interface ICallGateSubscriber
{
/// <inheritdoc cref="CallGatePubSubBase.HasAction"/>
public bool HasAction { get; }

View file

@ -2,6 +2,8 @@ using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Runtime.CompilerServices;
using FFXIVClientStructs.FFXIV.Client.UI;
namespace Dalamud.Utility;
/// <summary>
@ -40,7 +42,7 @@ public static class StringExtensions
public static bool IsValidCharacterName(this string value, bool includeLegacy = true)
{
if (string.IsNullOrEmpty(value)) return false;
if (!FFXIVClientStructs.FFXIV.Client.UI.UIModule.IsPlayerCharacterName(value)) return false;
if (!UIGlobals.IsValidPlayerCharacterName(value)) return false;
return includeLegacy || value.Length <= 21;
}
}