Fix random build warnings.

This commit is contained in:
Kaz Wolfe 2023-09-16 18:07:19 -07:00
parent 85bb5229d9
commit a9a0980372
No known key found for this signature in database
GPG key ID: 258813F53A16EBB4
3 changed files with 30 additions and 20 deletions

View file

@ -1,6 +1,4 @@
using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using Dalamud.Game.Gui.PartyFinder.Internal; using Dalamud.Game.Gui.PartyFinder.Internal;
using Dalamud.Game.Gui.PartyFinder.Types; using Dalamud.Game.Gui.PartyFinder.Types;
using Dalamud.Hooking; using Dalamud.Hooking;
@ -128,6 +126,9 @@ internal sealed class PartyFinderGui : IDisposable, IServiceType, IPartyFinderGu
} }
} }
/// <summary>
/// A scoped variant of the PartyFinderGui service.
/// </summary>
[PluginInterface] [PluginInterface]
[InterfaceVersion("1.0")] [InterfaceVersion("1.0")]
[ServiceManager.ScopedService] [ServiceManager.ScopedService]

View file

@ -1,4 +1,4 @@
using System; using System.Diagnostics.CodeAnalysis;
using System.Numerics; using System.Numerics;
namespace Dalamud.Interface; namespace Dalamud.Interface;
@ -8,6 +8,17 @@ namespace Dalamud.Interface;
/// </summary> /// </summary>
public static class ColorHelpers public static class ColorHelpers
{ {
/// <summary>
/// A struct representing a color using HSVA coordinates.
/// </summary>
/// <param name="H">The hue represented by this struct.</param>
/// <param name="S">The saturation represented by this struct.</param>
/// <param name="V">The value represented by this struct.</param>
/// <param name="A">The alpha represented by this struct.</param>
[SuppressMessage("StyleCop.CSharp.NamingRules", "SA1313:Parameter names should begin with lower-case letter",
Justification = "I don't like it.")]
public record struct HsvaColor(float H, float S, float V, float A);
/// <summary> /// <summary>
/// Pack a vector4 color into a uint for use in ImGui APIs. /// Pack a vector4 color into a uint for use in ImGui APIs.
/// </summary> /// </summary>
@ -22,7 +33,7 @@ public static class ColorHelpers
return (uint)((a << 24) | (b << 16) | (g << 8) | r); return (uint)((a << 24) | (b << 16) | (g << 8) | r);
} }
/// <summary> /// <summary>
/// Convert a RGBA color in the range of 0.f to 1.f to a uint. /// Convert a RGBA color in the range of 0.f to 1.f to a uint.
/// </summary> /// </summary>
@ -37,7 +48,7 @@ public static class ColorHelpers
return new Vector4(r, g, b, a); return new Vector4(r, g, b, a);
} }
/// <summary> /// <summary>
/// Convert a RGBA color in the range of 0.f to 1.f to a HSV color. /// Convert a RGBA color in the range of 0.f to 1.f to a HSV color.
/// </summary> /// </summary>
@ -146,7 +157,7 @@ public static class ColorHelpers
return new Vector4(r, g, b, hsv.A); return new Vector4(r, g, b, hsv.A);
} }
/// <summary> /// <summary>
/// Lighten a color. /// Lighten a color.
/// </summary> /// </summary>
@ -159,7 +170,7 @@ public static class ColorHelpers
hsv.V += amount; hsv.V += amount;
return HsvToRgb(hsv); return HsvToRgb(hsv);
} }
/// <summary> /// <summary>
/// Lighten a color. /// Lighten a color.
/// </summary> /// </summary>
@ -168,7 +179,7 @@ public static class ColorHelpers
/// <returns>The lightened color.</returns> /// <returns>The lightened color.</returns>
public static uint Lighten(uint color, float amount) public static uint Lighten(uint color, float amount)
=> RgbaVector4ToUint(Lighten(RgbaUintToVector4(color), amount)); => RgbaVector4ToUint(Lighten(RgbaUintToVector4(color), amount));
/// <summary> /// <summary>
/// Darken a color. /// Darken a color.
/// </summary> /// </summary>
@ -181,7 +192,7 @@ public static class ColorHelpers
hsv.V -= amount; hsv.V -= amount;
return HsvToRgb(hsv); return HsvToRgb(hsv);
} }
/// <summary> /// <summary>
/// Darken a color. /// Darken a color.
/// </summary> /// </summary>
@ -190,7 +201,7 @@ public static class ColorHelpers
/// <returns>The darkened color.</returns> /// <returns>The darkened color.</returns>
public static uint Darken(uint color, float amount) public static uint Darken(uint color, float amount)
=> RgbaVector4ToUint(Darken(RgbaUintToVector4(color), amount)); => RgbaVector4ToUint(Darken(RgbaUintToVector4(color), amount));
/// <summary> /// <summary>
/// Saturate a color. /// Saturate a color.
/// </summary> /// </summary>
@ -203,7 +214,7 @@ public static class ColorHelpers
hsv.S += amount; hsv.S += amount;
return HsvToRgb(hsv); return HsvToRgb(hsv);
} }
/// <summary> /// <summary>
/// Saturate a color. /// Saturate a color.
/// </summary> /// </summary>
@ -212,7 +223,7 @@ public static class ColorHelpers
/// <returns>The saturated color.</returns> /// <returns>The saturated color.</returns>
public static uint Saturate(uint color, float amount) public static uint Saturate(uint color, float amount)
=> RgbaVector4ToUint(Saturate(RgbaUintToVector4(color), amount)); => RgbaVector4ToUint(Saturate(RgbaUintToVector4(color), amount));
/// <summary> /// <summary>
/// Desaturate a color. /// Desaturate a color.
/// </summary> /// </summary>
@ -225,7 +236,7 @@ public static class ColorHelpers
hsv.S -= amount; hsv.S -= amount;
return HsvToRgb(hsv); return HsvToRgb(hsv);
} }
/// <summary> /// <summary>
/// Desaturate a color. /// Desaturate a color.
/// </summary> /// </summary>
@ -234,7 +245,7 @@ public static class ColorHelpers
/// <returns>The desaturated color.</returns> /// <returns>The desaturated color.</returns>
public static uint Desaturate(uint color, float amount) public static uint Desaturate(uint color, float amount)
=> RgbaVector4ToUint(Desaturate(RgbaUintToVector4(color), amount)); => RgbaVector4ToUint(Desaturate(RgbaUintToVector4(color), amount));
/// <summary> /// <summary>
/// Fade a color. /// Fade a color.
/// </summary> /// </summary>
@ -247,7 +258,7 @@ public static class ColorHelpers
hsv.A -= amount; hsv.A -= amount;
return HsvToRgb(hsv); return HsvToRgb(hsv);
} }
/// <summary> /// <summary>
/// Fade a color. /// Fade a color.
/// </summary> /// </summary>
@ -256,6 +267,4 @@ public static class ColorHelpers
/// <returns>The faded color.</returns> /// <returns>The faded color.</returns>
public static uint Fade(uint color, float amount) public static uint Fade(uint color, float amount)
=> RgbaVector4ToUint(Fade(RgbaUintToVector4(color), amount)); => RgbaVector4ToUint(Fade(RgbaUintToVector4(color), amount));
public record struct HsvaColor(float H, float S, float V, float A);
} }

View file

@ -1,8 +1,8 @@
using System; using Serilog;
using Serilog;
using Serilog.Events; using Serilog.Events;
#pragma warning disable CS1573 // See https://github.com/dotnet/roslyn/issues/40325
namespace Dalamud.Plugin.Services; namespace Dalamud.Plugin.Services;
/// <summary> /// <summary>