Beispiel #1
0
 private void DebugAnimations()
 {
     _started = true;
     GizmoBrushes.Add(GizmoType.Portal, new Line(Line.AnimType.Fade, Hud.Render.CreateBrush(100, 250, 255, 0, 0)));
     GizmoBrushes.Add(GizmoType.IdentifyAll, new Line(Line.AnimType.WidthMod, Hud.Render.CreateBrush(100, 0, 0, 255, 0)));
     GizmoBrushes.Add(GizmoType.SharedStash, new Line(Line.AnimType.Blink, Hud.Render.CreateBrush(100, 0, 255, 0, 0)));
 }
Beispiel #2
0
        public void PaintTopInGame(ClipState clipState)
        {
            if (clipState != ClipState.BeforeClip)
            {
                return;
            }
            if (Debug && !_started)
            {
                DebugAnimations();
            }

            if (AnimationsEnabled)
            {
                AnimationUpdate();
            }

            //Monster lines
            if (MonsterLinesEnabled)
            {
                var textDistanceAway = TextDistanceAway;
                var monsters         = Hud.Game.AliveMonsters.Where(monster => MonsterBrushes.ContainsKey(monster.Rarity) && monster.NormalizedXyDistanceToMe > CloseEnoughRange && monster.SummonerAcdDynamicId == 0);
                foreach (var monster in monsters)
                {
                    var monsterScreenCoordinate = monster.FloorCoordinate.ToScreenCoordinate();
                    DrawLine(monsterScreenCoordinate, MonsterBrushes[monster.Rarity], !(monster.NormalizedXyDistanceToMe < HitRange));

                    if (!MonsterDistanceTextEnabled)
                    {
                        continue;
                    }
                    var layout = TextFont.GetTextLayout(string.Format("{0:N0}", monster.NormalizedXyDistanceToMe));
                    var p      = PointOnLine(Center.X, Center.Y, monsterScreenCoordinate.X, monsterScreenCoordinate.Y, textDistanceAway);
                    TextFont.DrawText(layout, p.X, p.Y);
                    textDistanceAway += 30; // avoid text overlap
                }
            }

            //Gizmo lines
            if ((!GizmoLinesEnabled || Hud.Game.IsInTown) && !Debug)
            {
                return;
            }
            var gizmos = Hud.Game.Actors.Where(actor => GizmoBrushes.ContainsKey(actor.GizmoType));

            foreach (var gizmo in gizmos)
            {
                if (gizmo.IsOperated)
                {
                    continue;
                }
                var gizmoPos  = gizmo.FloorCoordinate.ToScreenCoordinate();
                var gizmoLine = GizmoBrushes[gizmo.GizmoType];
                DrawLine(gizmoPos, gizmoLine, false);
            }
        }