Beispiel #1
0
        private void frmMMPowers_Load(object sender, EventArgs e)
        {
            BackColor         = _myParent.BackColor;
            PopInfo.ForeColor = BackColor;
            var llLeft = this.llLeft;

            UpdateLlColours(ref llLeft);
            this.llLeft = llLeft;
            var llRight = this.llRight;

            UpdateLlColours(ref llRight);
            this.llRight     = llRight;
            ibClose.IA       = _myParent.Drawing.pImageAttributes;
            ibClose.ImageOff = MidsContext.Character.IsHero()
                ? _myParent.Drawing.bxPower[2].Bitmap
                : _myParent.Drawing.bxPower[4].Bitmap;
            ibClose.ImageOn = MidsContext.Character.IsHero()
                ? _myParent.Drawing.bxPower[3].Bitmap
                : _myParent.Drawing.bxPower[5].Bitmap;
            var iPopup = new PopUp.PopupData();
            var index  = iPopup.Add();

            iPopup.Sections[index].Add("Click powers to enable/disable them.", PopUp.Colors.Title);
            iPopup.Sections[index]
            .Add("Powers in gray (or your custom 'power disabled' color) cannot be included in your stats.",
                 PopUp.Colors.Text, 0.9f);
            PopInfo.SetPopup(iPopup);
            //ChangedScrollFrameContents();
            UpdatePetPowersCombo(PetPowers);
            UpdatePetsListCombo();
            //FillLists();
        }
Beispiel #2
0
        void CopyToClipboard()
        {
            string str1 = "";

            PopUp.PopupData popupData = this.BuildList(true);
            int             num1      = this.RecipeInfo.pData.Sections.Length - 1;

            for (int index1 = 0; index1 <= num1; ++index1)
            {
                int num2 = this.RecipeInfo.pData.Sections[index1].Content.Length - 1;
                for (int index2 = 0; index2 <= num2; ++index2)
                {
                    PopUp.StringValue[] content = popupData.Sections[index1].Content;
                    int    index3 = index2;
                    string str2   = str1 + content[index3].Text;
                    if (content[index3].TextColumn != "")
                    {
                        str2 = str2 + "  " + content[index3].TextColumn;
                    }
                    str1 = str2 + "\r\n";
                }
                str1 += "\r\n";
            }
            Clipboard.SetDataObject(str1, true);
            int num3 = (int)Interaction.MsgBox("Data copied to clipboard!", MsgBoxStyle.Information, "Done");
        }
