示例#1
0
        public void PaintTopInGame(ClipState clipState)
        {
            if (clipState != ClipState.BeforeClip)
            {
                return;
            }
            var textDistanceAway = TextDistanceAway;

            var monsters = Hud.Game.AliveMonsters.Where(monster => MonsterBrushes.ContainsKey(monster.Rarity) && monster.SummonerAcdDynamicId == 0 && monster.NormalizedXyDistanceToMe > CloseEnoughRange);

            foreach (var monster in monsters)
            {
                var monsterScreenCoordinate = monster.FloorCoordinate.ToScreenCoordinate();

                //Draw line to monster
                var start = PointOnLine(center.X, center.Y, monsterScreenCoordinate.X, monsterScreenCoordinate.Y, 60);
                var end   = PointOnLine(monsterScreenCoordinate.X, monsterScreenCoordinate.Y - 30, center.X, center.Y, 20);

                if (!monster.IsOnScreen)
                {
                    MonsterBrushes[monster.Rarity].DrawLine(start.X, start.Y, end.X, end.Y, StrokeWidth);
                    if (ShowText) //Draw text
                    {
                        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
                    }
                }
            }
        }
示例#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);
            }
        }