public string TimeToParagonLevel(uint paragonLevel, bool includetext)
        {
            var tracker = Hud.Game.CurrentHeroToday;

            if (tracker != null)
            {
                if (paragonLevel > Hud.Game.Me.CurrentLevelParagon)
                {
                    var text = includetext ? (paragonLevel.ToString("D", CultureInfo.InvariantCulture) + "级") + ": " : "";
                    var xph  = tracker.GainedExperiencePerHourPlay;
                    if (xph > 0)
                    {
                        var xpRequired  = Hud.Sno.TotalParagonExperienceRequired(paragonLevel);
                        var xpRemaining = xpRequired - Hud.Game.Me.ParagonTotalExp;
                        var hours       = xpRemaining / xph;
                        var ticks       = Convert.ToInt64(Math.Ceiling(hours * 60.0d * 60.0d * 1000.0d * TimeSpan.TicksPerMillisecond));
                        text += GLQ_BasePluginCN.ValueToString(ticks, ValueFormat.LongTimeNoSeconds);
                    }
                    else
                    {
                        text += "-";
                    }
                    return(text);
                }
            }
            return(null);
        }
Exemple #2
0
        public void PaintTopInGame(ClipState clipState)
        {
            if (clipState != ClipState.AfterClip)
            {
                return;
            }
            if (!_IsStoryMode)
            {
                return;
            }
            var TotaltextLayout = "总耗时 :" + GLQ_BasePluginCN.ValueToString((long)TotalTimeWatch.ElapsedMilliseconds * 10000, ValueFormat.LongTime);
            var A1textLayout    = "A1耗时:" + GLQ_BasePluginCN.ValueToString((long)A1TimeWatch.ElapsedMilliseconds * 10000, ValueFormat.LongTime);
            var A2textLayout    = "A2耗时:" + GLQ_BasePluginCN.ValueToString((long)A2TimeWatch.ElapsedMilliseconds * 10000, ValueFormat.LongTime);
            var A3textLayout    = "A3耗时:" + GLQ_BasePluginCN.ValueToString((long)A3TimeWatch.ElapsedMilliseconds * 10000, ValueFormat.LongTime);
            var A4textLayout    = "A4耗时:" + GLQ_BasePluginCN.ValueToString((long)A4TimeWatch.ElapsedMilliseconds * 10000, ValueFormat.LongTime);
            var A5textLayout    = "A5耗时:" + GLQ_BasePluginCN.ValueToString((long)A5TimeWatch.ElapsedMilliseconds * 10000, ValueFormat.LongTime);
            var x = Hud.Window.Size.Width / 1.18f;
            var y = Hud.Window.Size.Height / 1.15f;
            var h = Hud.Window.Size.Height * 0.018f;

            TotalTimerFont.DrawText(TotaltextLayout, x, y);
            A1TimerFont.DrawText(A1textLayout, x, y + h);
            A2TimerFont.DrawText(A2textLayout, x, y + h * 2);
            A3TimerFont.DrawText(A3textLayout, x, y + h * 3);
            A4TimerFont.DrawText(A4textLayout, x, y + h * 4);
            A5TimerFont.DrawText(A5textLayout, x, y + h * 5);
        }
 public string ExpToParagonLevel(uint paragonLevel)
 {
     if (paragonLevel > Hud.Game.Me.CurrentLevelParagon)
     {
         var xpRequired  = Hud.Sno.TotalParagonExperienceRequired(paragonLevel);
         var xpRemaining = xpRequired - Hud.Game.Me.ParagonTotalExp;
         return(GLQ_BasePluginCN.ValueToString(xpRemaining, ValueFormat.LongNumber));
     }
     return(null);
 }
Exemple #4
0
        public override void Load(IController hud)
        {
            base.Load(hud);

            BlueThisLevelValueDecorator = new TopLabelDecorator(Hud)
            {
                TextFont = Hud.Render.CreateFont("tahoma", 5.5f, 255, 140, 140, 180, false, false, 160, 0, 0, 0, true),
                TextFunc = () => GLQ_BasePluginCN.ValueToString(Hud.Game.Me.ParagonExpInThisLevel, ValueFormat.LongNumber),
                HintFunc = () => "当前经验",
            };

            OrangeThisLevelValueDecorator = new TopLabelDecorator(Hud)
            {
                TextFont = Hud.Render.CreateFont("tahoma", 5.5f, 255, 200, 160, 140, false, false, 160, 0, 0, 0, true),
                TextFunc = () => GLQ_BasePluginCN.ValueToString(Hud.Game.Me.ParagonExpInThisLevel, ValueFormat.LongNumber),
                HintFunc = () => "当前经验",
            };

            BlueNextLevelValueDecorator = new TopLabelDecorator(Hud)
            {
                TextFont = Hud.Render.CreateFont("tahoma", 5.5f, 255, 140, 140, 180, false, false, 160, 0, 0, 0, true),
                TextFunc = () => GLQ_BasePluginCN.ValueToString(Hud.Game.Me.ParagonExpToNextLevel, ValueFormat.LongNumber),
                HintFunc = () => "升到下一级所需经验",
            };

            OrangeNextLevelValueDecorator = new TopLabelDecorator(Hud)
            {
                TextFont = Hud.Render.CreateFont("tahoma", 5.5f, 255, 200, 160, 140, false, false, 160, 0, 0, 0, true),
                TextFunc = () => GLQ_BasePluginCN.ValueToString(Hud.Game.Me.ParagonExpToNextLevel, ValueFormat.LongNumber),
                HintFunc = () => "升到下一级所需经验",
            };
            BlueExpPercentValueDecorator = new TopLabelDecorator(Hud)
            {
                TextFont = Hud.Render.CreateFont("tahoma", 5.5f, 255, 140, 140, 180, false, false, 160, 0, 0, 0, true),
                TextFunc = () => GLQ_BasePluginCN.ValueToString(Hud.Game.Me.ParagonExpInThisLevel, ValueFormat.LongNumber),
                HintFunc = () => "当前经验百分比",
            };

            OrangeExpPercentValueDecorator = new TopLabelDecorator(Hud)
            {
                TextFont = Hud.Render.CreateFont("tahoma", 5.5f, 255, 200, 160, 140, false, false, 160, 0, 0, 0, true),
                TextFunc = () => GLQ_BasePluginCN.ValueToString(Hud.Game.Me.ParagonExpInThisLevel, ValueFormat.LongNumber),
                HintFunc = () => "当前经验百分比",
            };

            BonusValueDecorator = new TopLabelDecorator(Hud)
            {
                TextFont = Hud.Render.CreateFont("tahoma", 5.5f, 255, 200, 160, 140, false, false, 160, 0, 0, 0, true),
                TextFunc = () => (10 * ((float)Hud.Game.Me.BonusPoolRemaining / Hud.Game.Me.ParagonExpToNextLevel)).ToString("f2") + "个池 " + GLQ_BasePluginCN.ValueToString(Hud.Game.Me.BonusPoolRemaining * 5, ValueFormat.LongNumber),
                HintFunc = () => "经验池数量及消耗剩余经验池所需经验",
            };
        }
        public override void Load(IController hud)
        {
            base.Load(hud);

            MonsterHpDecreaseDecorator = new TopLabelDecorator(Hud)
            {
                BackgroundTexture1        = Hud.Texture.BackgroundTextureOrange,
                BackgroundTextureOpacity1 = 1.0f,
                TextFont = Hud.Render.CreateFont("tahoma", 6, 255, 200, 180, 100, true, false, 255, 0, 0, 0, true),
                TextFunc = () => GLQ_BasePluginCN.ValueToString(Hud.Stat.MonsterHitpointDecreasePerfCounter.LastValue, ValueFormat.LongNumber),
                HintFunc = () => "队伍每秒伤害",
            };
        }
Exemple #6
0
        private string GetCellText(int line, int column)
        {
            var player = Hud.Game.Players.FirstOrDefault(p => p.PortraitIndex == line);

            if (player == null)
            {
                return(string.Empty);
            }

            switch (column)
            {
            case 0:
                return(player.BattleTagAbovePortrait);

            case 1:
                return(GLQ_BasePluginCN.ValueToString((long)player.Defense.EhpCur, ValueFormat.LongNumber));

            case 2:
                return(GLQ_BasePluginCN.ValueToString((long)player.Offense.SheetDps, ValueFormat.LongNumber));

            case 3:
                return(player.Stats.MainStat.ToString());

            case 4:
                return(player.Offense.AttackSpeedPets.ToString("F2", CultureInfo.InvariantCulture) + "/秒");

            case 5:
                return(player.Offense.CriticalHitChance.ToString("F2", CultureInfo.InvariantCulture) + "%");

            case 6:
                return(player.Offense.CritDamage.ToString("F2", CultureInfo.InvariantCulture) + "%");

            case 7:
                return((player.Stats.CooldownReduction * 100).ToString("F1", CultureInfo.InvariantCulture) + "%");

            case 8:
                return((player.Stats.ResourceCostReduction * 100).ToString("F1", CultureInfo.InvariantCulture) + "%");

            case 9:
                return(player.Offense.AreaDamageBonus.ToString() + "%");

            case 10:
                return(player.HighestSoloRiftLevel.ToString() + "层");

            case 11:
                return(player.Defense.GlobeBonusHealth.ToString());

            default:
                return(string.Empty);
            }
        }
        public void PaintTopInGame(ClipState clipState)
        {
            if (Hud.Game.SpecialArea != SpecialArea.GreaterRift)
            {
                return;
            }
            if (clipState != ClipState.BeforeClip)
            {
                return;
            }

            var ui = Hud.Render.GreaterRiftBarUiElement;

            if (!ui.Visible)
            {
                return;
            }

            var secondsLeft = (Hud.Game.CurrentTimedEventEndTick - (double)Hud.Game.CurrentGameTick) / 60.0d;
            var percent     = Hud.Game.RiftPercentage;

            if (!(secondsLeft > 0))
            {
                return;
            }

            string text;
            var    _x       = 9000000000 / ui.Rectangle.Width;
            var    currentX = ui.Rectangle.Left + ui.Rectangle.Width / 100.0f * percent;
            var    timeX    = ui.Rectangle.Right - (float)(ui.Rectangle.Width / 900.0f * secondsLeft);
            var    _time    = (currentX - timeX) * _x;

            if (_time <= 0)
            {
                text        = "落后" + GLQ_BasePluginCN.ValueToString((long)_time, ValueFormat.LongTime);
                currentFont = MalusTimeFont;
            }
            else
            {
                text        = "领先" + GLQ_BasePluginCN.ValueToString((long)_time, ValueFormat.LongTime);
                currentFont = BonusTimeFont;
            }

            var textLayout = currentFont.GetTextLayout(text);
            var x          = (float)currentX - textLayout.Metrics.Width / 2;
            var y          = ui.Rectangle.Top - ui.Rectangle.Height * 0.1f - textLayout.Metrics.Height;

            currentFont.DrawText(textLayout, x, y);
        }
