Ejemplo n.º 1
0
        public void PaintWorld(WorldLayer layer)
        {
            if ((Hud.Game.MapMode == MapMode.WaypointMap) || (Hud.Game.MapMode == MapMode.ActMap) || (Hud.Game.MapMode == MapMode.Map))
            {
                return;
            }
            var players = Hud.Game.Players;

            foreach (var p in players)
            {
                var portraitRect = p.PortraitUiElement.Rectangle;
                if (p.IsMe)
                {
                    RuleCalculatorMe.CalculatePaintInfo(p);
                    if (RuleCalculatorMe.PaintInfoList.Count != 0)
                    {
                        if (MeScreenPaint)
                        {
                            BuffPainter.PaintHorizontalCenter(
                                RuleCalculatorMe.PaintInfoList,
                                0,
                                Hud.Window.Size.Height * 0.5f + Hud.Window.Size.Height * MePositionOffset,
                                Hud.Window.Size.Width,
                                RuleCalculatorMe.StandardIconSize,
                                RuleCalculatorMe.StandardIconSpacing
                                );
                        }
                    }
                    if (MePortraitPaint)
                    {
                        BuffPainter.PaintHorizontal(
                            RuleCalculatorMe.PaintInfoList,
                            portraitRect.Right,
                            portraitRect.Top + portraitRect.Height * 0.72f,
                            RuleCalculatorMe.StandardIconSize,
                            RuleCalculatorMe.StandardIconSpacing
                            );
                    }
                }
                else
                {
                    if (p.IsOnScreen && p.CoordinateKnown)
                    {
                        var ScreenCoordinate = p.FloorCoordinate.ToScreenCoordinate();
                        var PlayerX          = ScreenCoordinate.X;
                        var PlayerY          = ScreenCoordinate.Y;
                        RuleCalculators[p.HeroClassDefinition.HeroClass].CalculatePaintInfo(p);
                        if (RuleCalculators[p.HeroClassDefinition.HeroClass].PaintInfoList.Count != 0)
                        {
                            if (OtherScreenPaint)
                            {
                                BuffPainter.PaintHorizontalCenter(
                                    RuleCalculators[p.HeroClassDefinition.HeroClass].PaintInfoList,
                                    PlayerX,
                                    PlayerY - Hud.Window.Size.Height * 0.05f + Hud.Window.Size.Height * PositionOffset,
                                    0,
                                    RuleCalculators[p.HeroClassDefinition.HeroClass].StandardIconSize,
                                    RuleCalculators[p.HeroClassDefinition.HeroClass].StandardIconSpacing
                                    );
                            }
                            if (OtherPortraitPaint)
                            {
                                BuffPainter.PaintHorizontal(
                                    RuleCalculators[p.HeroClassDefinition.HeroClass].PaintInfoList,
                                    portraitRect.Right,
                                    portraitRect.Top + portraitRect.Height * 0.72f,
                                    RuleCalculators[p.HeroClassDefinition.HeroClass].StandardIconSize,
                                    RuleCalculators[p.HeroClassDefinition.HeroClass].StandardIconSpacing
                                    );
                            }
                        }
                    }
                }

                if (Debug)
                {
                    DebugPrint(layer, p);
                }
            }
        }
Ejemplo n.º 2
0
        public void PaintWorld(WorldLayer layer)
        {
            var players = Hud.Game.Players;

            foreach (var p in players)
            {
                if (p.IsMe)
                {
                    RuleCalculatorMe.CalculatePaintInfo(p);
                    if (RuleCalculatorMe.PaintInfoList.Count != 0)
                    {
                        BuffPainter.PaintHorizontalCenter(
                            RuleCalculatorMe.PaintInfoList,
                            0,
                            p.ScreenCoordinate.Y + Hud.Window.Size.Height * PositionOffset,
                            Hud.Window.Size.Width,
                            RuleCalculatorMe.StandardIconSize,
                            RuleCalculatorMe.StandardIconSpacing
                            );
                    }
                }
                else
                {
                    if (!p.CoordinateKnown)
                    {
                        continue;
                    }
                    if (p.IsOnScreen && !OthersAlwaysNextToPortrait)
                    {
                        RuleCalculators[p.HeroClassDefinition.HeroClass].SizeMultiplier = SizeMultiplier;
                        RuleCalculators[p.HeroClassDefinition.HeroClass].CalculatePaintInfo(p);
                        if (RuleCalculators[p.HeroClassDefinition.HeroClass].PaintInfoList.Count != 0)
                        {
                            BuffPainter.PaintHorizontalCenter(
                                RuleCalculators[p.HeroClassDefinition.HeroClass].PaintInfoList,
                                p.ScreenCoordinate.X,
                                p.ScreenCoordinate.Y + Hud.Window.Size.Height * PositionOffset,
                                0,
                                RuleCalculators[p.HeroClassDefinition.HeroClass].StandardIconSize,
                                RuleCalculators[p.HeroClassDefinition.HeroClass].StandardIconSpacing
                                );
                        }
                    }
                    else
                    {
                        RuleCalculators[p.HeroClassDefinition.HeroClass].SizeMultiplier = PortraitSizeMultiplier;
                        RuleCalculators[p.HeroClassDefinition.HeroClass].CalculatePaintInfo(p);
                        if (RuleCalculators[p.HeroClassDefinition.HeroClass].PaintInfoList.Count != 0)
                        {
                            BuffPainter.PaintHorizontal(
                                RuleCalculators[p.HeroClassDefinition.HeroClass].PaintInfoList,
                                p.PortraitUiElement.Rectangle.Right,
                                p.PortraitUiElement.Rectangle.Top + p.PortraitUiElement.Rectangle.Height * PortraitOffset,
                                RuleCalculators[p.HeroClassDefinition.HeroClass].StandardIconSize,
                                0
                                );
                        }
                    }
                }

                if (Debug)
                {
                    DebugPrint(layer, p);
                }
            }
        }