Exemplo n.º 1
0
        private void DrawGreaterRift()
        {
            var ui = Hud.Render.GreaterRiftBarUiElement;

            if (!ui.Visible)
            {
                return;
            }

            if (GreaterRiftTimerEnabled)
            {
                var secondsLeft = (Hud.Game.CurrentTimedEventEndTick - Hud.Game.CurrentTimedEventEndTickMod - (double)Hud.Game.CurrentGameTick) / 60.0d;
                if (secondsLeft > 0)
                {
                    var text       = ValueToString((long)(Hud.Game.CurrentTimedEventEndTick - Hud.Game.CurrentTimedEventEndTickMod - Hud.Game.CurrentGameTick) * 1000 * TimeSpan.TicksPerMillisecond / 60, ValueFormat.LongTime);
                    var textLayout = GreaterRiftTimerFont.GetTextLayout(text);
                    GreaterRiftTimerFont.DrawText(textLayout, ui.Rectangle.Right - (float)(ui.Rectangle.Width / 900.0f * secondsLeft) - (textLayout.Metrics.Width / 2), ui.Rectangle.Bottom + (ui.Rectangle.Height * 0.7f));
                }
            }

            if (GreaterRiftPercentEnabled)
            {
                var percent    = Hud.Game.RiftPercentage;
                var text       = percent.ToString("F1", CultureInfo.InvariantCulture) + "%";
                var textLayout = GreaterRiftPercentFont.GetTextLayout(text);
                var x          = (float)(ui.Rectangle.Left + (ui.Rectangle.Width / 100.0f * percent)) - (textLayout.Metrics.Width / 2);
                var y          = ui.Rectangle.Top - (ui.Rectangle.Height * 0.7f) - textLayout.Metrics.Height;
                GreaterRiftPercentFont.DrawText(textLayout, x, y);
            }

            if (NearMonsterProgressionEnabled && (Hud.Game.CurrentQuestProgress < Hud.Game.MaxQuestProgress))
            {
                var total      = CalculateNearMonsterProgression(NearMonsterProgressionRange) / Hud.Game.MaxQuestProgress * 100d;
                var text       = total.ToString("F2", CultureInfo.InvariantCulture) + "% in " + NearMonsterProgressionRange.ToString("F0") + " yards";
                var textLayout = NearMonsterProgressionFont.GetTextLayout(text);
                var x          = ui.Rectangle.Left + ((ui.Rectangle.Width - textLayout.Metrics.Width) / 2);
                var y          = ui.Rectangle.Top + ((ui.Rectangle.Height - textLayout.Metrics.Height) / 2) + 1;
                NearMonsterProgressionFont.DrawText(textLayout, x, y);
            }
        }
Exemplo n.º 2
0
        public void PaintTopInGame(ClipState clipState)
        {
            if (clipState != ClipState.BeforeClip)
            {
                return;
            }

            if ((Hud.Game.SpecialArea != SpecialArea.Rift) && (Hud.Game.SpecialArea != SpecialArea.GreaterRift))
            {
                return;
            }

            if (Hud.Game.SpecialArea == SpecialArea.Rift)
            {
                var percent = Hud.Game.RiftPercentage;
                var ui      = Hud.Render.NephalemRiftBarUiElement;
                if (ui.Visible)
                {
                    var add = ui.Rectangle.Height / 10.0f;
                    if (NephalemRiftPercentEnabled)
                    {
                        var text       = percent.ToString("F1", CultureInfo.InvariantCulture) + "%";
                        var textLayout = NephalemRiftPercentFont.GetTextLayout(text);
                        var x          = (float)(ui.Rectangle.Left + ui.Rectangle.Width / 100.0f * percent) - textLayout.Metrics.Width / 2;
                        var y          = ui.Rectangle.Top - ui.Rectangle.Height * 0.2f - textLayout.Metrics.Height;
                        NephalemRiftPercentFont.DrawText(textLayout, x, y);
                    }

                    if (NearMonsterProgressionEnabled && (Hud.Game.CurrentQuestProgress < Hud.Game.MaxQuestProgress))
                    {
                        var total      = CalculateNearMonsterProgression(NearMonsterProgressionRange) / Hud.Game.MaxQuestProgress * 100d;
                        var text       = total.ToString("F2", CultureInfo.InvariantCulture) + "% in " + NearMonsterProgressionRange.ToString("F0") + " yards";
                        var textLayout = NearMonsterProgressionFont.GetTextLayout(text);
                        var x          = ui.Rectangle.Left + (ui.Rectangle.Width - textLayout.Metrics.Width) / 2;
                        var y          = ui.Rectangle.Top + (ui.Rectangle.Height - textLayout.Metrics.Height) / 2 + 1;
                        NearMonsterProgressionFont.DrawText(textLayout, x, y);
                    }
                }
            }

            if (Hud.Game.SpecialArea == SpecialArea.GreaterRift)
            {
                var percent = Hud.Game.RiftPercentage;
                var ui      = Hud.Render.GreaterRiftBarUiElement;
                if (ui.Visible)
                {
                    var secondsLeft = (Hud.Game.CurrentTimedEventEndTick - (double)Hud.Game.CurrentGameTick) / 60.0d;
                    if (GreaterRiftTimerEnabled && (secondsLeft > 0))
                    {
                        var text       = ValueToString(((long)(Hud.Game.CurrentTimedEventEndTick - Hud.Game.CurrentGameTick) * 1000 * TimeSpan.TicksPerMillisecond / 60), ValueFormat.LongTime);
                        var textLayout = GreaterRiftTimerFont.GetTextLayout(text);
                        GreaterRiftTimerFont.DrawText(textLayout, ui.Rectangle.Right - (float)(ui.Rectangle.Width / 900.0f * secondsLeft) - textLayout.Metrics.Width / 2, ui.Rectangle.Bottom + ui.Rectangle.Height * 0.7f);
                    }

                    if (GreaterRiftPercentEnabled)
                    {
                        var text       = percent.ToString("F1", CultureInfo.InvariantCulture) + "%";
                        var textLayout = GreaterRiftPercentFont.GetTextLayout(text);
                        var x          = (float)(ui.Rectangle.Left + ui.Rectangle.Width / 100.0f * percent) - textLayout.Metrics.Width / 2;
                        var y          = ui.Rectangle.Top - ui.Rectangle.Height * 0.7f - textLayout.Metrics.Height;
                        GreaterRiftPercentFont.DrawText(textLayout, x, y);
                    }

                    if (NearMonsterProgressionEnabled && (Hud.Game.CurrentQuestProgress < Hud.Game.MaxQuestProgress))
                    {
                        var total      = CalculateNearMonsterProgression(NearMonsterProgressionRange) / Hud.Game.MaxQuestProgress * 100d;
                        var text       = total.ToString("F2", CultureInfo.InvariantCulture) + "% in " + NearMonsterProgressionRange.ToString("F0") + " yards";
                        var textLayout = NearMonsterProgressionFont.GetTextLayout(text);
                        var x          = ui.Rectangle.Left + (ui.Rectangle.Width - textLayout.Metrics.Width) / 2;
                        var y          = ui.Rectangle.Top + (ui.Rectangle.Height - textLayout.Metrics.Height) / 2 + 1;
                        NearMonsterProgressionFont.DrawText(textLayout, x, y);
                    }
                }
            }
        }