Files
AetherBags/KamiToolKit/Enums/OverlayLayer.cs
T
KnackAtNite 8db4ce6094
Debug Build and Test / Build against Latest Dalamud (push) Has been cancelled
Debug Build and Test / Build against Staging Dalamud (push) Has been cancelled
Initial commit: AetherBags + KamiToolKit for FC Gitea
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-08 14:46:31 -05:00

52 lines
1.5 KiB
C#

using System;
using System.ComponentModel;
namespace KamiToolKit.Enums;
public enum OverlayLayer {
/// <summary>
/// Layer that is the back most, this is below nameplates, but above the world itself.
/// </summary>
[Description("KTK_Overlay_Back")]
Background,
/// <summary>
/// Above nameplate layer
/// </summary>
[Description("KTK_Overlay_Middle")]
BehindUserInterface,
/// <summary>
/// Above most windows but below certain popup windows like battle text
/// </summary>
[Description("KTK_Overlay_Higher")]
AboveUserInterface,
/// <summary>
/// Above everything, use with caution
/// </summary>
[Description("KTK_Overlay_Front")]
Foreground,
}
public static class OverlayLayerExtensions {
extension(OverlayLayer layer) {
public int DepthLayer => layer switch {
OverlayLayer.Background => 1,
OverlayLayer.BehindUserInterface => 3,
OverlayLayer.AboveUserInterface => 7,
OverlayLayer.Foreground => 13,
_ => 1,
};
}
// Note: The game does not have a layer zero, but offsets the desired layer by one.
public static OverlayLayer GetOverlayLayer(this uint layer) => (layer + 1) switch {
1 => OverlayLayer.Background,
3 => OverlayLayer.BehindUserInterface,
7 => OverlayLayer.AboveUserInterface,
13 => OverlayLayer.Foreground,
_ => throw new Exception("Unknown depth layer: " + layer),
};
}