diff --git a/CelesteTAS-EverestInterop/Source/Gameplay/Hitboxes/ActualCollideHitbox.cs b/CelesteTAS-EverestInterop/Source/Gameplay/Hitboxes/ActualCollideHitbox.cs index 2509d096..dd79021b 100644 --- a/CelesteTAS-EverestInterop/Source/Gameplay/Hitboxes/ActualCollideHitbox.cs +++ b/CelesteTAS-EverestInterop/Source/Gameplay/Hitboxes/ActualCollideHitbox.cs @@ -27,7 +27,9 @@ public static class ActualCollideHitbox { private static readonly Dictionary> CollidableHandlers = new(); // Disable actual-collide hitboxes while they aren't used - private static bool Disabled => !TasSettings.ShowHitboxes || TasSettings.ShowActualCollideHitboxes == ActualCollideHitboxType.Off || Manager.FastForwarding; + + [PublicAPI] + public static bool Disabled => !TasSettings.ShowHitboxes || TasSettings.ShowActualCollideHitboxes == ActualCollideHitboxType.Off || Manager.FastForwarding; private static bool playerUpdated; private static bool colliderListRendering; @@ -142,16 +144,17 @@ private static void IL_Player_origUpdate(ILContext il) { } else { "Failed to apply patch for storing entity state during Update for actual-collide-hitboxes".Log(LogLevel.Warn); } + } - static void StoreCollider(Entity? entity) { - // If a PlayerCollider is checked multiple times, only use the first one - if (entity == null || playerUpdated || Disabled) { - return; - } - - LastPositions[entity] = entity.Position; - LastCollidables[entity] = entity.IsCollidable(); + [PublicAPI] + public static void StoreCollider(Entity? entity) { + // If a PlayerCollider is checked multiple times, only use the first one + if (entity == null || playerUpdated || Disabled) { + return; } + + LastPositions[entity] = entity.Position; + LastCollidables[entity] = entity.IsCollidable(); } private static void On_Player_Update(On.Celeste.Player.orig_Update orig, Player self) { diff --git a/CelesteTAS-EverestInterop/Source/InfoHUD/InfoWatchEntity.cs b/CelesteTAS-EverestInterop/Source/InfoHUD/InfoWatchEntity.cs index a3961159..f433edd5 100644 --- a/CelesteTAS-EverestInterop/Source/InfoHUD/InfoWatchEntity.cs +++ b/CelesteTAS-EverestInterop/Source/InfoHUD/InfoWatchEntity.cs @@ -58,11 +58,17 @@ public UniqueEntityId(Entity entity, EntityData entityData) { private static AreaKey currentAreaKey; internal static List WatchedEntities = []; internal static List WatchedEntities_Save = []; // Used for save-states + private static readonly HashSet WatchedEntityIds = []; /// Entities which are actively watched for the current frame internal static readonly HashSet CurrentlyWatchedEntities = []; + [PublicAPI] + public static bool IsWatching(Entity entity) { + return CurrentlyWatchedEntities.Contains(entity) || (entity.GetEntityData() is EntityData entityData && WatchedEntityIds.Contains(new UniqueEntityId(entity, entityData))); + } + internal static void CheckMouseButtons() { if (MouseButtons.Right.Pressed) { ClearWatchEntities();