Exemple #8
0
        public void PaintTopInGame(ClipState clipState)
        {
            if (clipState != ClipState.BeforeClip)
            {
                return;
            }

            var uiBar = Hud.Render.MonsterHpBarUiElement;

            var monster = Hud.Game.SelectedMonster2 ?? Hud.Game.SelectedMonster1;

            if ((monster == null) || (uiBar == null))
            {
                return;
            }
            var hpText = GLQ_BasePluginCN.ValueToString(monster.CurHealth, ValueFormat.LongNumber) + " / " + GLQ_BasePluginCN.ValueToString(monster.MaxHealth, ValueFormat.LongNumber);

            hpText += " - " + GLQ_BasePluginCN.ValueToString(monster.CurHealth / (monster.MaxHealth / 100.0f), ValueFormat.LongNumber) + "%";

            var textLayout = MonsterHitpointsFont.GetTextLayout(hpText);

            MonsterHitpointsFont.DrawText(textLayout, uiBar.Rectangle.Left + (uiBar.Rectangle.Width - textLayout.Metrics.Width) / 2, uiBar.Rectangle.Top + (uiBar.Rectangle.Height - textLayout.Metrics.Height) / 2);

            string textCC = null;

            if (monster.Frozen)
            {
                textCC += (textCC == null ? "" : ", ") + "冰冻";
            }
            if (monster.Chilled)
            {
                textCC += (textCC == null ? "" : ", ") + "寒冷";
            }
            if (monster.Slow)
            {
                textCC += (textCC == null ? "" : ", ") + "减速";
            }
            if (monster.Stunned)
            {
                textCC += (textCC == null ? "" : ", ") + "昏迷";
            }
            if (monster.Invulnerable)
            {
                BorderBrush.DrawRectangle(uiBar.Rectangle.Left, uiBar.Rectangle.Top, uiBar.Rectangle.Width, uiBar.Rectangle.Height);
                textCC += (textCC == null ? "" : ", ") + "无敌";
            }

            if (monster.Blind)
            {
                textCC += (textCC == null ? "" : ", ") + "致盲";
            }

            string textDebuff = null;

            if (monster.Locust)
            {
                textDebuff += (textDebuff == null ? "" : ", ") + "虫群";
            }
            if (monster.Palmed)
            {
                textDebuff += (textDebuff == null ? "" : ", ") + "爆裂掌";
            }
            if (monster.Haunted)
            {
                textDebuff += (textDebuff == null ? "" : ", ") + "蚀魂";
            }
            if (monster.MarkedForDeath)
            {
                textDebuff += (textDebuff == null ? "" : ", ") + "标记";
            }
            if (monster.Strongarmed)
            {
                textDebuff += (textDebuff == null ? "" : ", ") + "力士";
            }
            if (monster.Phoenixed)
            {
                textDebuff += (textDebuff == null ? "" : ", ") + "火鸟";
            }
            if (isKrysbin(monster))
            {
                textDebuff += (textDebuff == null ? "" : ", ") + "克利斯宾";
            }
            var text = textCC + (textCC != null && textDebuff != null ? " | " : "") + textDebuff;

            if (monster.DotDpsApplied > 0)
            {
                text += (string.IsNullOrEmpty(text) ? "" : " | ") + "DOT: " + GLQ_BasePluginCN.ValueToString(monster.DotDpsApplied, ValueFormat.LongNumber);
            }
            if (text != null)
            {
                textLayout = MonsterEffectsFont.GetTextLayout(text);
                MonsterEffectsFont.DrawText(textLayout, uiBar.Rectangle.Left + (uiBar.Rectangle.Width - textLayout.Metrics.Width) / 2, uiBar.Rectangle.Top - (uiBar.Rectangle.Height * 0.38f) - textLayout.Metrics.Height);
            }
            if (monster.SummonerAcdDynamicId != 0 && monster.IsElite)
            {
                LineBrush.DrawLine(uiBar.Rectangle.Left, uiBar.Rectangle.Top - uiBar.Rectangle.Height * 1.5f, uiBar.Rectangle.Right, uiBar.Rectangle.Top + uiBar.Rectangle.Height + uiBar.Rectangle.Height * 1.5f, 0);
                LineBrush.DrawLine(uiBar.Rectangle.Left, uiBar.Rectangle.Top + uiBar.Rectangle.Height + uiBar.Rectangle.Height * 1.5f, uiBar.Rectangle.Right, uiBar.Rectangle.Top - uiBar.Rectangle.Height * 1.5f, 0);
            }
        }
        public override void Load(IController hud)
        {
            base.Load(hud);

            var expandedHintFont = Hud.Render.CreateFont("tahoma", 7, 255, 200, 200, 200, false, false, true);

            LabelList = new HorizontalTopLabelList(hud);

            LabelList.LeftFunc = () =>
            {
                var ui = Hud.Render.GetUiElement("Root.NormalLayer.game_dialog_backgroundScreenPC.game_window_hud_overlay");
                return(ui.Rectangle.Left + ui.Rectangle.Width * 0.267f);
            };
            LabelList.TopFunc = () =>
            {
                var ui = Hud.Render.GetUiElement("Root.NormalLayer.game_dialog_backgroundScreenPC.game_window_hud_overlay");
                return(ui.Rectangle.Top + ui.Rectangle.Height * 0.318f);
            };
            LabelList.WidthFunc = () =>
            {
                var ui = Hud.Render.GetUiElement("Root.NormalLayer.game_dialog_backgroundScreenPC.game_window_hud_overlay");
                return(Hud.Window.Size.Height * 0.07f);
            };
            LabelList.HeightFunc = () =>
            {
                var ui = Hud.Render.GetUiElement("Root.NormalLayer.game_dialog_backgroundScreenPC.game_window_hud_overlay");
                return(Hud.Window.Size.Height * 0.025f);
            };

            LabelList.LabelDecorators.Add(new TopLabelDecorator(Hud)
            {
                TextFont                  = Hud.Render.CreateFont("tahoma", 7, 180, 255, 255, 255, true, false, true),
                ExpandedHintFont          = expandedHintFont,
                BackgroundTexture1        = Hud.Texture.ButtonTextureGray,
                BackgroundTexture2        = Hud.Texture.BackgroundTextureGreen,
                BackgroundTextureOpacity2 = 0.70f,
                TextFunc                  = () => GLQ_BasePluginCN.ValueToString(Hud.Game.Me.Defense.EhpMax, ValueFormat.ShortNumber),
                HintFunc                  = () => "最大坚韧",
                ExpandUpLabels            = new List <TopLabelDecorator>()
                {
                    new TopLabelDecorator(Hud)
                    {
                        TextFont                  = Hud.Render.CreateFont("tahoma", 7, 180, 255, 255, 255, true, false, true),
                        ExpandedHintFont          = expandedHintFont,
                        BackgroundTexture1        = Hud.Texture.ButtonTextureGray,
                        BackgroundTexture2        = Hud.Texture.BackgroundTextureGreen,
                        BackgroundTextureOpacity2 = 1.0f,
                        TextFunc                  = () => (Hud.Game.Me.Defense.drCombined * 100).ToString("F1", CultureInfo.InvariantCulture) + "%",
                        HintFunc                  = () => "总减免",
                    },
                    new TopLabelDecorator(Hud)
                    {
                        TextFont                  = Hud.Render.CreateFont("tahoma", 7, 180, 255, 255, 255, true, false, true),
                        ExpandedHintFont          = expandedHintFont,
                        BackgroundTexture1        = Hud.Texture.ButtonTextureGray,
                        BackgroundTexture2        = Hud.Texture.BackgroundTextureGreen,
                        BackgroundTextureOpacity2 = 1.0f,
                        TextFunc                  = () => (Hud.Game.Me.Defense.drArmor * 100).ToString("F1", CultureInfo.InvariantCulture) + "%",
                        HintFunc                  = () => "护甲减伤",
                    },
                    new TopLabelDecorator(Hud)
                    {
                        TextFont                  = Hud.Render.CreateFont("tahoma", 7, 180, 255, 255, 255, true, false, true),
                        ExpandedHintFont          = expandedHintFont,
                        BackgroundTexture1        = Hud.Texture.ButtonTextureGray,
                        BackgroundTexture2        = Hud.Texture.BackgroundTextureGreen,
                        BackgroundTextureOpacity2 = 1.0f,
                        TextFunc                  = () => Hud.Game.Me.Defense.Armor.ToString("#,0", CultureInfo.InvariantCulture),
                        HintFunc                  = () => "护甲",
                    },
                    new TopLabelDecorator(Hud)
                    {
                        TextFont                  = Hud.Render.CreateFont("tahoma", 7, 180, 255, 255, 255, true, false, true),
                        ExpandedHintFont          = expandedHintFont,
                        BackgroundTexture1        = Hud.Texture.ButtonTextureGray,
                        BackgroundTexture2        = Hud.Texture.BackgroundTextureGreen,
                        BackgroundTextureOpacity2 = 1.0f,
                        TextFunc                  = () => (Hud.Game.Me.Defense.drResist * 100).ToString("F1", CultureInfo.InvariantCulture) + "%",
                        HintFunc                  = () => "抗性减伤",
                    },
                    new TopLabelDecorator(Hud)
                    {
                        TextFont                  = Hud.Render.CreateFont("tahoma", 7, 180, 255, 255, 255, true, false, true),
                        ExpandedHintFont          = expandedHintFont,
                        BackgroundTexture1        = Hud.Texture.ButtonTextureGray,
                        BackgroundTexture2        = Hud.Texture.BackgroundTextureGreen,
                        BackgroundTextureOpacity2 = 1.0f,
                        TextFunc                  = () => Hud.Game.Me.Defense.ResAverage.ToString("#,0", CultureInfo.InvariantCulture),
                        HintFunc                  = () => "平均抗性",
                    },
                    new TopLabelDecorator(Hud)
                    {
                        TextFont                  = Hud.Render.CreateFont("tahoma", 7, 180, 255, 255, 255, true, false, true),
                        ExpandedHintFont          = expandedHintFont,
                        BackgroundTexture1        = Hud.Texture.ButtonTextureGray,
                        BackgroundTexture2        = Hud.Texture.BackgroundTextureGreen,
                        BackgroundTextureOpacity2 = 1.0f,
                        TextFunc                  = () => (Hud.Game.Me.Defense.DRElite * 100).ToString("F0", CultureInfo.InvariantCulture) + "%",
                        HintFunc                  = () => "精英减伤",
                    },
                    new TopLabelDecorator(Hud)
                    {
                        TextFont                  = Hud.Render.CreateFont("tahoma", 7, 180, 255, 255, 255, true, false, true),
                        ExpandedHintFont          = expandedHintFont,
                        BackgroundTexture1        = Hud.Texture.ButtonTextureGray,
                        BackgroundTexture2        = Hud.Texture.BackgroundTextureGreen,
                        BackgroundTextureOpacity2 = 1.0f,
                        TextFunc                  = () => (Hud.Game.Me.Defense.DRMelee * 100).ToString("F0", CultureInfo.InvariantCulture) + "%",
                        HintFunc                  = () => "近战减伤",
                    },
                    new TopLabelDecorator(Hud)
                    {
                        TextFont                  = Hud.Render.CreateFont("tahoma", 7, 180, 255, 255, 255, true, false, true),
                        ExpandedHintFont          = expandedHintFont,
                        BackgroundTexture1        = Hud.Texture.ButtonTextureGray,
                        BackgroundTexture2        = Hud.Texture.BackgroundTextureGreen,
                        BackgroundTextureOpacity2 = 1.0f,
                        TextFunc                  = () => (Hud.Game.Me.Defense.DRRanged * 100).ToString("F0", CultureInfo.InvariantCulture) + "%",
                        HintFunc                  = () => "远程减伤",
                    }
                }
            });

            LabelList.LabelDecorators.Add(new TopLabelDecorator(Hud)
            {
                TextFont                  = Hud.Render.CreateFont("tahoma", 7, 180, 255, 255, 255, true, false, true),
                ExpandedHintFont          = expandedHintFont,
                BackgroundTexture1        = Hud.Texture.ButtonTextureOrange,
                BackgroundTexture2        = Hud.Texture.BackgroundTextureOrange,
                BackgroundTextureOpacity2 = 0.5f,
                TextFunc                  = () => GLQ_BasePluginCN.ValueToString(Hud.Game.Me.Offense.SheetDps, ValueFormat.ShortNumber),
                HintFunc                  = () => "面板伤害",
                ExpandUpLabels            = new List <TopLabelDecorator>()
                {
                    new TopLabelDecorator(Hud)
                    {
                        TextFont                  = Hud.Render.CreateFont("tahoma", 7, 180, 255, 255, 255, false, false, true),
                        ExpandedHintFont          = expandedHintFont,
                        BackgroundTexture1        = Hud.Texture.ButtonTextureOrange,
                        BackgroundTexture2        = Hud.Texture.BackgroundTextureYellow,
                        BackgroundTextureOpacity2 = 0.75f,
                        TextFunc                  = () => GLQ_BasePluginCN.ValueToString(Hud.Game.Me.Offense.MainHandIsActive ? Hud.Game.Me.Offense.WeaponDamageMainHand : Hud.Game.Me.Offense.WeaponDamageSecondHand, ValueFormat.ShortNumber),
                        HintFunc                  = () => "武器伤害",
                    },
                    new TopLabelDecorator(Hud)
                    {
                        TextFont                  = Hud.Render.CreateFont("tahoma", 7, 180, 255, 255, 255, false, false, true),
                        ExpandedHintFont          = expandedHintFont,
                        BackgroundTexture1        = Hud.Texture.ButtonTextureOrange,
                        BackgroundTexture2        = Hud.Texture.BackgroundTextureYellow,
                        BackgroundTextureOpacity2 = 0.75f,
                        TextFunc                  = () => Hud.Game.Me.Offense.AttackSpeedPets.ToString("F2", CultureInfo.InvariantCulture) + "/秒",
                        HintFunc                  = () => "宠物攻速",
                    },
                    new TopLabelDecorator(Hud)
                    {
                        TextFont                  = Hud.Render.CreateFont("tahoma", 7, 180, 255, 255, 255, false, false, true),
                        ExpandedHintFont          = expandedHintFont,
                        BackgroundTexture1        = Hud.Texture.ButtonTextureOrange,
                        BackgroundTexture2        = Hud.Texture.BackgroundTextureYellow,
                        BackgroundTextureOpacity2 = 0.75f,
                        TextFunc                  = () => Hud.Game.Me.Offense.AttackSpeed.ToString("F2", CultureInfo.InvariantCulture) + "/秒",
                        HintFunc                  = () => "攻击速度",
                    },
                    new TopLabelDecorator(Hud)
                    {
                        TextFont                  = Hud.Render.CreateFont("tahoma", 7, 180, 255, 255, 255, false, false, true),
                        ExpandedHintFont          = expandedHintFont,
                        BackgroundTexture1        = Hud.Texture.ButtonTextureOrange,
                        BackgroundTexture2        = Hud.Texture.BackgroundTextureYellow,
                        BackgroundTextureOpacity2 = 0.75f,
                        TextFunc                  = () => Hud.Game.Me.Offense.CriticalHitChance.ToString("F1", CultureInfo.InvariantCulture) + "%",
                        HintFunc                  = () => "暴击几率",
                    },
                    new TopLabelDecorator(Hud)
                    {
                        TextFont                  = Hud.Render.CreateFont("tahoma", 7, 180, 255, 255, 255, false, false, true),
                        ExpandedHintFont          = expandedHintFont,
                        BackgroundTexture1        = Hud.Texture.ButtonTextureOrange,
                        BackgroundTexture2        = Hud.Texture.BackgroundTextureYellow,
                        BackgroundTextureOpacity2 = 0.75f,
                        TextFunc                  = () => Hud.Game.Me.Offense.CritDamage.ToString("F0", CultureInfo.InvariantCulture) + "%",
                        HintFunc                  = () => "爆击伤害",
                    },
                    new TopLabelDecorator(Hud)
                    {
                        TextFont                  = Hud.Render.CreateFont("tahoma", 7, 180, 255, 255, 255, false, false, true),
                        ExpandedHintFont          = expandedHintFont,
                        BackgroundTexture1        = Hud.Texture.ButtonTextureOrange,
                        BackgroundTexture2        = Hud.Texture.BackgroundTextureYellow,
                        BackgroundTextureOpacity2 = 0.75f,
                        TextFunc                  = () => (Hud.Game.Me.Offense.BonusToElites * 100).ToString("F0", CultureInfo.InvariantCulture) + "%",
                        HintFunc                  = () => "精英伤害",
                    },
                    new TopLabelDecorator(Hud)
                    {
                        TextFont                  = Hud.Render.CreateFont("tahoma", 7, 180, 255, 255, 255, false, false, true),
                        ExpandedHintFont          = expandedHintFont,
                        BackgroundTexture1        = Hud.Texture.ButtonTextureOrange,
                        BackgroundTexture2        = Hud.Texture.BackgroundTextureYellow,
                        BackgroundTextureOpacity2 = 0.75f,
                        TextFunc                  = () => (Hud.Game.Me.Offense.HighestElementalDamageBonus * 100).ToString("F0", CultureInfo.InvariantCulture) + "%",
                        HintFunc                  = () => "最高元素",
                    }
                }
            });

            LabelList.LabelDecorators.Add(new TopLabelDecorator(Hud)
            {
                TextFont                  = Hud.Render.CreateFont("tahoma", 7, 120, 255, 255, 255, false, false, true),
                BackgroundTexture1        = Hud.Texture.ButtonTextureOrange,
                BackgroundTexture2        = Hud.Texture.BackgroundTextureOrange,
                BackgroundTextureOpacity2 = 0.5f,
                TextFunc                  = () => Hud.Game.Me.Offense.AttackSpeedPets.ToString("F2", CultureInfo.InvariantCulture) + "/秒",
                HintFunc                  = () => "宠物攻击速度",
            });

            LabelList.LabelDecorators.Add(new TopLabelDecorator(Hud)
            {
                TextFont                  = Hud.Render.CreateFont("tahoma", 7, 200, 128, 255, 255, true, false, true),
                BackgroundTexture1        = Hud.Texture.BuffFrameTexture,
                BackgroundTexture2        = Hud.Texture.Button2TextureGray,
                BackgroundTextureOpacity2 = 1f,
                TextFunc                  = () => GLQ_BasePluginCN.ValueToString(Hud.Game.Me.Damage.CurrentDps, ValueFormat.LongNumber),
                HintFunc                  = () => "当前秒伤",
            });

            LabelList.LabelDecorators.Add(new TopLabelDecorator(Hud)
            {
                TextFont                  = Hud.Render.CreateFont("tahoma", 7, 200, 255, 255, 255, true, false, true),
                BackgroundTexture1        = Hud.Texture.BuffFrameTexture,
                BackgroundTexture2        = Hud.Texture.Button2TextureBrown,
                BackgroundTextureOpacity2 = 1f,
                TextFunc                  = () => GLQ_BasePluginCN.ValueToString(Hud.Game.Me.Damage.RunDps, ValueFormat.LongNumber),
                HintFunc                  = () => "平均秒伤",
            });

            LabelList.LabelDecorators.Add(new TopLabelDecorator(Hud)
            {
                TextFont                  = Hud.Render.CreateFont("tahoma", 7, 200, 255, 255, 128, true, false, true),
                BackgroundTexture1        = Hud.Texture.BuffFrameTexture,
                BackgroundTexture2        = Hud.Texture.Button2TextureGray,
                BackgroundTextureOpacity2 = 1f,
                TextFunc                  = () => GLQ_BasePluginCN.ValueToString(Hud.Game.Me.Damage.TotalDamage, ValueFormat.LongNumber),
                HintFunc                  = () => "总伤害",
            });


            LabelList.LabelDecorators.Add(new TopLabelDecorator(Hud)
            {
                TextFont                  = Hud.Render.CreateFont("tahoma", 7, 180, 255, 255, 255, true, false, true),
                ExpandedHintFont          = expandedHintFont,
                BackgroundTexture1        = Hud.Texture.ButtonTextureBlue,
                BackgroundTexture2        = Hud.Texture.BackgroundTextureBlue,
                BackgroundTextureOpacity2 = 0.5f,
                TextFunc                  = () => (Hud.Game.Me.Stats.CooldownReduction * 100).ToString("F0", CultureInfo.InvariantCulture) + "%",
                HintFunc                  = () => "冷却时间效果缩短%",
                ExpandUpLabels            = new List <TopLabelDecorator>()
                {
                    new TopLabelDecorator(Hud)
                    {
                        TextFont                  = Hud.Render.CreateFont("tahoma", 7, 180, 255, 255, 255, false, false, true),
                        ExpandedHintFont          = expandedHintFont,
                        BackgroundTexture1        = Hud.Texture.ButtonTextureBlue,
                        BackgroundTexture2        = Hud.Texture.BackgroundTextureBlue,
                        BackgroundTextureOpacity2 = 0.75f,
                        TextFunc                  = () => (Hud.Game.Me.Stats.ResourceCostReduction * 100).ToString("F0", CultureInfo.InvariantCulture) + "%",
                        HintFunc                  = () => "能耗降低",
                    },
                    new TopLabelDecorator(Hud)
                    {
                        TextFont                  = Hud.Render.CreateFont("tahoma", 7, 180, 255, 255, 255, false, false, true),
                        ExpandedHintFont          = expandedHintFont,
                        BackgroundTexture1        = Hud.Texture.ButtonTextureBlue,
                        BackgroundTexture2        = Hud.Texture.BackgroundTextureBlue,
                        BackgroundTextureOpacity2 = 0.75f,
                        TextFunc                  = () => Hud.Game.Me.Defense.LifeRegen.ToString("F0", CultureInfo.InvariantCulture) + "/秒",
                        HintFunc                  = () => "每秒恢复",
                    },
                    new TopLabelDecorator(Hud)
                    {
                        TextFont                  = Hud.Render.CreateFont("tahoma", 7, 180, 255, 255, 255, false, false, true),
                        ExpandedHintFont          = expandedHintFont,
                        BackgroundTexture1        = Hud.Texture.ButtonTextureBlue,
                        BackgroundTexture2        = Hud.Texture.BackgroundTextureBlue,
                        BackgroundTextureOpacity2 = 0.75f,
                        TextFunc                  = () => Hud.Game.Me.Stats.MoveSpeed.ToString("F0", CultureInfo.InvariantCulture) + "%",
                        HintFunc                  = () => "移动速度",
                    },
                    new TopLabelDecorator(Hud)
                    {
                        TextFont                  = Hud.Render.CreateFont("tahoma", 7, 180, 255, 255, 255, false, false, true),
                        ExpandedHintFont          = expandedHintFont,
                        BackgroundTexture1        = Hud.Texture.ButtonTextureBlue,
                        BackgroundTexture2        = Hud.Texture.BackgroundTextureBlue,
                        BackgroundTextureOpacity2 = 0.75f,
                        TextFunc                  = () => Hud.Game.Me.Offense.AreaDamageBonus.ToString("F0", CultureInfo.InvariantCulture) + "%",
                        HintFunc                  = () => "范围伤害",
                    },
                    new TopLabelDecorator(Hud)
                    {
                        TextFont                  = Hud.Render.CreateFont("tahoma", 7, 180, 255, 255, 255, false, false, true),
                        ExpandedHintFont          = expandedHintFont,
                        BackgroundTexture1        = Hud.Texture.ButtonTextureBlue,
                        BackgroundTexture2        = Hud.Texture.BackgroundTextureBlue,
                        BackgroundTextureOpacity2 = 0.75f,
                        TextFunc                  = () => (Hud.Game.Me.Stats.PickupRange - 5).ToString("F0", CultureInfo.InvariantCulture) + "码",
                        HintFunc                  = () => "拾取距离",
                    },
                    new TopLabelDecorator(Hud)
                    {
                        TextFont                  = Hud.Render.CreateFont("tahoma", 7, 180, 255, 255, 255, false, false, true),
                        ExpandedHintFont          = expandedHintFont,
                        BackgroundTexture1        = Hud.Texture.ButtonTextureBlue,
                        BackgroundTexture2        = Hud.Texture.BackgroundTextureBlue,
                        BackgroundTextureOpacity2 = 0.75f,
                        TextFunc                  = () => Hud.Game.Me.Stats.GoldFind.ToString("F0", CultureInfo.InvariantCulture) + "%",
                        HintFunc                  = () => "金币加成",
                    }
                }
            });

            LabelList.LabelDecorators.Add(new TopLabelDecorator(Hud)
            {
                TextFont                  = Hud.Render.CreateFont("tahoma", 7, 120, 255, 200, 200, false, false, true),
                BackgroundTexture1        = Hud.Texture.ButtonTextureBlue,
                BackgroundTexture2        = Hud.Texture.BackgroundTextureBlue,
                BackgroundTextureOpacity2 = 0.75f,
                TextFunc                  = () => (Hud.Game.Me.Stats.ResourceCostReduction * 100).ToString("F0", CultureInfo.InvariantCulture) + "%",
                HintFunc                  = () => "能量消耗降低%",
            });

            LabelList.LabelDecorators.Add(new TopLabelDecorator(Hud)
            {
                TextFont                  = Hud.Render.CreateFont("tahoma", 7, 120, 255, 200, 200, false, false, true),
                BackgroundTexture1        = Hud.Texture.ButtonTextureBlue,
                BackgroundTexture2        = Hud.Texture.BackgroundTextureBlue,
                BackgroundTextureOpacity2 = 0.75f,
                TextFunc                  = () => Hud.Game.Me.Stats.MoveSpeed.ToString("F0", CultureInfo.InvariantCulture) + "%",
                HintFunc                  = () => "移动速度",
            });
        }
