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); }
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); }