Exemplo n.º 1
0
        private void DrawItemGRupgradeChance(IItem item, System.Drawing.RectangleF rect)
        {
            var jewelRank = item.JewelRank;

            if (jewelRank == -1)
            {
                jewelRank = 0;
            }
            bool Max = IsMaxedGem(item, jewelRank);

            if (Max)
            {
                var layout = GRupgradeChanceFont.GetTextLayout("max");
                GRupgradeChanceFont.DrawText(layout, rect.Right - layout.Metrics.Width - 3, rect.Bottom - layout.Metrics.Height - 3);

                return;
            }

            else
            {
                GRlevel = jewelRank + AddPerc + (NumberOfAttempts - 1);
                if (GRlevel < 1)
                {
                    GRlevel = 1;
                }
                var text   = GRlevel.ToString("D", CultureInfo.InvariantCulture);
                var layout = GRupgradeChanceFont.GetTextLayout(text);
                GRupgradeChanceFont.DrawText(layout, rect.Right - layout.Metrics.Width - 3, rect.Bottom - layout.Metrics.Height - 3);
            }
        }
Exemplo n.º 2
0
        private void DrawItemChancePercentage(IItem item, System.Drawing.RectangleF rect)
        {
            var jewelRank = item.JewelRank;

            if (jewelRank == -1)
            {
                jewelRank = 0;
            }
            bool Max = IsMaxedGem(item, jewelRank);
            var  UpgradeGemPanelRect = Hud.Render.GetUiElement("Root.NormalLayer.vendor_dialog_mainPage.riftReward_dialog.LayoutRoot.gemUpgradePane.items_list._content").Rectangle;

            if (Max)
            {
                var layout = GRupgradeNoChanceFont.GetTextLayout("max");
                if ((rect.Bottom - layout.Metrics.Height - 3) > UpgradeGemPanelRect.Top && (rect.Bottom - layout.Metrics.Height - 3) < UpgradeGemPanelRect.Bottom)
                {
                    GRupgradeNoChanceFont.DrawText(layout, rect.Right - layout.Metrics.Width - 3, rect.Bottom - layout.Metrics.Height - 3);
                }
                return;
            }

            else
            {
                uint DatGRlevel = Hud.Game.Me.InGreaterRiftRank;
                int  Diff       = (int)(DatGRlevel - jewelRank);

                if (Diff > 10)
                {
                    Diff = 10;
                }
                else if (Diff < -7)
                {
                    Diff = -7;
                }

                string Percentage = string.Empty;

                switch (Diff)
                {
                case 10:
                    Percentage = "100%";
                    break;

                case 9:
                    Percentage = "90%";
                    break;

                case 8:
                    Percentage = "80%";
                    break;

                case 7:
                    Percentage = "70%";
                    break;

                case 6:
                case 5:
                case 4:
                case 3:
                case 2:
                case 1:
                case 0:
                    Percentage = "60%";
                    break;

                case -1:
                    Percentage = "30%";
                    break;

                case -2:
                    Percentage = "15%";
                    break;

                case -3:
                    Percentage = "8%";
                    break;

                case -4:
                    Percentage = "4%";
                    break;

                case -5:
                    Percentage = "2%";
                    break;

                case -6:
                    Percentage = "1%";
                    break;

                case -7:
                    Percentage = "0%";
                    break;
                }

                if (Percentage == "0%")
                {
                    var layout = GRupgradeNoChanceFont.GetTextLayout(Percentage);
                    if ((rect.Bottom - layout.Metrics.Height - 3) > UpgradeGemPanelRect.Top && (rect.Bottom - layout.Metrics.Height - 3) < UpgradeGemPanelRect.Bottom)
                    {
                        GRupgradeNoChanceFont.DrawText(layout, rect.Right - layout.Metrics.Width - 3, rect.Bottom - layout.Metrics.Height - 3);
                    }
                }
                else
                {
                    var layout = GRupgradeChanceFont.GetTextLayout(Percentage);
                    if ((rect.Bottom - layout.Metrics.Height - 3) > UpgradeGemPanelRect.Top && (rect.Bottom - layout.Metrics.Height - 3) < UpgradeGemPanelRect.Bottom)
                    {
                        GRupgradeChanceFont.DrawText(layout, rect.Right - layout.Metrics.Width - 3, rect.Bottom - layout.Metrics.Height - 3);
                    }
                }
            }
        }