Exemple #10
0
        public void Paint(IPlayerSkill skill, RectangleF rect)
        {
            if (skill == null)
            {
                return;
            }

            if (TextureOpacity > 0)
            {
                var texture = Hud.Texture.GetTexture(skill.SnoPower.NormalIconTextureId);
                if (texture != null)
                {
                    texture.Draw(rect.X, rect.Y, rect.Width, rect.Height, TextureOpacity);
                }
            }

            if (skill.IsOnCooldown && (skill.CooldownFinishTick > Hud.Game.CurrentGameTick))
            {
                var remaining = (skill.CooldownFinishTick - Hud.Game.CurrentGameTick) / 60.0d;
                var text      = remaining > 1.0f ? remaining.ToString("F0", CultureInfo.InvariantCulture) : remaining.ToString("F1", CultureInfo.InvariantCulture);

                var textLayout = CooldownFont.GetTextLayout(text);
                CooldownFont.DrawText(textLayout, rect.X + (rect.Width - (float)Math.Ceiling(textLayout.Metrics.Width)) / 2.0f, rect.Y + (rect.Height - textLayout.Metrics.Height) / 2);
            }

            if (!EnableSkillDpsBar || skill.SnoPower.ElementalDamageTypesByRune == null)
            {
                return;
            }

            var elite = Hud.Game.IsEliteOnScreen || Hud.Game.IsGoblinOnScreen;

            if (Hud.Game.IsInTown)
            {
                if (_lastTownEliteSimulation.TimerTest(3000))
                {
                    elite = true;
                    if (_lastTownEliteSimulation.TimerTest(6000))
                    {
                        _lastTownEliteSimulation.Restart();
                    }
                }
            }

            var rune = skill.Rune;

            if (rune == byte.MaxValue)
            {
                rune = 0;
            }
            else
            {
                rune += 1;
            }
            var elementalType = skill.ElementalType;

            if (elementalType == -1)
            {
                return;
            }

            var resourceCost           = skill.ResourceCost;
            var weaponDamageMultiplier = skill.WeaponDamageMultiplier;

            if (weaponDamageMultiplier != -1)
            {
                var dotSeconds = skill.DotSeconds;

                uint powerSno = skill.SnoPower.Sno;
                if (powerSno == 102573)
                {
                    powerSno = 109560;                     // summon zombie dogs fix
                }
                if (powerSno == 123208)
                {
                    powerSno = 362118;                     // mystic ally fix
                }
                var skillBonus     = 1 + skill.DamageBonus;
                var elementalBonus = 1 + skill.ElementalDamageBonus;
                var eliteBonus     = 1 + (elite ? Hud.Game.Me.Offense.BonusToElites : 0);

                var skillBonusTotal = skillBonus * elementalBonus * eliteBonus;

                double plainBonusTotal = 1;
                foreach (var bonus in Hud.Game.Me.Offense.PlainDamageBonuses)
                {
                    plainBonusTotal *= (1 + bonus.Item2);
                }

                var weaponDamage = Hud.Game.Me.Offense.MainHandIsActive ? Hud.Game.Me.Offense.WeaponDamageMainHand : Hud.Game.Me.Offense.WeaponDamageSecondHand;
                var attackSpeed  = Hud.Game.Me.Offense.MainHandIsActive ? Hud.Game.Me.Offense.AttackSpeedMainHand : Hud.Game.Me.Offense.AttackSpeedOffHand;

                var skillDamage = weaponDamage * (weaponDamageMultiplier / 100) * skillBonusTotal * plainBonusTotal;
                var skillDps    = skillDamage;
                if (dotSeconds > 0)
                {
                    skillDps /= dotSeconds;
                }
                else
                {
                    skillDps *= attackSpeed;
                }

                var textLayout = SkillDamageFont.GetTextLayout(GLQ_BasePluginCN.ValueToString(skillDamage, ValueFormat.LongNumber));
                SkillDamageFont.DrawText(textLayout, rect.Left, rect.Bottom - textLayout.Metrics.Height + 1);

                var rHeight = rect.Height * 0.33f;
                var rTop    = rect.Bottom + rHeight * 0.1f;

                SkillDpsBackgroundBrushesByElementalType[elementalType].DrawRectangle(rect.Left, rTop, rect.Width, rHeight);

                textLayout = SkillDpsFont.GetTextLayout(GLQ_BasePluginCN.ValueToString(skillDps, ValueFormat.LongNumber));
                SkillDpsFont.DrawText(textLayout, rect.Left + (rect.Width - textLayout.Metrics.Width) / 2, rTop + (rHeight - textLayout.Metrics.Height) / 2);

                if (skillBonusTotal > 1)
                {
                    var bonusFont = elite ? DamageBonusEliteFont : DamageBonusFont;
                    textLayout = bonusFont.GetTextLayout("+" + (skillBonusTotal * 100 - 100).ToString("F0") + "%");
                    bonusFont.DrawText(textLayout, rect.Left, rect.Top - 1);
                }

                if (EnableDetailedDpsHint && Hud.Window.CursorInsideRect(rect.Left, rect.Top, rect.Width, rect.Height))
                {
                    var plainBonusText = "";
                    var plainBonuses   = Hud.Game.Me.Offense.PlainDamageBonuses.ToList();
                    if (plainBonuses.Count > 0)
                    {
                        plainBonusText = "\nPLAIN BONUSES: +" + (plainBonusTotal * 100 - 100).ToString("F0", CultureInfo.InvariantCulture) + "%\n";
                        foreach (var bonus in plainBonuses)
                        {
                            plainBonusText += "\t" + (bonus.Item2 * 100).ToString("F0", CultureInfo.InvariantCulture) + "% " + bonus.Item1.Icons[0].TitleLocalized + "\n";
                        }
                    }

                    var hint =
                        "此伤害计算不包含装备及技能特效的独立加成因子" + "\n\n" +
                        "武器单次平均伤害(详细如下): " + GLQ_BasePluginCN.ValueToString(weaponDamage, ValueFormat.LongNumber) + " (" + (Hud.Game.Me.Offense.MainHandIsActive ? "左" : "右") + " 手)\n" +
                        (Hud.Game.Me.Offense.MainHandIsActive ?
                         "\t武器属性均伤: " + (Hud.Game.Me.Offense.WeaponBaseDamageMinAmainHand / 2 + Hud.Game.Me.Offense.WeaponBaseDamageMaxAmainHand / 2).ToString("F0", CultureInfo.InvariantCulture) + " (" + Hud.Game.Me.Offense.WeaponBaseDamageMinAmainHand.ToString("F0", CultureInfo.InvariantCulture) + "-" + Hud.Game.Me.Offense.WeaponBaseDamageMaxAmainHand.ToString("F0", CultureInfo.InvariantCulture) + ")\n" :
                         "\t武器属性均伤: " + (Hud.Game.Me.Offense.WeaponBaseDamageMinAoffHand / 2 + Hud.Game.Me.Offense.WeaponBaseDamageMaxAoffHand / 2).ToString("F0", CultureInfo.InvariantCulture) + " (" + Hud.Game.Me.Offense.WeaponBaseDamageMinAoffHand.ToString("F0", CultureInfo.InvariantCulture) + "-" + Hud.Game.Me.Offense.WeaponBaseDamageMaxAoffHand.ToString("F0", CultureInfo.InvariantCulture) + ")\n") +
                        (((Hud.Game.Me.Offense.DamageMin > 0) || (Hud.Game.Me.Offense.DamageMax > 0)) ?
                         ((Hud.Game.Me.Offense.DamageMin > 0) || (Hud.Game.Me.Offense.DamageMax > 0) ? "\t+ 其他伤害词缀(如副手戒指等): " + Hud.Game.Me.Offense.DamageMin.ToString("F0", CultureInfo.InvariantCulture) + "-" + Hud.Game.Me.Offense.DamageMax.ToString("F0", CultureInfo.InvariantCulture) + "\n" : "") +
                         (Hud.Game.Me.Offense.MainHandIsActive ?
                          "\t= 装备总均伤: " + (Hud.Game.Me.Offense.WeaponBaseDamageMinBmainHand / 2 + Hud.Game.Me.Offense.WeaponBaseDamageMaxBmainHand / 2).ToString("F0", CultureInfo.InvariantCulture) + " (" + Hud.Game.Me.Offense.WeaponBaseDamageMinBmainHand.ToString("F0", CultureInfo.InvariantCulture) + "-" + Hud.Game.Me.Offense.WeaponBaseDamageMaxBmainHand.ToString("F0", CultureInfo.InvariantCulture) + ")\n" :
                          "\t= 装备总均伤: " + (Hud.Game.Me.Offense.WeaponBaseDamageMinBoffHand / 2 + Hud.Game.Me.Offense.WeaponBaseDamageMaxBoffHand / 2).ToString("F0", CultureInfo.InvariantCulture) + " (" + Hud.Game.Me.Offense.WeaponBaseDamageMinBoffHand.ToString("F0", CultureInfo.InvariantCulture) + "-" + Hud.Game.Me.Offense.WeaponBaseDamageMaxBoffHand.ToString("F0", CultureInfo.InvariantCulture) + ")\n")
                        : "") +
                        "\t增加主属性加成时: " +
                        (Hud.Game.Me.Offense.MainHandIsActive ?
                         "" + GLQ_BasePluginCN.ValueToString((Hud.Game.Me.Offense.WeaponBaseDamageMinBmainHand / 2 + Hud.Game.Me.Offense.WeaponBaseDamageMaxBmainHand / 2) * (1 + Hud.Game.Me.Stats.MainStat / 100), ValueFormat.LongNumber) + " (" + GLQ_BasePluginCN.ValueToString(Hud.Game.Me.Offense.WeaponBaseDamageMinBmainHand * (1 + Hud.Game.Me.Stats.MainStat / 100), ValueFormat.LongNumber) + "-" + GLQ_BasePluginCN.ValueToString(Hud.Game.Me.Offense.WeaponBaseDamageMaxBmainHand * (1 + Hud.Game.Me.Stats.MainStat / 100), ValueFormat.LongNumber) + ")\n" :
                         "" + GLQ_BasePluginCN.ValueToString((Hud.Game.Me.Offense.WeaponBaseDamageMinBoffHand / 2 + Hud.Game.Me.Offense.WeaponBaseDamageMaxBoffHand / 2) * (1 + Hud.Game.Me.Stats.MainStat / 100), ValueFormat.LongNumber) + " (" + GLQ_BasePluginCN.ValueToString(Hud.Game.Me.Offense.WeaponBaseDamageMinBoffHand * (1 + Hud.Game.Me.Stats.MainStat / 100), ValueFormat.LongNumber) + "-" + GLQ_BasePluginCN.ValueToString(Hud.Game.Me.Offense.WeaponBaseDamageMaxBoffHand * (1 + Hud.Game.Me.Stats.MainStat / 100), ValueFormat.LongNumber) + ")\n") +
                        "\t增加平均暴击加成时: " +
                        (Hud.Game.Me.Offense.MainHandIsActive ?
                         "" + GLQ_BasePluginCN.ValueToString((Hud.Game.Me.Offense.WeaponBaseDamageMinBmainHand / 2 + Hud.Game.Me.Offense.WeaponBaseDamageMaxBmainHand / 2) * (1 + Hud.Game.Me.Stats.MainStat / 100) * (1 + Hud.Game.Me.Offense.CriticalHitChance / 100 * Hud.Game.Me.Offense.CritDamage / 100), ValueFormat.LongNumber) + " (" + GLQ_BasePluginCN.ValueToString(Hud.Game.Me.Offense.WeaponBaseDamageMinBmainHand * (1 + Hud.Game.Me.Stats.MainStat / 100) * (1 + Hud.Game.Me.Offense.CriticalHitChance / 100 * Hud.Game.Me.Offense.CritDamage / 100), ValueFormat.LongNumber) + "-" + GLQ_BasePluginCN.ValueToString(Hud.Game.Me.Offense.WeaponBaseDamageMaxBmainHand * (1 + Hud.Game.Me.Stats.MainStat / 100) * (1 + Hud.Game.Me.Offense.CriticalHitChance / 100 * Hud.Game.Me.Offense.CritDamage / 100), ValueFormat.LongNumber) + ")\n" :
                         "" + GLQ_BasePluginCN.ValueToString((Hud.Game.Me.Offense.WeaponBaseDamageMinBoffHand / 2 + Hud.Game.Me.Offense.WeaponBaseDamageMaxBoffHand / 2) * (1 + Hud.Game.Me.Stats.MainStat / 100) * (1 + Hud.Game.Me.Offense.CriticalHitChance / 100 * Hud.Game.Me.Offense.CritDamage / 100), ValueFormat.LongNumber) + " (" + GLQ_BasePluginCN.ValueToString(Hud.Game.Me.Offense.WeaponBaseDamageMinBoffHand * (1 + Hud.Game.Me.Stats.MainStat / 100) * (1 + Hud.Game.Me.Offense.CriticalHitChance / 100 * Hud.Game.Me.Offense.CritDamage / 100), ValueFormat.LongNumber) + "-" + GLQ_BasePluginCN.ValueToString(Hud.Game.Me.Offense.WeaponBaseDamageMaxBoffHand * (1 + Hud.Game.Me.Stats.MainStat / 100) * (1 + Hud.Game.Me.Offense.CriticalHitChance / 100 * Hud.Game.Me.Offense.CritDamage / 100), ValueFormat.LongNumber) + ")\n") +
                        ((Hud.Game.Me.Offense.WeaponDamageIncreasedBySkills > 0) ?
                         "\t增加技能伤害加成时: " +
                         (Hud.Game.Me.Offense.MainHandIsActive ?
                          "" + GLQ_BasePluginCN.ValueToString((Hud.Game.Me.Offense.WeaponBaseDamageMinBmainHand / 2 + Hud.Game.Me.Offense.WeaponBaseDamageMaxBmainHand / 2) * (1 + Hud.Game.Me.Stats.MainStat / 100) * (1 + Hud.Game.Me.Offense.CriticalHitChance / 100 * Hud.Game.Me.Offense.CritDamage / 100) * (1 + Hud.Game.Me.Offense.WeaponDamageIncreasedBySkills), ValueFormat.LongNumber) + " (" + GLQ_BasePluginCN.ValueToString(Hud.Game.Me.Offense.WeaponBaseDamageMinBmainHand * (1 + Hud.Game.Me.Stats.MainStat / 100) * (1 + Hud.Game.Me.Offense.CriticalHitChance / 100 * Hud.Game.Me.Offense.CritDamage / 100) * (1 + Hud.Game.Me.Offense.WeaponDamageIncreasedBySkills), ValueFormat.LongNumber) + "-" + GLQ_BasePluginCN.ValueToString(Hud.Game.Me.Offense.WeaponBaseDamageMaxBmainHand * (1 + Hud.Game.Me.Stats.MainStat / 100) * (1 + Hud.Game.Me.Offense.CriticalHitChance / 100 * Hud.Game.Me.Offense.CritDamage / 100) * (1 + Hud.Game.Me.Offense.WeaponDamageIncreasedBySkills), ValueFormat.LongNumber) + ")\n" :
                          "" + GLQ_BasePluginCN.ValueToString((Hud.Game.Me.Offense.WeaponBaseDamageMinBoffHand / 2 + Hud.Game.Me.Offense.WeaponBaseDamageMaxBoffHand / 2) * (1 + Hud.Game.Me.Stats.MainStat / 100) * (1 + Hud.Game.Me.Offense.CriticalHitChance / 100 * Hud.Game.Me.Offense.CritDamage / 100) * (1 + Hud.Game.Me.Offense.WeaponDamageIncreasedBySkills), ValueFormat.LongNumber) + " (" + GLQ_BasePluginCN.ValueToString(Hud.Game.Me.Offense.WeaponBaseDamageMinBoffHand * (1 + Hud.Game.Me.Stats.MainStat / 100) * (1 + Hud.Game.Me.Offense.CriticalHitChance / 100 * Hud.Game.Me.Offense.CritDamage / 100) * (1 + Hud.Game.Me.Offense.WeaponDamageIncreasedBySkills), ValueFormat.LongNumber) + "-" + GLQ_BasePluginCN.ValueToString(Hud.Game.Me.Offense.WeaponBaseDamageMaxBoffHand * (1 + Hud.Game.Me.Stats.MainStat / 100) * (1 + Hud.Game.Me.Offense.CriticalHitChance / 100 * Hud.Game.Me.Offense.CritDamage / 100) * (1 + Hud.Game.Me.Offense.WeaponDamageIncreasedBySkills), ValueFormat.LongNumber) + ")\n")
                        : "") +
                        "\n总加成伤害增加: +" + (skillBonusTotal * 100 - 100).ToString("F0", CultureInfo.InvariantCulture) + "%\n" +
                        "\t" + (skill.ElementalDamageBonus * 100).ToString("F0", CultureInfo.InvariantCulture) + "% 元素技能伤害加成\n" +
                        "\t" + (skill.DamageBonus * 100).ToString("F0", CultureInfo.InvariantCulture) + "% " + skill.SnoPower.NameLocalized + "的伤害提高\n" +
                        (elite ? "\t" + (Hud.Game.Me.Offense.BonusToElites * 100).ToString("F0", CultureInfo.InvariantCulture) + "% 对精英伤害加成\n" : "") +
                        plainBonusText +
                        "\n'" + skill.SnoPower.NameLocalized + "' / '" + skill.RuneNameLocalized + "' " + (dotSeconds > 0 ? "在 " + dotSeconds.ToString("F1", CultureInfo.InvariantCulture) + " 秒内" : "") + "造成 " + weaponDamageMultiplier.ToString("F0", CultureInfo.InvariantCulture) + "% 武器伤害" + "\n" +
                        "\t总伤害: " + GLQ_BasePluginCN.ValueToString(skillDamage, ValueFormat.LongNumber) + " (= " + GLQ_BasePluginCN.ValueToString(weaponDamage, ValueFormat.LongNumber) + " * " + (weaponDamageMultiplier.ToString("F0", CultureInfo.InvariantCulture)) + "% + " + (skillBonusTotal * 100 - 100).ToString("F0", CultureInfo.InvariantCulture) + "% + " + (plainBonusTotal * 100 - 100).ToString("F0", CultureInfo.InvariantCulture) + "%)\n" +
                        "\t秒伤: " + GLQ_BasePluginCN.ValueToString(skillDps, ValueFormat.LongNumber) + " (= " + GLQ_BasePluginCN.ValueToString(skillDamage, ValueFormat.LongNumber) + (dotSeconds > 0 ? " / " + dotSeconds.ToString("F1", CultureInfo.InvariantCulture) + " 秒" : " * " + attackSpeed.ToString("F2", CultureInfo.InvariantCulture) + " 攻速/秒") + ")" +
                        ((resourceCost != -1) ? "\n\n能量消耗\n\t默认消耗: " + GLQ_BasePluginCN.ValueToString(Math.Abs(resourceCost), ValueFormat.NormalNumberNoDecimal) + " " + (resourceCost > 0 ? Hud.Game.Me.HeroClassDefinition.PrimaryResourceName : Hud.Game.Me.HeroClassDefinition.SecondaryResourceName) + "\n\t实际消耗: " + GLQ_BasePluginCN.ValueToString(skill.GetResourceRequirement(), ValueFormat.NormalNumber) + " " + (resourceCost > 0 ? Hud.Game.Me.HeroClassDefinition.PrimaryResourceName : Hud.Game.Me.HeroClassDefinition.SecondaryResourceName) : "");
                    Hud.Render.SetHint(hint, "tooltip-bottom-right");
                }
            }
            else
            {
                if (resourceCost != -1)
                {
                    if (Hud.Window.CursorInsideRect(rect.Left, rect.Top, rect.Width, rect.Height))
                    {
                        Hud.Render.SetHint("能量消耗\n\t默认消耗: " + GLQ_BasePluginCN.ValueToString(Math.Abs(resourceCost), ValueFormat.NormalNumberNoDecimal) + " " + (resourceCost > 0 ? Hud.Game.Me.HeroClassDefinition.PrimaryResourceName : Hud.Game.Me.HeroClassDefinition.SecondaryResourceName) + "\n\t实际消耗: " + GLQ_BasePluginCN.ValueToString(skill.GetResourceRequirement(), ValueFormat.NormalNumber) + " " + (resourceCost > 0 ? Hud.Game.Me.HeroClassDefinition.PrimaryResourceName : Hud.Game.Me.HeroClassDefinition.SecondaryResourceName), "tooltip-bottom-right");
                    }
                }
            }
        }
        public override void Load(IController hud)
        {
            base.Load(hud);

            var expandedHintFont = Hud.Render.CreateFont("tahoma", 6, 255, 200, 200, 200, false, false, true);

            LabelList = new HorizontalTopLabelList(hud);

            LabelList.LeftFunc = () =>
            {
                return(Hud.Window.Size.Width / 2 - Hud.Window.Size.Height * 0.14f);
            };
            LabelList.TopFunc = () =>
            {
                return(Hud.Window.Size.Height * 0.001f);
            };
            LabelList.WidthFunc = () =>
            {
                return(Hud.Window.Size.Height * 0.14f);
            };
            LabelList.HeightFunc = () =>
            {
                return(Hud.Window.Size.Height * 0.018f);
            };

            var currentLevelDecorator = new TopLabelDecorator(Hud)
            {
                TextFont                  = Hud.Render.CreateFont("tahoma", 6, 255, 57, 137, 205, true, false, true),
                BackgroundTexture1        = Hud.Texture.Button2TextureOrange,
                BackgroundTexture2        = Hud.Texture.BackgroundTextureBlue,
                BackgroundTextureOpacity1 = 1.0f,
                BackgroundTextureOpacity2 = 0.5f,
                TextFunc                  = () => (Hud.Game.Me.CurrentLevelNormal < Hud.Game.Me.CurrentLevelNormalCap) ? Hud.Game.Me.CurrentLevelNormal.ToString("0") : Hud.Game.Me.CurrentLevelParagonFloat.ToString("0.##", CultureInfo.InvariantCulture) + "级",
                ExpandDownLabels          = new List <TopLabelDecorator>(),
            };

            foreach (var levelIncrement in new uint[] { 1, 2, 5, 10, 20, 50, 100, 250, 500, 1000 })
            {
                currentLevelDecorator.ExpandDownLabels.Add(
                    new TopLabelDecorator(Hud)
                {
                    TextFont                      = Hud.Render.CreateFont("tahoma", 6, 180, 255, 255, 255, true, false, true),
                    ExpandedHintFont              = expandedHintFont,
                    ExpandedHintWidthMultiplier   = 2,
                    BackgroundTexture1            = Hud.Texture.Button2TextureOrange,
                    BackgroundTexture2            = Hud.Texture.BackgroundTextureBlue,
                    BackgroundTextureOpacity1     = 1.0f,
                    BackgroundTextureOpacity2     = 0.5f,
                    HideBackgroundWhenTextIsEmpty = true,
                    TextFunc                      = () => Hud.Game.Me.CurrentLevelNormal >= Hud.Game.Me.CurrentLevelNormalCap ? ((Hud.Game.Me.CurrentLevelParagon + levelIncrement).ToString("D", CultureInfo.InvariantCulture) + "级") : null,
                    HintFunc                      = () => ExpToParagonLevel(Hud.Game.Me.CurrentLevelParagon + levelIncrement) + " = " + TimeToParagonLevel(Hud.Game.Me.CurrentLevelParagon + levelIncrement, false),
                });
            }

            LabelList.LabelDecorators.Add(currentLevelDecorator);

            LabelList.LabelDecorators.Add(new TopLabelDecorator(Hud)
            {
                TextFont                  = Hud.Render.CreateFont("tahoma", 6, 255, 57, 137, 205, true, false, true),
                BackgroundTexture1        = Hud.Texture.Button2TextureOrange,
                BackgroundTexture2        = Hud.Texture.BackgroundTextureBlue,
                BackgroundTextureOpacity1 = 1.0f,
                BackgroundTextureOpacity2 = 0.5f,
                TextFunc                  = () => GLQ_BasePluginCN.ValueToString(Hud.Game.CurrentHeroToday.GainedExperiencePerHourPlay, ValueFormat.ShortNumber) + " 经验/小时",
            });
        }
        public void PaintTopInGame(ClipState clipState)
        {
            if (clipState != ClipState.BeforeClip)
            {
                return;
            }
            var inRift = Hud.Game.SpecialArea == SpecialArea.Rift || Hud.Game.SpecialArea == SpecialArea.GreaterRift;
            var inGR   = Hud.Game.SpecialArea == SpecialArea.GreaterRift;

            if (DefaultTextFont == null)
            {
                return;
            }

            double totalMonsterRiftProgression = 0;
            double TrashMonsterRiftProgression = 0;
            double EliteProgression            = 0;
            double RareMinionProgression       = 0;
            double RiftGlobeProgression        = 0;

            int monstersCount   = 0;
            int EliteCount      = 0;
            int RareMinionCount = 0;
            int ElitePackCount  = 0;
            // locust
            int locustCount      = 0;
            int ElitelocustCount = 0;
            // haunted
            int hauntedCount      = 0;
            int ElitehauntedCount = 0;
            //Palmed
            int palmedCount      = 0;
            int ElitepalmedCount = 0;
            //Phoenixed
            int phoenixedCount      = 0;
            int ElitephoenixedCount = 0;
            //Strongarmed Obsolete
            int strongarmedCount      = 0;
            int ElitestrongarmedCount = 0;
            int KrysbinCount          = 0;
            int EliteKrysbinCount     = 0;
            //Cursed
            int CursedCount      = 0;
            int EliteCursedCount = 0;
            //Piranhas
            int PiranhasCount      = 0;
            int ElitePiranhasCount = 0;

            float XPos        = Hud.Window.Size.Width * XWidth;
            float YPos        = Hud.Window.Size.Height * YHeight;
            var   Allmonsters = Hud.Game.AliveMonsters;
            var   bleedCount  = Allmonsters.Where(m => m.Bleeding && m.NormalizedXyDistanceToMe <= 20).ToList().Count;
            var   monsters    = Allmonsters.Where(m => ((m.SummonerAcdDynamicId == 0 && m.IsElite) || !m.IsElite) && m.FloorCoordinate.XYDistanceTo(Hud.Game.Me.FloorCoordinate) <= currentYard);
            Dictionary <IMonster, string> eliteGroup = new Dictionary <IMonster, string>();

            foreach (var monster in monsters)
            {
                var Elite = monster.Rarity == ActorRarity.Rare || monster.Rarity == ActorRarity.Champion || monster.Rarity == ActorRarity.Unique || monster.Rarity == ActorRarity.Boss;
                monstersCount++;
                if (isKrysbin(monster) && ShowKrysbinCount)
                {
                    KrysbinCount++;
                }
                if (!monster.IsElite)
                {
                    if (inRift)
                    {
                        TrashMonsterRiftProgression += monster.SnoMonster.RiftProgression * 100.0d / this.Hud.Game.MaxQuestProgress;
                    }
                }
                else
                {
                    if (monster.Rarity == ActorRarity.RareMinion)
                    {
                        RareMinionCount++;
                        if (inRift)
                        {
                            RareMinionProgression += monster.SnoMonster.RiftProgression * 100.0d / this.Hud.Game.MaxQuestProgress;
                        }
                    }
                    else
                    {
                        if (isKrysbin(monster) && ShowKrysbinCount)
                        {
                            EliteKrysbinCount++;
                        }
                        if (monster.Rarity == ActorRarity.Unique || monster.Rarity == ActorRarity.Boss)
                        {
                            EliteCount++;
                            ElitePackCount++;
                        }

                        if (monster.Rarity == ActorRarity.Champion)
                        {
                            EliteCount++;
                            eliteGroup.Add(monster, String.Join(", ", monster.AffixSnoList));
                            if (inRift)
                            {
                                EliteProgression += monster.SnoMonster.RiftProgression * 100.0d / this.Hud.Game.MaxQuestProgress;
                            }
                        }

                        if (monster.Rarity == ActorRarity.Rare)
                        {
                            EliteCount++;
                            ElitePackCount++;
                            if (inRift)
                            {
                                EliteProgression += 4 * 1.15d;
                                EliteProgression += monster.SnoMonster.RiftProgression * 100.0d / this.Hud.Game.MaxQuestProgress;
                            }
                        }
                    }
                }
                if (monster.Locust && ShowLlocustCount)
                {
                    locustCount++;
                    if (Elite)
                    {
                        ElitelocustCount++;
                    }
                }
                if (monster.Haunted && ShowHauntedCount)
                {
                    hauntedCount++;
                    if (Elite)
                    {
                        ElitehauntedCount++;
                    }
                }
                if (monster.Palmed && ShowPalmedCount)
                {
                    palmedCount++;
                    if (Elite)
                    {
                        ElitepalmedCount++;
                    }
                }
                if (monster.Piranhas && ShowPiranhasCount)
                {
                    PiranhasCount++;
                    if (Elite)
                    {
                        ElitePiranhasCount++;
                    }
                }
                if (monster.Cursed && ShowCursedCount)
                {
                    CursedCount++;
                    if (Elite)
                    {
                        EliteCursedCount++;
                    }
                }
                if (monster.Phoenixed && ShowPhoenixedCount)
                {
                    phoenixedCount++;
                    if (Elite)
                    {
                        ElitephoenixedCount++;
                    }
                }
                if (monster.Strongarmed && ShowStrongarmedCount)
                {
                    strongarmedCount++;
                    if (Elite)
                    {
                        ElitestrongarmedCount++;
                    }
                }
            }
            Dictionary <IMonster, string> eliteGroup1 = eliteGroup.OrderBy(p => p.Value).ToDictionary(p => p.Key, o => o.Value);

            if (monstersCount == 0)
            {
                return;
            }
            var actors = Hud.Game.Actors.Where(x => x.SnoActor.Kind == ActorKind.RiftOrb);

            foreach (var actor in actors)
            {
                RiftGlobeProgression += 1.15d;
            }
            string preStr = null;

            foreach (var elite in eliteGroup1)
            {
                if (elite.Key.Rarity == ActorRarity.Champion)
                {
                    if (preStr != elite.Value)
                    {
                        EliteProgression += 3 * 1.15f;
                        ElitePackCount++;
                    }
                    preStr = elite.Value;
                }
            }
            textBuilder.Clear();
            if (ShowMonstersCount)
            {
                textBuilder.AppendFormat("{0} 码怪物总数: {1}", currentYard, monstersCount);
                textBuilder.AppendLine();
                if (EliteCount > 0)
                {
                    textBuilder.AppendFormat("精英: {0} 只({1}组)", EliteCount, ElitePackCount);
                }
                if (RareMinionCount > 0)
                {
                    textBuilder.AppendFormat("爪牙: {0} 只", RareMinionCount);
                }
                textBuilder.AppendLine();
                textBuilder.AppendLine();
            }

            if (inRift)
            {
                totalMonsterRiftProgression = TrashMonsterRiftProgression + EliteProgression + RareMinionProgression + RiftGlobeProgression;
                long totalTime      = (long)totalMonsterRiftProgression * 90000000;
                long TrashTime      = (long)TrashMonsterRiftProgression * 90000000;
                long EliteTime      = (long)EliteProgression * 90000000;
                long RareMinionTime = (long)RareMinionProgression * 90000000;
                long RiftGlobeTime  = (long)RiftGlobeProgression * 90000000;
                if (totalMonsterRiftProgression > 0 && ShowTotalProgression)
                {
                    if (ShowTime && inGR)
                    {
                        textBuilder.AppendFormat("总进度: {0}% = {1}", totalMonsterRiftProgression.ToString("f2"), GLQ_BasePluginCN.ValueToString((long)totalTime, ValueFormat.LongTime));
                    }
                    else
                    {
                        textBuilder.AppendFormat("总进度: {0}%", totalMonsterRiftProgression.ToString("f2"));
                    }
                    textBuilder.AppendLine();
                }

                if (TrashMonsterRiftProgression > 0 && ShowTrashProgression)
                {
                    if (ShowTime && inGR)
                    {
                        textBuilder.AppendFormat("白怪进度: {0}% = {1}", TrashMonsterRiftProgression.ToString("f2"), GLQ_BasePluginCN.ValueToString((long)TrashTime, ValueFormat.LongTime));
                    }
                    else
                    {
                        textBuilder.AppendFormat("白怪进度: {0}%", TrashMonsterRiftProgression.ToString("f2"));
                    }
                    textBuilder.AppendLine();
                }
                if (EliteProgression > 0 && ShowEliteProgression)
                {
                    if (ShowTime && inGR)
                    {
                        textBuilder.AppendFormat("精英进度: {0}% = {1}", EliteProgression.ToString("f2"), GLQ_BasePluginCN.ValueToString((long)EliteTime, ValueFormat.LongTime));
                    }
                    else
                    {
                        textBuilder.AppendFormat("精英进度: {0}%", EliteProgression.ToString("f2"));
                    }
                    textBuilder.AppendLine();
                }
                if (RareMinionProgression > 0 && ShowRareMinionProgression)
                {
                    if (ShowTime && inGR)
                    {
                        textBuilder.AppendFormat("爪牙进度: {0}% = {1}", RareMinionProgression.ToString("f2"), GLQ_BasePluginCN.ValueToString((long)RareMinionTime, ValueFormat.LongTime));
                    }
                    else
                    {
                        textBuilder.AppendFormat("爪牙进度: {0}%", RareMinionProgression.ToString("f2"));
                    }
                    textBuilder.AppendLine();
                }
                if (RiftGlobeProgression > 0 && ShowRiftGlobeProgression)
                {
                    if (ShowTime && inGR)
                    {
                        textBuilder.AppendFormat("进度球进度: {0}% = {1}", RiftGlobeProgression.ToString("f2"), GLQ_BasePluginCN.ValueToString((long)RiftGlobeTime, ValueFormat.LongTime));
                    }
                    else
                    {
                        textBuilder.AppendFormat("进度球进度: {0}%", RiftGlobeProgression.ToString("f2"));
                    }
                    textBuilder.AppendLine();
                }
                textBuilder.AppendLine();
            }
            if (locustCount > 0 && ShowLlocustCount)
            {
                textBuilder.AppendFormat("感染虫群: {0}/{1}", locustCount, monstersCount);
                if (ElitelocustCount > 0)
                {
                    textBuilder.AppendFormat(" (精英: {0}/{1})", ElitelocustCount, EliteCount);
                }
                textBuilder.AppendLine();
            }
            if (hauntedCount > 0 && ShowHauntedCount)
            {
                textBuilder.AppendFormat("感染蚀魂: {0}/{1}", hauntedCount, monstersCount);
                if (ElitehauntedCount > 0)
                {
                    textBuilder.AppendFormat(" (精英: {0}/{1})", ElitehauntedCount, EliteCount);
                }
                textBuilder.AppendLine();
            }
            if (CursedCount > 0 && ShowCursedCount)
            {
                textBuilder.AppendFormat("被诅咒: {0}/{1}", CursedCount, monstersCount);
                if (ElitehauntedCount > 0)
                {
                    textBuilder.AppendFormat(" (精英: {0}/{1})", EliteCursedCount, EliteCount);
                }
                textBuilder.AppendLine();
            }
            if (PiranhasCount > 0 && ShowPiranhasCount)
            {
                textBuilder.AppendFormat("食人鱼: {0}/{1}", PiranhasCount, monstersCount);
                if (ElitehauntedCount > 0)
                {
                    textBuilder.AppendFormat(" (精英: {0}/{1})", ElitePiranhasCount, EliteCount);
                }
                textBuilder.AppendLine();
            }
            if (palmedCount > 0 && ShowPalmedCount)
            {
                textBuilder.AppendFormat("爆裂掌: {0}/{1}", palmedCount, monstersCount);
                if (ElitepalmedCount > 0)
                {
                    textBuilder.AppendFormat(" (精英: {0}/{1})", ElitepalmedCount, EliteCount);
                }
                textBuilder.AppendLine();
            }
            if (phoenixedCount > 0 && ShowPhoenixedCount)
            {
                textBuilder.AppendFormat("点燃: {0}/{1}", phoenixedCount, monstersCount);
                if (ElitephoenixedCount > 0)
                {
                    textBuilder.AppendFormat(" (精英: {0}/{1})", ElitephoenixedCount, EliteCount);
                }
                textBuilder.AppendLine();
            }
            if (strongarmedCount > 0 && ShowStrongarmedCount)
            {
                textBuilder.AppendFormat("力士增伤: {0}/{1}", strongarmedCount, monstersCount);
                if (ElitestrongarmedCount > 0)
                {
                    textBuilder.AppendFormat(" (精英: {0}/{1})", ElitestrongarmedCount, EliteCount);
                }
                textBuilder.AppendLine();
            }
            if (KrysbinCount > 0 && ShowKrysbinCount)
            {
                textBuilder.AppendFormat("克利斯宾: {0}/{1}", KrysbinCount, monstersCount);
                if (EliteKrysbinCount > 0)
                {
                    textBuilder.AppendFormat(" (精英: {0}/{1})", EliteKrysbinCount, EliteCount);
                }
                textBuilder.AppendLine();
            }
            if (ShowPainEnhancerCount && Hud.Game.Me.Powers.UsedLegendaryGems.PainEnhancerPrimary?.Active == true)
            {
                if (bleedCount > 0)
                {
                    textBuilder.AppendLine();
                    textBuilder.AppendFormat("增痛宝石: 20码内{0}个怪流血", bleedCount);
                    textBuilder.AppendLine();
                    textBuilder.AppendFormat("攻速加成: {0}%", bleedCount * 3);
                    textBuilder.AppendLine();
                }
            }

            if (totalMonsterRiftProgression >= 100d - Hud.Game.RiftPercentage && Hud.Game.RiftPercentage != 100 || TrashMonsterRiftProgression >= 100d - Hud.Game.RiftPercentage && Hud.Game.RiftPercentage != 100)
            {
                if (totalMonsterRiftProgression >= 100d - Hud.Game.RiftPercentage && Hud.Game.RiftPercentage != 100)
                {
                    currentFont = OrangeTextFont;
                }
                if (TrashMonsterRiftProgression >= 100d - Hud.Game.RiftPercentage && Hud.Game.RiftPercentage != 100)
                {
                    currentFont = RedTextFont;
                }
            }
            else
            {
                currentFont = DefaultTextFont;
            }
            var layout = currentFont.GetTextLayout(textBuilder.ToString());

            currentFont.DrawText(layout, XPos, YPos);
        }