Ejemplo n.º 1
0
        public void DrawAffixName(IMonster monster, DangerousAffixMonsterDefinition affix)
        {
            var   font = monster.Rarity == ActorRarity.RareMinion ? affix.MinionLabelFont : affix.EliteLabelFont;
            var   text = affix.AffixName ?? (affix.AffixName = affix.AffixNameFunc.Invoke(monster.AffixSnoList.First(snoa => snoa.Affix == affix.Affix)));
            var   layout = font.GetTextLayout(text);
            float mapX, mapY;

            Hud.Render.GetMinimapCoordinates(monster.FloorCoordinate.X, monster.FloorCoordinate.Y, out mapX, out mapY);

            font.DrawText(layout, mapX - layout.Metrics.Width / 2, mapY);
        }
Ejemplo n.º 2
0
        public DangerousAffixMonsterDefinition DefineDangerousAffix(MonsterAffix affix, AffixNameFunc affixNameFunc, int priority = 0,
                                                                    IFont eliteFont     = null, IFont minionFont = null, bool showMinionDecorators = false, bool showMinionAffixesNames = false,
                                                                    float bgEliteRadius = _bgEliteRadius, float fgEliteRadius = _fgEliteRadius, float bgMinionRadius = _bgMinionRadius, float fgMinionRadius = _fgMinionRadius,
                                                                    IBrush bgBrush      = null, IShapePainter bgShapePainter  = null, bool bgPing = false, IRadiusTransformator bgRadiusTransformator = null,
                                                                    IBrush fgBrush      = null, IShapePainter fgShapePainter  = null, bool fgPing = false, IRadiusTransformator fgRadiusTransformator = null)
        {
            bgBrush        = bgBrush ?? DefaultBackgroundBrush;
            fgBrush        = fgBrush ?? DefaultForegroundBrush;
            bgShapePainter = bgShapePainter ?? DefaultMapShapePainter;
            fgShapePainter = fgShapePainter ?? DefaultMapShapePainter;
            eliteFont      = eliteFont ?? DefaultEliteAffixesFont;
            minionFont     = minionFont ?? DefaultMinionAffixesFont;

            if (bgPing)
            {
                bgRadiusTransformator = bgRadiusTransformator ?? DefaultRadiusTransformator;
            }
            else
            {
                bgRadiusTransformator = null;
            }

            if (fgPing)
            {
                fgRadiusTransformator = fgRadiusTransformator ?? DefaultRadiusTransformator;
            }
            else
            {
                fgRadiusTransformator = null;
            }

            var affixDef = new DangerousAffixMonsterDefinition(affix)
            {
                EliteDecorators        = CreateDecorators(bgEliteRadius, fgEliteRadius, bgBrush, fgBrush, bgShapePainter, fgShapePainter, bgRadiusTransformator, fgRadiusTransformator),
                MinionDecorators       = CreateDecorators(bgMinionRadius, fgMinionRadius, bgBrush, fgBrush, bgShapePainter, fgShapePainter, bgRadiusTransformator, fgRadiusTransformator),
                EliteLabelFont         = eliteFont,
                MinionLabelFont        = minionFont,
                ShowMinionDecorators   = showMinionDecorators,
                ShowMinionAffixesNames = showMinionAffixesNames,
                AffixNameFunc          = affixNameFunc,
                Priority = priority,
            };

            affixDef.MinionDecorators.ToggleDecorators <MapShapeDecorator>(showMinionDecorators);
            affixDef.MinionDecorators.ToggleDecorators <MapLabelDecorator>(showMinionAffixesNames);

            Affixes[affix] = affixDef;
            return(affixDef);
        }