Initial commit: AetherBags + KamiToolKit for FC Gitea
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
using FFXIVClientStructs.FFXIV.Client.UI;
|
||||
using KamiToolKit.Enums;
|
||||
using KamiToolKit.Nodes;
|
||||
|
||||
namespace KamiToolKit.Overlay;
|
||||
|
||||
public abstract unsafe class OverlayNode : SimpleOverlayNode {
|
||||
|
||||
public abstract OverlayLayer OverlayLayer { get; }
|
||||
|
||||
/// <summary>
|
||||
/// When true, this node will automatically hide when the game hides things like nameplates
|
||||
/// </summary>
|
||||
public virtual bool HideWithNativeUi => true;
|
||||
|
||||
public override bool IsVisible { get; set; } = true;
|
||||
|
||||
public void Update() {
|
||||
OnUpdate();
|
||||
|
||||
base.IsVisible = IsVisible && !(HideWithNativeUi && !IsNameplateVisible());
|
||||
}
|
||||
|
||||
protected abstract void OnUpdate();
|
||||
|
||||
private static bool IsNameplateVisible() {
|
||||
var nameplateAddon = RaptureAtkUnitManager.Instance()->GetAddonByName("NamePlate");
|
||||
if (nameplateAddon is null) return false;
|
||||
|
||||
return nameplateAddon->IsVisible;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user