Beispiel #3
0
        private void frmIncarnate_Load(object sender, EventArgs e)

        {
            buttonArray[0] = alphaBtn;
            buttonArray[1] = destinyBtn;
            buttonArray[2] = hybridBtn;
            buttonArray[3] = interfaceBtn;
            buttonArray[4] = judgementBtn;
            buttonArray[5] = loreBtn;
            buttonArray[6] = GenesisButton;
            buttonArray[7] = StanceButton;
            buttonArray[8] = VitaeButton;
            buttonArray[9] = OmegaButton;
            foreach (var button in buttonArray)
            {
                if (button.Enabled)
                {
                    button.IA       = myParent.Drawing.pImageAttributes;
                    button.ImageOff = MidsContext.Character.IsHero()
                        ? myParent.Drawing.bxPower[2].Bitmap
                        : myParent.Drawing.bxPower[4].Bitmap;
                    button.ImageOn = MidsContext.Character.IsHero()
                        ? myParent.Drawing.bxPower[3].Bitmap
                        : myParent.Drawing.bxPower[5].Bitmap;
                }
                else
                {
                    button.IA       = myParent.Drawing.pImageAttributes;
                    button.ImageOff = myParent.Drawing.bxPower[1].Bitmap;
                    button.ImageOn  = myParent.Drawing.bxPower[1].Bitmap;
                }
            }

            BackColor         = myParent.BackColor;
            PopInfo.ForeColor = BackColor;
            var llLeft = LLLeft;

            UpdateLLColours(ref llLeft);
            LLLeft = llLeft;
            var llRight = LLRight;

            UpdateLLColours(ref llRight);
            LLRight          = llRight;
            ibClose.IA       = myParent.Drawing.pImageAttributes;
            ibClose.ImageOff = MidsContext.Character.IsHero() ? myParent.Drawing.bxPower[2].Bitmap : myParent.Drawing.bxPower[4].Bitmap;
            ibClose.ImageOn  = MidsContext.Character.IsHero() ? myParent.Drawing.bxPower[3].Bitmap : myParent.Drawing.bxPower[5].Bitmap;
            var iPopup = new PopUp.PopupData();
            var index  = iPopup.Add();

            iPopup.Sections[index].Add("Click powers to enable/disable them.", PopUp.Colors.Title);
            iPopup.Sections[index]
            .Add("Powers in gray (or your custom 'power disabled' color) cannot be included in your stats.",
                 PopUp.Colors.Text, 0.9f);
            PopInfo.SetPopup(iPopup);
            ChangedScrollFrameContents();
            FillLists("Alpha");
        }
        public PopUp.PopupData PopInfo()
        {
            PopUp.PopupData popupData = default(PopUp.PopupData);
            int             index2    = popupData.Add(null);

            popupData.Sections[index2].Add(this.DisplayName, PopUp.Colors.Title, 1.25f, FontStyle.Bold, 0);
            popupData.Sections[index2].Add(this.DescShort, PopUp.Colors.Effect, 1f, FontStyle.Bold, 0);
            popupData.Sections[index2].Add(this.DescLong, PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
            index2 = popupData.Add(null);
            popupData.Sections[index2].Add("You can't change archetype once a build has been started.\nIf you want to pick a different archetype, you need to clear the current build and start a new one.", PopUp.Colors.Effect, 0.9f, FontStyle.Bold, 0);
            return(popupData);
        }
Beispiel #5
0
        public PopUp.PopupData PopInfo()
        {
            var popupData = new PopUp.PopupData();
            var index1    = popupData.Add();

            popupData.Sections[index1].Add(DisplayName, PopUp.Colors.Title, 1.25f);
            popupData.Sections[index1].Add(DescShort, PopUp.Colors.Effect);
            popupData.Sections[index1].Add(DescLong, PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
            var index2 = popupData.Add();

            popupData.Sections[index2]
            .Add(
                "You can't change archetype once a build has been started.\nIf you want to pick a different archetype, you need to clear the current build and start a new one.",
                PopUp.Colors.Effect, 0.9f);
            return(popupData);
        }
Beispiel #6
0
        void frmIncarnate_Load(object sender, EventArgs e)
        {
            this.buttonArray[0] = this.alphaBtn;
            this.buttonArray[1] = this.destinyBtn;
            this.buttonArray[2] = this.hybridBtn;
            this.buttonArray[3] = this.interfaceBtn;
            this.buttonArray[4] = this.judgementBtn;
            this.buttonArray[5] = this.loreBtn;
            this.buttonArray[6] = this.GenesisButton;
            this.buttonArray[7] = this.StanceButton;
            this.buttonArray[8] = this.VitaeButton;
            this.buttonArray[9] = this.OmegaButton;
            foreach (ImageButton button in this.buttonArray)
            {
                button.IA       = this.myParent.Drawing.pImageAttributes;
                button.ImageOff = this.myParent.Drawing.bxPower[2].Bitmap;
                button.ImageOn  = this.myParent.Drawing.bxPower[3].Bitmap;
            }
            this.BackColor         = this.myParent.BackColor;
            this.PopInfo.ForeColor = this.BackColor;
            ListLabelV2 llRight = this.llLeft;

            this.UpdateLLColours(ref llRight);
            this.llLeft = llRight;
            llRight     = this.llRight;
            this.UpdateLLColours(ref llRight);
            this.llRight          = llRight;
            this.ibClose.IA       = this.myParent.Drawing.pImageAttributes;
            this.ibClose.ImageOff = this.myParent.Drawing.bxPower[2].Bitmap;
            this.ibClose.ImageOn  = this.myParent.Drawing.bxPower[3].Bitmap;
            PopUp.PopupData iPopup = default(PopUp.PopupData);
            int             index  = iPopup.Add(null);

            iPopup.Sections[index].Add("Click powers to enable/disable them.", PopUp.Colors.Title, 1f, FontStyle.Bold, 0);
            iPopup.Sections[index].Add("Powers in gray (or your custom 'power disabled' color) cannot be included in your stats.", PopUp.Colors.Text, 0.9f, FontStyle.Bold, 0);
            this.PopInfo.SetPopup(iPopup);
            this.ChangedScrollFrameContents();
            this.FillLists();
        }
Beispiel #7
0
        void frmAccolade_Load(object sender, EventArgs e)
        {
            this.BackColor         = this._myParent.BackColor;
            this.PopInfo.ForeColor = this.BackColor;
            ListLabelV2 llRight = this.llLeft;

            frmAccolade.UpdateLlColours(ref llRight);
            this.llLeft = llRight;
            llRight     = this.llRight;
            frmAccolade.UpdateLlColours(ref llRight);
            this.llRight          = llRight;
            this.ibClose.IA       = this._myParent.Drawing.pImageAttributes;
            this.ibClose.ImageOff = this._myParent.Drawing.bxPower[2].Bitmap;
            this.ibClose.ImageOn  = this._myParent.Drawing.bxPower[3].Bitmap;
            PopUp.PopupData iPopup = default(PopUp.PopupData);
            int             index  = iPopup.Add(null);

            iPopup.Sections[index].Add("Click powers to enable/disable them.", PopUp.Colors.Title, 1f, FontStyle.Bold, 0);
            iPopup.Sections[index].Add("Powers in gray (or your custom 'power disabled' color) cannot be included in your stats.", PopUp.Colors.Text, 0.9f, FontStyle.Bold, 0);
            this.PopInfo.SetPopup(iPopup);
            this.ChangedScrollFrameContents();
            this.FillLists();
        }
Beispiel #8
0
        private void MiniPowerInfo(int pIDX)
        {
            if (_locked)
            {
                return;
            }
            IPower power1 = new Power(_myPetPowers[pIDX]);
            var    iPopup = new PopUp.PopupData();

            if (pIDX < 0)
            {
                PopInfo.SetPopup(iPopup);
                ChangedScrollFrameContents();
            }
            else
            {
                var index1 = iPopup.Add();
                var str    = string.Empty;
                switch (power1.PowerType)
                {
                case Enums.ePowerType.Click:
                    if (power1.ClickBuff)
                    {
                        str = "(Click)";
                    }
                    break;

                case Enums.ePowerType.Auto_:
                    str = "(Auto)";
                    break;

                case Enums.ePowerType.Toggle:
                    str = "(Toggle)";
                    break;
                }

                iPopup.Sections[index1].Add(power1.DisplayName, PopUp.Colors.Title);
                iPopup.Sections[index1].Add(str + " " + power1.DescShort, PopUp.Colors.Text, 0.9f);
                var index2 = iPopup.Add();
                if (power1.EndCost > 0.0)
                {
                    if (power1.ActivatePeriod > 0.0)
                    {
                        iPopup.Sections[index2].Add("End Cost:", PopUp.Colors.Title,
                                                    Utilities.FixDP(power1.EndCost / power1.ActivatePeriod) + "/s",
                                                    PopUp.Colors.Title, 0.9f, FontStyle.Bold, 1);
                    }
                    else
                    {
                        iPopup.Sections[index2].Add("End Cost:", PopUp.Colors.Title,
                                                    Utilities.FixDP(power1.EndCost), PopUp.Colors.Title, 0.9f, FontStyle.Bold, 1);
                    }
                }

                if ((power1.EntitiesAutoHit == Enums.eEntity.None) | ((power1.Range > 20.0) &
                                                                      power1.I9FXPresentP(Enums.eEffectType.Mez,
                                                                                          Enums.eMez.Taunt)))
                {
                    iPopup.Sections[index2].Add("Accuracy:", PopUp.Colors.Title,
                                                Utilities.FixDP((float)(MidsContext.Config.BaseAcc * (double)power1.Accuracy *
                                                                        100.0)) + "%", PopUp.Colors.Title, 0.9f, FontStyle.Bold,
                                                1);
                }
                if (power1.RechargeTime > 0.0)
                {
                    iPopup.Sections[index2].Add("Recharge:", PopUp.Colors.Title,
                                                Utilities.FixDP(power1.RechargeTime) + "s", PopUp.Colors.Title, 0.9f,
                                                FontStyle.Bold, 1);
                }
                var durationEffectId = power1.GetDurationEffectID();
                var iNum             = 0.0f;
                if (durationEffectId > -1)
                {
                    iNum = power1.Effects[durationEffectId].Duration;
                }
                if ((power1.PowerType != Enums.ePowerType.Toggle) &
                    (power1.PowerType != Enums.ePowerType.Auto_) && iNum > 0.0)
                {
                    iPopup.Sections[index2].Add("Duration:", PopUp.Colors.Title,
                                                Utilities.FixDP(iNum) + "s", PopUp.Colors.Title, 0.9f, FontStyle.Bold, 1);
                }
                if (power1.Range > 0.0)
                {
                    iPopup.Sections[index2].Add("Range:", PopUp.Colors.Title,
                                                Utilities.FixDP(power1.Range) + "ft", PopUp.Colors.Title, 0.9f, FontStyle.Bold, 1);
                }
                if (power1.Arc > 0)
                {
                    iPopup.Sections[index2].Add("Arc:", PopUp.Colors.Title,
                                                Convert.ToString(power1.Arc) + "°", PopUp.Colors.Title, 0.9f, FontStyle.Bold, 1);
                }
                else if (power1.Radius > 0.0)
                {
                    iPopup.Sections[index2].Add("Radius:", PopUp.Colors.Title,
                                                Convert.ToString(power1.Radius, CultureInfo.InvariantCulture) + "ft",
                                                PopUp.Colors.Title, 0.9f, FontStyle.Bold, 1);
                }
                if (power1.CastTime > 0.0)
                {
                    iPopup.Sections[index2].Add("Cast Time:", PopUp.Colors.Title,
                                                Utilities.FixDP(power1.CastTime) + "s", PopUp.Colors.Title, 0.9f, FontStyle.Bold,
                                                1);
                }
                var power2 = power1;
                if (power2.Effects.Length > 0)
                {
                    iPopup.Sections[index2].Add("Effects:", PopUp.Colors.Title);
                    char[] chArray = { '^' };
                    var    num1    = power2.Effects.Length - 1;
                    for (var index3 = 0; index3 <= num1; ++index3)
                    {
                        var index4 = iPopup.Add();
                        power1.Effects[index3].SetPower(power1);
                        var strArray = power1.Effects[index3].BuildEffectString().Replace("[", "\r\n")
                                       .Replace("\r\n", "^").Replace("  ", string.Empty).Replace("]", string.Empty)
                                       .Split(chArray);
                        var num2 = strArray.Length - 1;
                        for (var index5 = 0; index5 <= num2; ++index5)
                        {
                            if (index5 == 0)
                            {
                                iPopup.Sections[index4].Add(strArray[index5], PopUp.Colors.Effect, 0.9f,
                                                            FontStyle.Bold, 1);
                            }
                            else
                            {
                                iPopup.Sections[index4].Add(strArray[index5], PopUp.Colors.Disabled, 0.9f,
                                                            FontStyle.Italic, 2);
                            }
                        }
                    }
                }

                PopInfo.SetPopup(iPopup);
                ChangedScrollFrameContents();
            }
        }
 // Token: 0x06000127 RID: 295 RVA: 0x0000A834 File Offset: 0x00008A34
 public void SetPopup(PopUp.PopupData iPopup)
 {
     this.pData = iPopup;
     this.Draw();
 }
Beispiel #10
0
        PopUp.PopupData BuildList(bool Mini)

        {
            int iIndent = 1;

            PopUp.PopupData popupData         = new PopUp.PopupData();
            frmRecipeViewer.CountingList[] tl = new frmRecipeViewer.CountingList[0];
            if (this.lvDPA.SelectedIndices.Count >= 1)
            {
                if (this.lvDPA.SelectedIndices[0] == 0)
                {
                    int[] numArray1 = new int[DatabaseAPI.Database.Salvage.Length - 1 + 1];
                    int   num1      = 0;
                    int   num2      = 0;
                    int   num3      = 0;
                    int   num4      = 0;
                    this.DrawIcon(-1);
                    int[][] numArray2 = new int[DatabaseAPI.Database.Recipes.Length - 1 + 1][];
                    int     num5      = numArray2.Length - 1;
                    for (int index = 0; index <= num5; ++index)
                    {
                        int[] numArray3 = new int[DatabaseAPI.Database.Recipes[index].Item.Length - 1 + 1];
                        numArray2[index] = numArray3;
                    }
                    int num6 = this.lvDPA.Items.Count - 1;
                    for (int index1 = 1; index1 <= num6; ++index1)
                    {
                        int rIDX = DatabaseAPI.Database.Enhancements[Conversions.ToInteger(this.lvDPA.Items[index1].Tag)].RecipeIDX;
                        if (this.lvDPA.Items[index1].SubItems[1].Text == "*")
                        {
                            rIDX = -1;
                            frmRecipeViewer.putInList(ref tl, this.lvDPA.Items[index1].Text);
                        }
                        if (rIDX > -1)
                        {
                            int iLevel = Conversions.ToInteger(this.lvDPA.Items[index1].SubItems[1].Text) - 1;
                            int itemId = frmRecipeViewer.FindItemID(rIDX, iLevel);
                            if (itemId > -1)
                            {
                                if (this.chkRecipe.Checked)
                                {
                                    ++numArray2[rIDX][itemId];
                                }
                                Recipe.RecipeEntry recipeEntry = DatabaseAPI.Database.Recipes[rIDX].Item[itemId];
                                int num7 = recipeEntry.SalvageIdx.Length - 1;
                                for (int index2 = 0; index2 <= num7; ++index2)
                                {
                                    if (recipeEntry.SalvageIdx[index2] > -1 & recipeEntry.Count[index2] > 0)
                                    {
                                        if (!(index2 != 0 & recipeEntry.SalvageIdx[index2] == recipeEntry.SalvageIdx[0]))
                                        {
                                            numArray1[recipeEntry.SalvageIdx[index2]] += recipeEntry.Count[index2];
                                            num4 += recipeEntry.Count[index2];
                                        }
                                        else
                                        {
                                            break;
                                        }
                                    }
                                }
                                num1 += recipeEntry.CraftCost;
                                if (recipeEntry.CraftCostM > 0)
                                {
                                    num3 += recipeEntry.CraftCostM;
                                }
                                else if (DatabaseAPI.Database.Enhancements[Conversions.ToInteger(this.lvDPA.Items[index1].Tag)].TypeID == Enums.eType.SetO)
                                {
                                    num3 += recipeEntry.CraftCost;
                                }
                                num2 += recipeEntry.BuyCost;
                            }
                        }
                    }
                    int index3 = popupData.Add(null);
                    if (Mini)
                    {
                        iIndent = 0;
                    }
                    this.lblHeader.Text = "Shopping List";
                    if (this.lvPower.CheckedIndices.Count == 1)
                    {
                        if (!this.lvPower.Items[0].Checked)
                        {
                            popupData.Sections[index3].Add(DatabaseAPI.Database.Power[MidsContext.Character.CurrentBuild.Powers[Conversions.ToInteger(this.lvPower.CheckedItems[0].Tag)].NIDPower].DisplayName, PopUp.Colors.Title, 1f, System.Drawing.FontStyle.Bold, 0);
                        }
                        else
                        {
                            popupData.Sections[index3].Add("All Powers", PopUp.Colors.Title, 1f, System.Drawing.FontStyle.Bold, 0);
                        }
                    }
                    else
                    {
                        popupData.Sections[index3].Add(Conversions.ToString(this.lvPower.CheckedIndices.Count) + " Powers", PopUp.Colors.Title, 1f, System.Drawing.FontStyle.Bold, 0);
                    }
                    if (!this.chkRecipe.Checked)
                    {
                        popupData.Sections[index3].Add(Conversions.ToString(this.lvDPA.Items.Count - this.nonRecipeCount) + " Recipes:", PopUp.Colors.Title, 1f, System.Drawing.FontStyle.Bold, 0);
                    }
                    if (Mini)
                    {
                        string str = "Buy:";
                        if (num2 > 0)
                        {
                            popupData.Sections[index3].Add(str + " " + Strings.Format(num2, "###,###,##0"), PopUp.Colors.Invention, 0.9f, System.Drawing.FontStyle.Bold, iIndent);
                        }
                    }
                    else
                    {
                        string iText = "Buy Cost:";
                        if (num2 > 0)
                        {
                            popupData.Sections[index3].Add(iText, PopUp.Colors.Invention, Strings.Format(num2, "###,###,##0"), PopUp.Colors.Invention, 0.9f, System.Drawing.FontStyle.Bold, iIndent);
                        }
                    }
                    if (Mini)
                    {
                        string str = "Craft:";
                        if (num1 > 0)
                        {
                            popupData.Sections[index3].Add(str + " " + Strings.Format(num1, "###,###,##0"), PopUp.Colors.Invention, 0.9f, System.Drawing.FontStyle.Bold, iIndent);
                        }
                    }
                    else
                    {
                        string iText = "Craft Cost:";
                        if (num1 > 0)
                        {
                            popupData.Sections[index3].Add(iText, PopUp.Colors.Invention, Strings.Format(num1, "###,###,##0"), PopUp.Colors.Invention, 0.9f, System.Drawing.FontStyle.Bold, iIndent);
                        }
                    }
                    if (Mini)
                    {
                        string str = "Craft (Mem'd):";
                        if (num3 > 0 & num3 != num1)
                        {
                            popupData.Sections[index3].Add(str + " " + Strings.Format(num3, "###,###,##0"), PopUp.Colors.Effect, 0.9f, System.Drawing.FontStyle.Bold, iIndent);
                        }
                    }
                    else
                    {
                        string iText = "Craft Cost (Memorized Common):";
                        if (num3 > 0 & num3 != num1)
                        {
                            popupData.Sections[index3].Add(iText, PopUp.Colors.Effect, Strings.Format(num3, "###,###,##0"), PopUp.Colors.Effect, 0.9f, System.Drawing.FontStyle.Bold, iIndent);
                        }
                    }
                    if (this.chkRecipe.Checked)
                    {
                        this.RecipeInfo.ColumnPosition = 0.75f;
                        int index1 = popupData.Add(null);
                        popupData.Sections[index1].Add(Conversions.ToString(this.lvDPA.Items.Count - this.nonRecipeCount) + " Recipes:", PopUp.Colors.Title, 1f, System.Drawing.FontStyle.Bold, 0);
                        int num7 = numArray2.Length - 1;
                        for (int index2 = 0; index2 <= num7; ++index2)
                        {
                            int num8 = numArray2[index2].Length - 1;
                            for (int index4 = 0; index4 <= num8; ++index4)
                            {
                                if (numArray2[index2][index4] > 0)
                                {
                                    Color color;
                                    switch (DatabaseAPI.Database.Recipes[index2].Rarity)
                                    {
                                    case Recipe.RecipeRarity.Uncommon:
                                        color = PopUp.Colors.Uncommon;
                                        break;

                                    case Recipe.RecipeRarity.Rare:
                                        color = PopUp.Colors.Rare;
                                        break;

                                    case Recipe.RecipeRarity.UltraRare:
                                        color = PopUp.Colors.UltraRare;
                                        break;

                                    default:
                                        color = PopUp.Colors.Text;
                                        break;
                                    }
                                    if (Mini)
                                    {
                                        popupData.Sections[index1].Add(" " + Conversions.ToString(numArray2[index2][index4]) + " x", color, DatabaseAPI.GetEnhancementNameShortWSet(DatabaseAPI.Database.Recipes[index2].EnhIdx) + " (" + Conversions.ToString(DatabaseAPI.Database.Recipes[index2].Item[index4].Level + 1) + ")", color, 0.9f, System.Drawing.FontStyle.Bold, iIndent);
                                    }
                                    else
                                    {
                                        popupData.Sections[index1].Add(DatabaseAPI.GetEnhancementNameShortWSet(DatabaseAPI.Database.Recipes[index2].EnhIdx) + " (" + Conversions.ToString(DatabaseAPI.Database.Recipes[index2].Item[index4].Level + 1) + ")", color, Conversions.ToString(numArray2[index2][index4]), color, 0.9f, System.Drawing.FontStyle.Bold, iIndent);
                                    }
                                }
                            }
                        }
                        popupData.Sections[index1].Content = frmRecipeViewer.sortPopupStrings(Mini, 2, popupData.Sections[index1].Content);
                    }
                    else
                    {
                        this.RecipeInfo.ColumnPosition = 0.5f;
                    }
                    if (Mini)
                    {
                        popupData.ColPos   = 0.15f;
                        popupData.ColRight = false;
                    }
                    int    index5 = popupData.Add(null);
                    string iText1 = !Mini?Conversions.ToString(num4) + " Salvage Items:" : Conversions.ToString(num4) + " Items:";

                    popupData.Sections[index5].Add(iText1, PopUp.Colors.Title, 1f, System.Drawing.FontStyle.Bold, 0);
                    int num9 = numArray1.Length - 1;
                    for (int index1 = 0; index1 <= num9; ++index1)
                    {
                        if (numArray1[index1] > 0)
                        {
                            Color color = System.Drawing.Color.White;
                            switch (DatabaseAPI.Database.Salvage[index1].Rarity)
                            {
                            case Recipe.RecipeRarity.Common:
                                color = PopUp.Colors.Common;
                                break;

                            case Recipe.RecipeRarity.Uncommon:
                                color = PopUp.Colors.Uncommon;
                                break;

                            case Recipe.RecipeRarity.Rare:
                                color = PopUp.Colors.Rare;
                                break;
                            }
                            if (Mini)
                            {
                                popupData.Sections[index5].Add(" " + Conversions.ToString(numArray1[index1]) + " x", color, DatabaseAPI.Database.Salvage[index1].ExternalName, color, 0.9f, System.Drawing.FontStyle.Bold, 0);
                            }
                            else
                            {
                                popupData.Sections[index5].Add(DatabaseAPI.Database.Salvage[index1].ExternalName, color, Conversions.ToString(numArray1[index1]), color, 0.9f, System.Drawing.FontStyle.Bold, 1);
                            }
                        }
                    }
                    popupData.Sections[index5].Content = frmRecipeViewer.sortPopupStrings(Mini, 1, popupData.Sections[index5].Content);
                    if (this.nonRecipeCount != 1)
                    {
                        int    index1 = popupData.Add(null);
                        string iText2 = !Mini?Conversions.ToString(this.nonRecipeCount - 1) + " Non-Crafted Enhancements:" : Conversions.ToString(this.nonRecipeCount - 1) + " Enhs:";

                        popupData.Sections[index1].Add(iText2, PopUp.Colors.Title, 1f, System.Drawing.FontStyle.Bold, 0);
                        int num7 = tl.Length - 1;
                        for (int index2 = 0; index2 <= num7; ++index2)
                        {
                            Color common = PopUp.Colors.Common;
                            if (Mini)
                            {
                                popupData.Sections[index1].Add(" " + Conversions.ToString(tl[index2].Count) + " x", common, tl[index2].Text, common, 0.9f, System.Drawing.FontStyle.Bold, 0);
                            }
                            else
                            {
                                popupData.Sections[index1].Add(tl[index2].Text, common, Conversions.ToString(tl[index2].Count), common, 0.9f, System.Drawing.FontStyle.Bold, 1);
                            }
                        }
                        popupData.Sections[index1].Content = frmRecipeViewer.sortPopupStrings(Mini, 1, popupData.Sections[index1].Content);
                    }
                    return(popupData);
                }
                this.lblHeader.Text = DatabaseAPI.Database.Enhancements[Conversions.ToInteger(this.lvDPA.SelectedItems[0].Tag)].LongName + " (" + this.lvDPA.SelectedItems[0].SubItems[1].Text + ")";
                int rIdx = DatabaseAPI.Database.Enhancements[Conversions.ToInteger(this.lvDPA.SelectedItems[0].Tag)].RecipeIDX;
                if (this.lvDPA.SelectedItems[0].SubItems[1].Text == "*")
                {
                    rIdx = -1;
                }
                this.DrawIcon(Conversions.ToInteger(this.lvDPA.SelectedItems[0].Tag));
                if (rIdx > -1)
                {
                    int index1 = popupData.Add(null);
                    popupData.Sections[index1] = Character.PopRecipeInfo(rIdx, Conversions.ToInteger(this.lvDPA.SelectedItems[0].SubItems[1].Text) - 1);
                    if (popupData.Sections[index1].Content != null && popupData.Sections[index1].Content.Length > 0)
                    {
                        PopUp.StringValue[] content = popupData.Sections[index1].Content;
                        int index2 = 0;
                        content[index2].Text = content[index2].Text + " (" + this.lvDPA.SelectedItems[0].SubItems[1].Text + ")";
                        return(popupData);
                    }
                    popupData.Sections[index1].Content[0].Text = "";
                }
            }
            return(popupData);
        }
 public void UpdateData(int powerID)
 {
     PopUp.PopupData iPopup = new PopUp.PopupData();
     if (powerID > -1)
     {
         IPower power1 = DatabaseAPI.Database.Power[powerID];
         int    index1 = iPopup.Add();
         iPopup.Sections[index1].Add(DatabaseAPI.Database.Power[powerID].DisplayName, PopUp.Colors.Title, 1.25f);
         iPopup.Sections[index1].Add("Unbuffed Power Data", PopUp.Colors.Title);
         int index2 = iPopup.Add();
         iPopup.Sections[index2].Add("Attributes:", PopUp.Colors.Title);
         iPopup.Sections[index2].Add("Power Type:", PopUp.Colors.Text, Enum.GetName(power1.PowerType.GetType(), power1.PowerType), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         iPopup.Sections[index2].Add("Accuracy:", PopUp.Colors.Text, TwoDP(power1.Accuracy), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         if (power1.ActivatePeriod > 0.0)
         {
             iPopup.Sections[index2].Add("Activate Interval:", PopUp.Colors.Text, Convert.ToString(power1.ActivatePeriod) + "s", PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         }
         if (power1.Arc > 0)
         {
             iPopup.Sections[index2].Add("Arc Radius:", PopUp.Colors.Text, Convert.ToString(power1.Arc) + "°", PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         }
         if (power1.AttackTypes != Enums.eVector.None)
         {
             int[] values = (int[])Enum.GetValues(power1.AttackTypes.GetType());
             bool  flag   = true;
             int   num    = values.Length - 1;
             for (int index3 = 1; index3 <= num; ++index3)
             {
                 if ((power1.AttackTypes & (Enums.eVector)values[index3]) <= Enums.eVector.None)
                 {
                     continue;
                 }
                 string iText;
                 if (flag)
                 {
                     iText = "Attack Type(s):";
                     flag  = false;
                 }
                 else
                 {
                     iText = "";
                 }
                 iPopup.Sections[index2].Add(iText, PopUp.Colors.Text, Enum.GetName(power1.AttackTypes.GetType(), values[index3]), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
             }
         }
         iPopup.Sections[index2].Add("Cast Time:", PopUp.Colors.Text, TwoDP(power1.CastTime) + "s", PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         iPopup.Sections[index2].Add("Effect Area:", PopUp.Colors.Text, Enum.GetName(power1.EffectArea.GetType(), power1.EffectArea), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         iPopup.Sections[index2].Add("End Cost:", PopUp.Colors.Text, TwoDP(power1.EndCost), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         iPopup.Sections[index2].Add("Auto-Hit:", PopUp.Colors.Text, Enum.GetName(power1.EntitiesAutoHit.GetType(), power1.EntitiesAutoHit), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         if (Math.Abs(power1.InterruptTime) > float.Epsilon)
         {
             iPopup.Sections[index2].Add("Interrupt:", PopUp.Colors.Text, TwoDP(power1.InterruptTime) + "s", PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         }
         iPopup.Sections[index2].Add("Level Available:", PopUp.Colors.Text, Convert.ToString(power1.Level), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         iPopup.Sections[index2].Add("Max Targets:", PopUp.Colors.Text, Convert.ToString(power1.MaxTargets), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         iPopup.Sections[index2].Add("Notify Mobs:", PopUp.Colors.Text, Enum.GetName(power1.AIReport.GetType(), power1.AIReport), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         if (Math.Abs(power1.Radius) > float.Epsilon)
         {
             iPopup.Sections[index2].Add("Radius:", PopUp.Colors.Text, Convert.ToString(power1.Radius) + "ft", PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         }
         if (Math.Abs(power1.Range) > float.Epsilon)
         {
             iPopup.Sections[index2].Add("Range:", PopUp.Colors.Text, Convert.ToString(power1.Range) + "ft", PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         }
         iPopup.Sections[index2].Add("RechargeTime:", PopUp.Colors.Text, Convert.ToString(power1.RechargeTime) + "s", PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         iPopup.Sections[index2].Add("Target:", PopUp.Colors.Text, Enum.GetName(power1.EntitiesAffected.GetType(), power1.EntitiesAffected), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         iPopup.Sections[index2].Add("Line of Sight:", PopUp.Colors.Text, Convert.ToString(power1.TargetLoS), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         iPopup.Sections[index2].Add("Variable:", PopUp.Colors.Text, Convert.ToString(power1.VariableEnabled), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         if (power1.VariableEnabled)
         {
             iPopup.Sections[index2].Add("Attrib:", PopUp.Colors.Text, power1.VariableName, PopUp.Colors.Text, 0.9f, FontStyle.Bold, 2);
             iPopup.Sections[index2].Add("Min:", PopUp.Colors.Text, Convert.ToString(power1.VariableMin), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 2);
             iPopup.Sections[index2].Add("Max:", PopUp.Colors.Text, Convert.ToString(power1.VariableMax), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 2);
         }
         if (power1.Effects.Length > 0)
         {
             int index3 = iPopup.Add();
             iPopup.Sections[index3].Add("Effects:", PopUp.Colors.Title);
             IPower power2  = new Power(DatabaseAPI.Database.Power[powerID]);
             char[] chArray = { '^' };
             int    num1    = power1.Effects.Length - 1;
             for (int index4 = 0; index4 <= num1; ++index4)
             {
                 int index5 = iPopup.Add();
                 power2.Effects[index4].SetPower(power2);
                 string[] strArray = power2.Effects[index4].BuildEffectString().Replace("[", "\r\n").Replace("\r\n", "^").Replace("  ", "").Replace("]", "").Split(chArray);
                 int      num2     = strArray.Length - 1;
                 for (int index6 = 0; index6 <= num2; ++index6)
                 {
                     if (index6 == 0)
                     {
                         iPopup.Sections[index5].Add(strArray[index6], PopUp.Colors.Effect, 0.9f, FontStyle.Bold, 1);
                     }
                     else
                     {
                         iPopup.Sections[index5].Add(strArray[index6], PopUp.Colors.Disabled, 0.9f, FontStyle.Italic, 2);
                     }
                 }
             }
         }
     }
     else
     {
         int index = iPopup.Add();
         iPopup.Sections[index].Add("No Power", PopUp.Colors.Title, 1.25f);
     }
     pInfo.SetPopup(iPopup);
     pInfo.Width = ClientSize.Width;
 }
Beispiel #12
0
        public void miniPowerInfo(int pIDX)
        {
            if (!this.Locked)
            {
                IPower power = new Power(this.myPowers[pIDX]);
                power.AbsorbPetEffects(-1);
                power.ApplyGrantPowerEffects();
                PopUp.PopupData iPopup = default(PopUp.PopupData);
                if (pIDX < 0)
                {
                    this.PopInfo.SetPopup(iPopup);
                    this.ChangedScrollFrameContents();
                }
                else
                {
                    int    index4 = iPopup.Add(null);
                    string str    = "";
                    switch (power.PowerType)
                    {
                    case Enums.ePowerType.Click:
                        if (power.ClickBuff)
                        {
                            str = "(Click)";
                        }
                        break;

                    case Enums.ePowerType.Auto_:
                        str = "(Auto)";
                        break;

                    case Enums.ePowerType.Toggle:
                        str = "(Toggle)";
                        break;
                    }
                    iPopup.Sections[index4].Add(power.DisplayName, PopUp.Colors.Title, 1f, FontStyle.Bold, 0);
                    iPopup.Sections[index4].Add(str + " " + power.DescShort, PopUp.Colors.Text, 0.9f, FontStyle.Bold, 0);
                    string str2 = power.DescLong.Replace("<br>", "\r\n");
                    iPopup.Sections[index4].Add(str + " " + str2, PopUp.Colors.Common, 1f, FontStyle.Regular, 0);
                    index4 = iPopup.Add(null);
                    if (power.EndCost > 0f)
                    {
                        if (power.ActivatePeriod > 0f)
                        {
                            iPopup.Sections[index4].Add("End Cost:", PopUp.Colors.Title, Utilities.FixDP(power.EndCost / power.ActivatePeriod) + "/s", PopUp.Colors.Title, 0.9f, FontStyle.Bold, 1);
                        }
                        else
                        {
                            iPopup.Sections[index4].Add("End Cost:", PopUp.Colors.Title, Utilities.FixDP(power.EndCost), PopUp.Colors.Title, 0.9f, FontStyle.Bold, 1);
                        }
                    }
                    if (power.EntitiesAutoHit == Enums.eEntity.None | (power.Range > 20f & power.I9FXPresentP(Enums.eEffectType.Mez, Enums.eMez.Taunt)))
                    {
                        iPopup.Sections[index4].Add("Accuracy:", PopUp.Colors.Title, Utilities.FixDP(MidsContext.Config.BaseAcc * power.Accuracy * 100f) + "%", PopUp.Colors.Title, 0.9f, FontStyle.Bold, 1);
                    }
                    if (power.RechargeTime > 0f)
                    {
                        iPopup.Sections[index4].Add("Recharge:", PopUp.Colors.Title, Utilities.FixDP(power.RechargeTime) + "s", PopUp.Colors.Title, 0.9f, FontStyle.Bold, 1);
                    }
                    int   durationEffectId = power.GetDurationEffectID();
                    float iNum             = 0f;
                    if (durationEffectId > -1)
                    {
                        iNum = power.Effects[durationEffectId].Duration;
                    }
                    if ((power.PowerType != Enums.ePowerType.Toggle & power.PowerType != Enums.ePowerType.Auto_) && iNum > 0f)
                    {
                        iPopup.Sections[index4].Add("Duration:", PopUp.Colors.Title, Utilities.FixDP(iNum) + "s", PopUp.Colors.Title, 0.9f, FontStyle.Bold, 1);
                    }
                    if (power.Range > 0f)
                    {
                        iPopup.Sections[index4].Add("Range:", PopUp.Colors.Title, Utilities.FixDP(power.Range) + "ft", PopUp.Colors.Title, 0.9f, FontStyle.Bold, 1);
                    }
                    if (power.Arc > 0)
                    {
                        iPopup.Sections[index4].Add("Arc:", PopUp.Colors.Title, Conversions.ToString(power.Arc) + "°", PopUp.Colors.Title, 0.9f, FontStyle.Bold, 1);
                    }
                    else if (power.Radius > 0f)
                    {
                        iPopup.Sections[index4].Add("Radius:", PopUp.Colors.Title, Conversions.ToString(power.Radius) + "ft", PopUp.Colors.Title, 0.9f, FontStyle.Bold, 1);
                    }
                    if (power.CastTime > 0f)
                    {
                        iPopup.Sections[index4].Add("Cast Time:", PopUp.Colors.Title, Utilities.FixDP(power.CastTime) + "s", PopUp.Colors.Title, 0.9f, FontStyle.Bold, 1);
                    }
                    IPower power2 = power;
                    if (power2.Effects.Length > 0)
                    {
                        iPopup.Sections[index4].Add("Effects:", PopUp.Colors.Title, 1f, FontStyle.Bold, 0);
                        char[] chArray = new char[]
                        {
                            '^'
                        };
                        int num = power2.Effects.Length - 1;
                        for (int index5 = 0; index5 <= num; index5++)
                        {
                            if ((power2.Effects[index5].EffectType != Enums.eEffectType.GrantPower | power2.Effects[index5].Absorbed_Effect) & power2.Effects[index5].EffectType != Enums.eEffectType.RevokePower & power2.Effects[index5].EffectType != Enums.eEffectType.SetMode)
                            {
                                index4 = iPopup.Add(null);
                                power.Effects[index5].Power = power;
                                string[] strArray = power.Effects[index5].BuildEffectString(false, "", false, false, false).Replace("[", "\r\n").Replace("\r\n", "^").Replace("  ", "").Replace("]", "").Split(chArray);
                                int      num2     = strArray.Length - 1;
                                for (int index6 = 0; index6 <= num2; index6++)
                                {
                                    if (index6 == 0)
                                    {
                                        iPopup.Sections[index4].Add(strArray[index6], PopUp.Colors.Effect, 0.9f, FontStyle.Bold, 1);
                                    }
                                    else
                                    {
                                        iPopup.Sections[index4].Add(strArray[index6], PopUp.Colors.Disabled, 0.9f, FontStyle.Italic, 2);
                                    }
                                }
                            }
                        }
                    }
                    this.PopInfo.SetPopup(iPopup);
                    this.ChangedScrollFrameContents();
                }
            }
        }
        private PopUp.PopupData BuildList(bool Mini)
        {
            var iIndent   = 1;
            var popupData = new PopUp.PopupData();
            var tl        = new CountingList[0];

            if (lvDPA.SelectedIndices.Count < 1 || lvDPA.SelectedItems[0].Text.Contains("Superior"))
            {
                return(popupData);
            }
            if (lvDPA.SelectedIndices[0] == 0)
            {
                var numArray1 = new int[DatabaseAPI.Database.Salvage.Length - 1 + 1];
                var num1      = 0;
                var num2      = 0;
                var num3      = 0;
                var num4      = 0;
                DrawIcon(-1);
                var numArray2 = new int[DatabaseAPI.Database.Recipes.Length - 1 + 1][];
                var num5      = numArray2.Length - 1;
                for (var index = 0; index <= num5; ++index)
                {
                    var numArray3 = new int[DatabaseAPI.Database.Recipes[index].Item.Length - 1 + 1];
                    numArray2[index] = numArray3;
                }

                var num6 = lvDPA.Items.Count - 1;
                for (var index1 = 1; index1 <= num6; ++index1)
                {
                    var rIDX = DatabaseAPI.Database.Enhancements[Convert.ToInt32(lvDPA.Items[index1].Tag)].RecipeIDX;
                    if (lvDPA.Items[index1].SubItems[1].Text == "*")
                    {
                        rIDX = -1;
                        putInList(ref tl, lvDPA.Items[index1].Text);
                    }

                    if (rIDX <= -1)
                    {
                        continue;
                    }
                    var iLevel = Convert.ToInt32(lvDPA.Items[index1].SubItems[1].Text) - 1;
                    var itemId = FindItemID(rIDX, iLevel);
                    if (itemId <= -1)
                    {
                        continue;
                    }
                    if (chkRecipe.Checked)
                    {
                        ++numArray2[rIDX][itemId];
                    }
                    var recipeEntry = DatabaseAPI.Database.Recipes[rIDX].Item[itemId];
                    var num7        = recipeEntry.SalvageIdx.Length - 1;
                    for (var index2 = 0; index2 <= num7; ++index2)
                    {
                        if (!((recipeEntry.SalvageIdx[index2] > -1) & (recipeEntry.Count[index2] > 0)))
                        {
                            continue;
                        }
                        if (!((index2 != 0) & (recipeEntry.SalvageIdx[index2] == recipeEntry.SalvageIdx[0])))
                        {
                            numArray1[recipeEntry.SalvageIdx[index2]] += recipeEntry.Count[index2];
                            num4 += recipeEntry.Count[index2];
                        }
                        else
                        {
                            break;
                        }
                    }

                    num1 += recipeEntry.CraftCost;
                    if (recipeEntry.CraftCostM > 0)
                    {
                        num3 += recipeEntry.CraftCostM;
                    }
                    else if (DatabaseAPI.Database.Enhancements[Convert.ToInt32(lvDPA.Items[index1].Tag)].TypeID ==
                             Enums.eType.SetO)
                    {
                        num3 += recipeEntry.CraftCost;
                    }
                    num2 += recipeEntry.BuyCost;
                }

                var index3 = popupData.Add();
                if (Mini)
                {
                    iIndent = 0;
                }
                lblHeader.Text = "Shopping List";
                if (lvPower.CheckedIndices.Count == 1)
                {
                    popupData.Sections[index3].Add(
                        !lvPower.Items[0].Checked
                            ? DatabaseAPI.Database
                        .Power[
                            MidsContext.Character.CurrentBuild
                            .Powers[Convert.ToInt32(lvPower.CheckedItems[0].Tag)].NIDPower]
                        .DisplayName
                            : "All Powers", PopUp.Colors.Title);
                }
                else
                {
                    popupData.Sections[index3].Add(Convert.ToString(lvPower.CheckedIndices.Count) + " Powers",
                                                   PopUp.Colors.Title);
                }
                if (!chkRecipe.Checked)
                {
                    popupData.Sections[index3].Add(Convert.ToString(lvDPA.Items.Count - nonRecipeCount) + " Recipes:",
                                                   PopUp.Colors.Title);
                }
                if (Mini)
                {
                    var str = "Buy:";
                    if (num2 > 0)
                    {
                        popupData.Sections[index3].Add($"{str} {num2:###,###,##0}",
                                                       PopUp.Colors.Invention, 0.9f, FontStyle.Bold, iIndent);
                    }
                }
                else
                {
                    var iText = "Buy Cost:";
                    if (num2 > 0)
                    {
                        popupData.Sections[index3].Add(iText, PopUp.Colors.Invention,
                                                       $"{num2:###,###,##0}", PopUp.Colors.Invention, 0.9f, FontStyle.Bold, iIndent);
                    }
                }

                if (Mini)
                {
                    var str = "Craft:";
                    if (num1 > 0)
                    {
                        popupData.Sections[index3].Add(str + " " + $"{num1:###,###,##0}",
                                                       PopUp.Colors.Invention, 0.9f, FontStyle.Bold, iIndent);
                    }
                }
                else
                {
                    var iText = "Craft Cost:";
                    if (num1 > 0)
                    {
                        popupData.Sections[index3].Add(iText, PopUp.Colors.Invention,
                                                       $"{num1:###,###,##0}", PopUp.Colors.Invention, 0.9f, FontStyle.Bold, iIndent);
                    }
                }

                if (Mini)
                {
                    var str = "Craft (Mem'd):";
                    if ((num3 > 0) & (num3 != num1))
                    {
                        popupData.Sections[index3].Add($"{str} {num3:###,###,##0}",
                                                       PopUp.Colors.Effect, 0.9f, FontStyle.Bold, iIndent);
                    }
                }
                else
                {
                    var iText = "Craft Cost (Memorized Common):";
                    if ((num3 > 0) & (num3 != num1))
                    {
                        popupData.Sections[index3].Add(iText, PopUp.Colors.Effect, $"{num3:###,###,##0}",
                                                       PopUp.Colors.Effect, 0.9f, FontStyle.Bold, iIndent);
                    }
                }

                if (chkRecipe.Checked)
                {
                    RecipeInfo.ColumnPosition = 0.75f;
                    var index1 = popupData.Add();
                    popupData.Sections[index1].Add(Convert.ToString(lvDPA.Items.Count - nonRecipeCount) + " Recipes:",
                                                   PopUp.Colors.Title);
                    var num7 = numArray2.Length - 1;
                    for (var index2 = 0; index2 <= num7; ++index2)
                    {
                        var num8 = numArray2[index2].Length - 1;
                        for (var index4 = 0; index4 <= num8; ++index4)
                        {
                            if (numArray2[index2][index4] <= 0)
                            {
                                continue;
                            }
                            var color = DatabaseAPI.Database.Recipes[index2].Rarity switch
                            {
                                Recipe.RecipeRarity.Uncommon => PopUp.Colors.Uncommon,
                                Recipe.RecipeRarity.Rare => PopUp.Colors.Rare,
                                Recipe.RecipeRarity.UltraRare => PopUp.Colors.UltraRare,
                                _ => PopUp.Colors.Text
                            };
                            if (Mini)
                            {
                                popupData.Sections[index1].Add(" " + Convert.ToString(numArray2[index2][index4]) + " x",
                                                               color,
                                                               DatabaseAPI.GetEnhancementNameShortWSet(DatabaseAPI.Database.Recipes[index2]
                                                                                                       .EnhIdx) + " (" +
                                                               Convert.ToString(DatabaseAPI.Database.Recipes[index2].Item[index4].Level + 1) + ")",
                                                               color, 0.9f, FontStyle.Bold, iIndent);
                            }
                            else
                            {
                                popupData.Sections[index1].Add(
                                    DatabaseAPI.GetEnhancementNameShortWSet(DatabaseAPI.Database.Recipes[index2]
                                                                            .EnhIdx) + " (" +
                                    Convert.ToString(DatabaseAPI.Database.Recipes[index2].Item[index4].Level + 1) + ")",
                                    color, Convert.ToString(numArray2[index2][index4]), color, 0.9f, FontStyle.Bold,
                                    iIndent);
                            }
                        }
                    }

                    popupData.Sections[index1].Content = sortPopupStrings(Mini, 2, popupData.Sections[index1].Content);
                }
                else
                {
                    RecipeInfo.ColumnPosition = 0.5f;
                }

                if (Mini)
                {
                    popupData.ColPos   = 0.15f;
                    popupData.ColRight = false;
                }

                var index5 = popupData.Add();
                var iText1 = !Mini?Convert.ToString(num4) + " Salvage Items:" : Convert.ToString(num4) + " Items:";

                popupData.Sections[index5].Add(iText1, PopUp.Colors.Title);
                var num9 = numArray1.Length - 1;
                for (var index1 = 0; index1 <= num9; ++index1)
                {
                    if (numArray1[index1] <= 0)
                    {
                        continue;
                    }
                    var color = DatabaseAPI.Database.Salvage[index1].Rarity switch
                    {
                        Recipe.RecipeRarity.Common => PopUp.Colors.Common,
                        Recipe.RecipeRarity.Uncommon => PopUp.Colors.Uncommon,
                        Recipe.RecipeRarity.Rare => PopUp.Colors.Rare,
                        _ => Color.White
                    };
                    if (Mini)
                    {
                        popupData.Sections[index5].Add(" " + Convert.ToString(numArray1[index1]) + " x", color,
                                                       DatabaseAPI.Database.Salvage[index1].ExternalName, color, 0.9f);
                    }
                    else
                    {
                        popupData.Sections[index5].Add(DatabaseAPI.Database.Salvage[index1].ExternalName, color,
                                                       Convert.ToString(numArray1[index1]), color, 0.9f, FontStyle.Bold, 1);
                    }
                }

                popupData.Sections[index5].Content = sortPopupStrings(Mini, 1, popupData.Sections[index5].Content);
                if (nonRecipeCount == 1)
                {
                    return(popupData);
                }
                {
                    var index1 = popupData.Add();
                    var iText2 = !Mini
                        ? Convert.ToString(nonRecipeCount - 1) + " Non-Crafted Enhancements:"
                        : Convert.ToString(nonRecipeCount - 1) + " Enhs:";

                    popupData.Sections[index1].Add(iText2, PopUp.Colors.Title);
                    var num7 = tl.Length - 1;
                    for (var index2 = 0; index2 <= num7; ++index2)
                    {
                        var common = PopUp.Colors.Common;
                        if (Mini)
                        {
                            popupData.Sections[index1].Add(" " + Convert.ToString(tl[index2].Count) + " x", common,
                                                           tl[index2].Text, common, 0.9f);
                        }
                        else
                        {
                            popupData.Sections[index1].Add(tl[index2].Text, common, Convert.ToString(tl[index2].Count),
                                                           common, 0.9f, FontStyle.Bold, 1);
                        }
                    }

                    popupData.Sections[index1].Content = sortPopupStrings(Mini, 1, popupData.Sections[index1].Content);
                }
                return(popupData);
            }

            lblHeader.Text = DatabaseAPI.Database.Enhancements[Convert.ToInt32(lvDPA.SelectedItems[0].Tag)].LongName +
                             " (" + lvDPA.SelectedItems[0].SubItems[1].Text + ")";
            var rIdx = DatabaseAPI.Database.Enhancements[Convert.ToInt32(lvDPA.SelectedItems[0].Tag)].RecipeIDX;

            if (lvDPA.SelectedItems[0].SubItems[1].Text == "*")
            {
                rIdx = -1;
            }
            DrawIcon(Convert.ToInt32(lvDPA.SelectedItems[0].Tag));
            if (rIdx <= -1)
            {
                return(popupData);
            }
            {
                var index1 = popupData.Add();
                popupData.Sections[index1] = Character.PopRecipeInfo(rIdx, Convert.ToInt32(lvDPA.SelectedItems[0].SubItems[1].Text) - 1);
                if (popupData.Sections[index1].Content != null && popupData.Sections[index1].Content.Length > 0)
                {
                    var content = popupData.Sections[index1].Content;
                    var index2  = 0;
                    content[index2].Text = content[index2].Text + " (" + lvDPA.SelectedItems[0].SubItems[1].Text + ")";
                    return(popupData);
                }

                popupData.Sections[index1].Content[0].Text = "";
            }
            return(popupData);
        }
        public void miniPowerInfo(int pIDX)
        {
            if (Locked)
            {
                return;
            }
            IPower power1 = new Power(myPowers[pIDX]);

            power1.AbsorbPetEffects();
            power1.ApplyGrantPowerEffects();
            PopUp.PopupData iPopup = new PopUp.PopupData();
            if (pIDX < 0)
            {
                PopInfo.SetPopup(iPopup);
                ChangedScrollFrameContents();
            }
            else
            {
                int    index1 = iPopup.Add();
                string str1   = "";
                switch (power1.PowerType)
                {
                case Enums.ePowerType.Click:
                    if (power1.ClickBuff)
                    {
                        str1 = "(Click)";
                    }
                    break;

                case Enums.ePowerType.Auto_:
                    str1 = "(Auto)";
                    break;

                case Enums.ePowerType.Toggle:
                    str1 = "(Toggle)";
                    break;
                }
                iPopup.Sections[index1].Add(power1.DisplayName, PopUp.Colors.Title, 1f, FontStyle.Bold, 0);
                iPopup.Sections[index1].Add(str1 + " " + power1.DescShort, PopUp.Colors.Text, 0.9f, FontStyle.Bold, 0);
                string str2 = power1.DescLong.Replace("<br>", "\r\n");
                iPopup.Sections[index1].Add(str1 + " " + str2, PopUp.Colors.Common, 1f, FontStyle.Regular);
                int index2 = iPopup.Add();
                if (power1.EndCost > 0.0)
                {
                    if (power1.ActivatePeriod > 0.0)
                    {
                        iPopup.Sections[index2].Add("End Cost:", PopUp.Colors.Title, Utilities.FixDP(power1.EndCost / power1.ActivatePeriod) + "/s", PopUp.Colors.Title, 0.9f, FontStyle.Bold, 1);
                    }
                    else
                    {
                        iPopup.Sections[index2].Add("End Cost:", PopUp.Colors.Title, Utilities.FixDP(power1.EndCost), PopUp.Colors.Title, 0.9f, FontStyle.Bold, 1);
                    }
                }
                if (power1.EntitiesAutoHit == Enums.eEntity.None | power1.Range > 20.0 & power1.I9FXPresentP(Enums.eEffectType.Mez, Enums.eMez.Taunt))
                {
                    iPopup.Sections[index2].Add("Accuracy:", PopUp.Colors.Title, Utilities.FixDP((float)(MidsContext.Config.BaseAcc * (double)power1.Accuracy * 100.0)) + "%", PopUp.Colors.Title, 0.9f, FontStyle.Bold, 1);
                }
                if (power1.RechargeTime > 0.0)
                {
                    iPopup.Sections[index2].Add("Recharge:", PopUp.Colors.Title, Utilities.FixDP(power1.RechargeTime) + "s", PopUp.Colors.Title, 0.9f, FontStyle.Bold, 1);
                }
                int   durationEffectId = power1.GetDurationEffectID();
                float iNum             = 0.0f;
                if (durationEffectId > -1)
                {
                    iNum = power1.Effects[durationEffectId].Duration;
                }
                if (power1.PowerType != Enums.ePowerType.Toggle & power1.PowerType != Enums.ePowerType.Auto_ && iNum > 0.0)
                {
                    iPopup.Sections[index2].Add("Duration:", PopUp.Colors.Title, Utilities.FixDP(iNum) + "s", PopUp.Colors.Title, 0.9f, FontStyle.Bold, 1);
                }
                if (power1.Range > 0.0)
                {
                    iPopup.Sections[index2].Add("Range:", PopUp.Colors.Title, Utilities.FixDP(power1.Range) + "ft", PopUp.Colors.Title, 0.9f, FontStyle.Bold, 1);
                }
                if (power1.Arc > 0)
                {
                    iPopup.Sections[index2].Add("Arc:", PopUp.Colors.Title, Convert.ToString(power1.Arc) + "°", PopUp.Colors.Title, 0.9f, FontStyle.Bold, 1);
                }
                else if (power1.Radius > 0.0)
                {
                    iPopup.Sections[index2].Add("Radius:", PopUp.Colors.Title, Convert.ToString(power1.Radius) + "ft", PopUp.Colors.Title, 0.9f, FontStyle.Bold, 1);
                }
                if (power1.CastTime > 0.0)
                {
                    iPopup.Sections[index2].Add("Cast Time:", PopUp.Colors.Title, Utilities.FixDP(power1.CastTime) + "s", PopUp.Colors.Title, 0.9f, FontStyle.Bold, 1);
                }
                IPower power2 = power1;
                if (power2.Effects.Length > 0)
                {
                    iPopup.Sections[index2].Add("Effects:", PopUp.Colors.Title, 1f, FontStyle.Bold, 0);
                    char[] chArray = { '^' };
                    int    num1    = power2.Effects.Length - 1;
                    for (int index3 = 0; index3 <= num1; ++index3)
                    {
                        if (!((power2.Effects[index3].EffectType != Enums.eEffectType.GrantPower | power2.Effects[index3].Absorbed_Effect) &
                              power2.Effects[index3].EffectType != Enums.eEffectType.RevokePower &
                              power2.Effects[index3].EffectType != Enums.eEffectType.SetMode))
                        {
                            continue;
                        }
                        int index4 = iPopup.Add();
                        power1.Effects[index3].SetPower(power1);
                        string[] strArray = power1.Effects[index3].BuildEffectString().Replace("[", "\r\n").Replace("\r\n", "^").Replace("  ", "").Replace("]", "").Split(chArray);
                        int      num2     = strArray.Length - 1;
                        for (int index5 = 0; index5 <= num2; ++index5)
                        {
                            if (index5 == 0)
                            {
                                iPopup.Sections[index4].Add(strArray[index5], PopUp.Colors.Effect, 0.9f, FontStyle.Bold, 1);
                            }
                            else
                            {
                                iPopup.Sections[index4].Add(strArray[index5], PopUp.Colors.Disabled, 0.9f, FontStyle.Italic, 2);
                            }
                        }
                    }
                }
                PopInfo.SetPopup(iPopup);
                ChangedScrollFrameContents();
            }
        }
Beispiel #15
0
 public void UpdateData(int powerID)
 {
     PopUp.PopupData iPopup = default(PopUp.PopupData);
     if (powerID > -1)
     {
         IPower power = DatabaseAPI.Database.Power[powerID];
         int    index = iPopup.Add(null);
         iPopup.Sections[index].Add(DatabaseAPI.Database.Power[powerID].DisplayName, PopUp.Colors.Title, 1.25f, FontStyle.Bold, 0);
         iPopup.Sections[index].Add("Unbuffed Power Data", PopUp.Colors.Title, 1f, FontStyle.Bold, 0);
         index = iPopup.Add(null);
         iPopup.Sections[index].Add("Attributes:", PopUp.Colors.Title, 1f, FontStyle.Bold, 0);
         iPopup.Sections[index].Add("Power Type:", PopUp.Colors.Text, Enum.GetName(power.PowerType.GetType(), power.PowerType), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         iPopup.Sections[index].Add("Accuracy:", PopUp.Colors.Text, this.TwoDP(power.Accuracy), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         if (power.ActivatePeriod > 0f)
         {
             iPopup.Sections[index].Add("Activate Interval:", PopUp.Colors.Text, Conversions.ToString(power.ActivatePeriod) + "s", PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         }
         if (power.Arc > 0)
         {
             iPopup.Sections[index].Add("Arc Radius:", PopUp.Colors.Text, Conversions.ToString(power.Arc) + "°", PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         }
         if (power.AttackTypes != Enums.eVector.None)
         {
             int[] values = (int[])Enum.GetValues(power.AttackTypes.GetType());
             bool  flag   = true;
             int   num    = values.Length - 1;
             for (int index2 = 1; index2 <= num; index2++)
             {
                 if ((power.AttackTypes & (Enums.eVector)values[index2]) > Enums.eVector.None)
                 {
                     string iText;
                     if (flag)
                     {
                         iText = "Attack Type(s):";
                         flag  = false;
                     }
                     else
                     {
                         iText = "";
                     }
                     iPopup.Sections[index].Add(iText, PopUp.Colors.Text, Enum.GetName(power.AttackTypes.GetType(), values[index2]), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
                 }
             }
         }
         iPopup.Sections[index].Add("Cast Time:", PopUp.Colors.Text, this.TwoDP(power.CastTime) + "s", PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         iPopup.Sections[index].Add("Effect Area:", PopUp.Colors.Text, Enum.GetName(power.EffectArea.GetType(), power.EffectArea), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         iPopup.Sections[index].Add("End Cost:", PopUp.Colors.Text, this.TwoDP(power.EndCost), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         iPopup.Sections[index].Add("Auto-Hit:", PopUp.Colors.Text, Enum.GetName(power.EntitiesAutoHit.GetType(), power.EntitiesAutoHit), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         if (power.InterruptTime != 0f)
         {
             iPopup.Sections[index].Add("Interrupt:", PopUp.Colors.Text, this.TwoDP(power.InterruptTime) + "s", PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         }
         iPopup.Sections[index].Add("Level Available:", PopUp.Colors.Text, Conversions.ToString(power.Level), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         iPopup.Sections[index].Add("Max Targets:", PopUp.Colors.Text, Conversions.ToString(power.MaxTargets), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         iPopup.Sections[index].Add("Notify Mobs:", PopUp.Colors.Text, Enum.GetName(power.AIReport.GetType(), power.AIReport), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         if (power.Radius != 0f)
         {
             iPopup.Sections[index].Add("Radius:", PopUp.Colors.Text, Conversions.ToString(power.Radius) + "ft", PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         }
         if (power.Range != 0f)
         {
             iPopup.Sections[index].Add("Range:", PopUp.Colors.Text, Conversions.ToString(power.Range) + "ft", PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         }
         iPopup.Sections[index].Add("RechargeTime:", PopUp.Colors.Text, Conversions.ToString(power.RechargeTime) + "s", PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         iPopup.Sections[index].Add("Target:", PopUp.Colors.Text, Enum.GetName(power.EntitiesAffected.GetType(), power.EntitiesAffected), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         iPopup.Sections[index].Add("Line of Sight:", PopUp.Colors.Text, Conversions.ToString(power.TargetLoS), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         iPopup.Sections[index].Add("Variable:", PopUp.Colors.Text, Conversions.ToString(power.VariableEnabled), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         if (power.VariableEnabled)
         {
             iPopup.Sections[index].Add("Attrib:", PopUp.Colors.Text, power.VariableName, PopUp.Colors.Text, 0.9f, FontStyle.Bold, 2);
             iPopup.Sections[index].Add("Min:", PopUp.Colors.Text, Conversions.ToString(power.VariableMin), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 2);
             iPopup.Sections[index].Add("Max:", PopUp.Colors.Text, Conversions.ToString(power.VariableMax), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 2);
         }
         if (power.Effects.Length > 0)
         {
             index = iPopup.Add(null);
             iPopup.Sections[index].Add("Effects:", PopUp.Colors.Title, 1f, FontStyle.Bold, 0);
             IPower power2  = new Power(DatabaseAPI.Database.Power[powerID]);
             char[] chArray = new char[]
             {
                 '^'
             };
             int num2 = power.Effects.Length - 1;
             for (int index2 = 0; index2 <= num2; index2++)
             {
                 index = iPopup.Add(null);
                 power2.Effects[index2].Power = power2;
                 string[] strArray = power2.Effects[index2].BuildEffectString(false, "", false, false, false).Replace("[", "\r\n").Replace("\r\n", "^").Replace("  ", "").Replace("]", "").Split(chArray);
                 int      num3     = strArray.Length - 1;
                 for (int index3 = 0; index3 <= num3; index3++)
                 {
                     if (index3 == 0)
                     {
                         iPopup.Sections[index].Add(strArray[index3], PopUp.Colors.Effect, 0.9f, FontStyle.Bold, 1);
                     }
                     else
                     {
                         iPopup.Sections[index].Add(strArray[index3], PopUp.Colors.Disabled, 0.9f, FontStyle.Italic, 2);
                     }
                 }
             }
         }
     }
     else
     {
         int index = iPopup.Add(null);
         iPopup.Sections[index].Add("No Power", PopUp.Colors.Title, 1.25f, FontStyle.Bold, 0);
     }
     this.pInfo.SetPopup(iPopup);
     this.pInfo.Width = base.ClientSize.Width;
 }