Пример #1
0
        public void PaintTopInGame(ClipState clipState)
        {
            if (clipState != ClipState.BeforeClip)
            {
                return;
            }

            if (Hud.Game.SpecialArea == SpecialArea.GreaterRift)
            {
                var percent = Hud.Game.RiftPercentage;
                if (percent <= 0)
                {
                    ProgressionofShrines.Clear();
                    Pylon_State.Clear();
                    return;
                }
                var ui = Hud.Render.GreaterRiftBarUiElement;

                if (ui.Visible)
                {
                    var uiRect  = ui.Rectangle;
                    var shrines = Hud.Game.Shrines;
                    Tuple <double, string> valuesOut;
                    var poder = "";
                    foreach (var actor in shrines)
                    {
                        switch ((uint)actor.SnoActor.Sno)
                        {
                        case 330695: poder = "POWR";  break;

                        case 330696:
                        case 398654: poder = "COND";  break;

                        case 330697: poder = "CHAN";  break;

                        case 330698: poder = "SHLD";  break;

                        case 330699: poder = "SPED";  break;

                        default: poder = actor.SnoActor.Sno.ToString("F0");  break;
                        }
// Para parchear que Hud.Game.Me.SnoArea.NameLocalized no se actualice inmediatamente al entrar en un mapa. Hay problemas si el pilón está cerca de la puerta
                        if (ProgressionofShrines.TryGetValue(poder, out valuesOut))
                        {
                            if (valuesOut.Item2 != Hud.Game.Me.SnoArea.NameLocalized)
                            {
                                Tuple <double, string> updateValues = new Tuple <double, string>(valuesOut.Item1, Hud.Game.Me.SnoArea.NameLocalized);
                                ProgressionofShrines[poder] = updateValues;
                            }
                        }
                        else
                        {
                            Tuple <double, string> updateValues = new Tuple <double, string>(percent, Hud.Game.Me.SnoArea.NameLocalized);
                            ProgressionofShrines.Add(poder, updateValues);
                        }
                        if (actor.IsDisabled || actor.IsOperated)
                        {
                            if (!Pylon_State.Contains(poder))
                            {
                                Pylon_State.Add(poder);
                            }
                        }
                    }

                    Dictionary <uint, string> .KeyCollection listabufos = Pylon_Buff.Keys;
                    foreach (uint bufo in listabufos)
                    {
                        if (Hud.Game.Me.Powers.BuffIsActive(bufo, 0))
                        {
                            if (!Pylon_State.Contains(Pylon_Buff[bufo]))
                            {
                                Pylon_State.Add(Pylon_Buff[bufo]);
                            }
                        }
                    }

                    var py = Hud.Window.Size.Height / 30; var anterior = 0d; var contador = 0; var text = "";
                    var ancho = (GreaterRiftFont.GetTextLayout("00,0%")).Metrics.Width; var alto = (GreaterRiftFont.GetTextLayout("00,0%")).Metrics.Height;
                    Dictionary <string, Tuple <double, string> > .KeyCollection keyColl = ProgressionofShrines.Keys;

                    foreach (string s in keyColl)
                    {
                        if (ProgressionofShrines.TryGetValue(s, out valuesOut))
                        {
                            contador += 1;

                            double porcentaje = valuesOut.Item1;                               //porcentaje al que salio el pilon
                            string piso       = valuesOut.Item2.Replace("Rift Level", "Lvl");; //piso en el que salio el pilon

                            var xPos = (float)(uiRect.Left + uiRect.Width / 100.0f * porcentaje);

                            ProgressionLineBrush.DrawLine(xPos, uiRect.Bottom, xPos, uiRect.Bottom + py, 0);
                            var PilonApilon = (contador > 1) ? ("+" + (porcentaje - anterior).ToString("F0") + "%") : "";
                            text     = porcentaje.ToString("F1") + "%" + "\r\n" + s + "\r\n" + piso + "\r\n" + PilonApilon;
                            anterior = porcentaje;
                            if (Pylon_State.Contains(s))
                            {
                                GreaterRiftFontUsed.DrawText(text, xPos - ancho, uiRect.Bottom + py, true);
                            }
                            else
                            {
                                GreaterRiftFont.DrawText(text, xPos - ancho, uiRect.Bottom + py, true);
                            }

                            if ((contador != 4) && (contador == ProgressionofShrines.Count))
                            {
                                var DesdePîlon = "+" + (percent - porcentaje).ToString("F1") + "%";
                                GreaterRiftFont2.DrawText(DesdePîlon, uiRect.Left + uiRect.Width / 2 - GreaterRiftFont2.GetTextLayout(DesdePîlon).Metrics.Width / 2, uiRect.Bottom + uiRect.Height * 0.2f, true);
                            }
                        }
                    }
                }
            }
        }
        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.GreaterRift)
            //if (Hud.Game.SpecialArea == SpecialArea.Rift)
            {
                var percent = Hud.Game.RiftPercentage;
                if (percent <= 0)
                {
                    ProgressionofShrines.Clear();
                    flag_wn = false;
                    flag_dj = false;
                    flag_jh = false;
                    flag_hd = false;
                    flag_js = false;
                    return;
                }
                var ui = Hud.Render.GreaterRiftBarUiElement;
                //var ui = Hud.Render.NephalemRiftBarUiElement;
                var uiRect = ui.Rectangle;
                if (ui.Visible)
                {
                    var shrines = Hud.Game.Shrines;
                    //if (shrines.Count() <= 0) return;
                    foreach (var actor in shrines)
                    {
                        switch (actor.SnoActor.Sno)
                        {
                        case 330695:
                            if (flag_wn == false)
                            {
                                ProgressionofShrines.Add("威能", percent);
                            }
                            flag_wn = true;
                            break;

                        case 330696:
                        case 398654:
                            if (flag_dj == false)
                            {
                                ProgressionofShrines.Add("电击", percent);
                            }
                            flag_dj = true;
                            break;

                        case 330697:
                            if (flag_jh == false)
                            {
                                ProgressionofShrines.Add("减耗", percent);
                            }
                            flag_jh = true;
                            break;

                        case 330698:
                            if (flag_hd == false)
                            {
                                ProgressionofShrines.Add("护盾", percent);
                            }
                            flag_hd = true;
                            break;

                        case 330699:
                            if (flag_js == false)
                            {
                                ProgressionofShrines.Add("加速", percent);
                            }
                            flag_js = true;
                            break;
                        }
                    }
                    var x  = (float)(uiRect.Left + uiRect.Width / 100.0f * percent);
                    var py = Hud.Window.Size.Height / 30;
                    foreach (var pos in ProgressionofShrines)
                    {
                        var xPos = (float)(uiRect.Left + uiRect.Width / 100.0f * pos.Value);
                        ProgressionLineBrush.DrawLine(xPos, uiRect.Bottom, xPos, uiRect.Bottom + py, 0);
                        var text = pos.Value.ToString("F1") + "%" + "\r\n" + pos.Key;
                        GreaterRiftFont.DrawText(text, xPos, uiRect.Bottom + py, true);
                    }
                }
            }
        }