public CollectablePointer(EntityData followerPosition, CollectableConfig collectableConfig) { EntityData = followerPosition; this.collectableConfig = collectableConfig; Position = this.followerPosition = EntityData.Position + new Vector2(EntityData.Level.Bounds.Left, EntityData.Level.Bounds.Top); // since we have manually force the pointers update while level transitions, // Tags.TransitionUpdate is not needed to prevent pointers update for second time // Tags.Global fixes pointers disappeared after teleporting (for example, in Glyph and beginning of Farewell) Tag = Tags.Global | TagsExtension.CollectablePointer; Depth = Depths.Top; arrowImages = GFX.Game.GetAtlasSubtextures("util/strawberry_tool_arrow/strawberry_tool_arrow"); Add(new TransitionListener { OnOut = delegate(float value) { if (!Settings.DetectCurrentRoom && EntityData.Level == level.Session.LevelData) { transitionFade = 1 - value; } else { transitionFade = 1f; } }, }); }
private static void TryAddPointer(Level level, EntityData entityData) { CollectableConfig collectableConfig = CollectableConfig.All.Find(item => item.ShouldBeAdded(level, entityData)); if (collectableConfig != null) { level.Add(new CollectablePointer(entityData, collectableConfig)); } }