using System;
using System.ComponentModel;
namespace KamiToolKit.Enums;
public enum OverlayLayer {
///
/// Layer that is the back most, this is below nameplates, but above the world itself.
///
[Description("KTK_Overlay_Back")]
Background,
///
/// Above nameplate layer
///
[Description("KTK_Overlay_Middle")]
BehindUserInterface,
///
/// Above most windows but below certain popup windows like battle text
///
[Description("KTK_Overlay_Higher")]
AboveUserInterface,
///
/// Above everything, use with caution
///
[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),
};
}