static string GetInitialLine() { StringBuilder stringBuilder = new StringBuilder("{\\*\\generator MHD_RTFClass;}\\viewkind4\\uc1\\pard\\f0\\fs"); stringBuilder.Append(MidsContext.Config.RtFont.RTFBase); stringBuilder.Append(" "); stringBuilder.Append(RTF.Color(RTF.ElementID.Text)); if (MidsContext.Config.RtFont.RTFBold) { stringBuilder.Append("\\b "); } return(stringBuilder.ToString()); }
public void updateColours() { ConfigData.FontSettings iFs = new ConfigData.FontSettings(); this.csHero.BackColor = this.myFS.ColorBackgroundHero; this.csVillain.BackColor = this.myFS.ColorBackgroundVillain; this.csText.BackColor = this.myFS.ColorText; this.csInv.BackColor = this.myFS.ColorInvention; this.csInvInv.BackColor = this.myFS.ColorInventionInv; this.csFade.BackColor = this.myFS.ColorFaded; this.csEnh.BackColor = this.myFS.ColorEnhancement; this.csAlert.BackColor = this.myFS.ColorWarning; this.csValue.BackColor = this.myFS.ColorPlName; this.csSpecial.BackColor = this.myFS.ColorPlSpecial; iFs.Assign(MidsContext.Config.RtFont); MidsContext.Config.RtFont.Assign(this.myFS); this.rtPreview.BackColor = this.myFS.ColorBackgroundHero; MidsContext.Config.RtFont.ColorBackgroundHero = this.myFS.ColorPlName; MidsContext.Config.RtFont.ColorBackgroundVillain = this.myFS.ColorPlSpecial; RTF rtf = MidsContext.Config.RTF; this.rtPreview.Rtf = RTF.StartRTF() + RTF.Color(RTF.ElementID.Invention) + RTF.Underline("Invention Name") + RTF.Crlf() + RTF.Color(RTF.ElementID.Enhancement) + RTF.Italic("Enhancement Text") + RTF.Color(RTF.ElementID.Warning) + " (Alert)" + RTF.Crlf() + RTF.Color(RTF.ElementID.Text) + " Regular Text" + RTF.Crlf() + RTF.Color(RTF.ElementID.Text) + " Regular Text" + RTF.Crlf() + RTF.Color(RTF.ElementID.Faded) + " Faded Text" + RTF.Crlf() + RTF.Crlf() + RTF.Color(RTF.ElementID.BackgroundHero) + RTF.Bold("Value Name: ") + RTF.Color(RTF.ElementID.Text) + "Normal Text" + RTF.Crlf() + RTF.Color(RTF.ElementID.BackgroundHero) + RTF.Bold("Value Name: ") + RTF.Color(RTF.ElementID.BackgroundVillain) + "Special Case" + RTF.Crlf() + RTF.Color(RTF.ElementID.BackgroundHero) + RTF.Bold("Value Name: ") + RTF.Color(RTF.ElementID.Enhancement) + "Enahnced value" + RTF.Crlf() + RTF.Color(RTF.ElementID.BackgroundHero) + RTF.Bold("Value Name: ") + RTF.Color(RTF.ElementID.Invention) + "Invention Effect" + RTF.Crlf() + RTF.EndRTF(); this.Listlabel1.SuspendRedraw = true; this.Listlabel1.ClearItems(); this.Listlabel1.AddItem(new ListLabelV2.ListLabelItemV2("Available Power", ListLabelV2.LLItemState.Enabled, -1, -1, -1, "", ListLabelV2.LLFontFlags.Normal, ListLabelV2.LLTextAlign.Left)); this.Listlabel1.AddItem(new ListLabelV2.ListLabelItemV2("Taken Power", ListLabelV2.LLItemState.Selected, -1, -1, -1, "", ListLabelV2.LLFontFlags.Normal, ListLabelV2.LLTextAlign.Left)); this.Listlabel1.AddItem(new ListLabelV2.ListLabelItemV2("Taken Power (Dark)", ListLabelV2.LLItemState.SelectedDisabled, -1, -1, -1, "", ListLabelV2.LLFontFlags.Normal, ListLabelV2.LLTextAlign.Left)); this.Listlabel1.AddItem(new ListLabelV2.ListLabelItemV2("Unavailable Power", ListLabelV2.LLItemState.Disabled, -1, -1, -1, "", ListLabelV2.LLFontFlags.Normal, ListLabelV2.LLTextAlign.Left)); this.Listlabel1.AddItem(new ListLabelV2.ListLabelItemV2("Highlight Colour", ListLabelV2.LLItemState.Enabled, -1, -1, -1, "", ListLabelV2.LLFontFlags.Normal, ListLabelV2.LLTextAlign.Left)); this.Listlabel1.HoverColor = this.myFS.ColorPowerHighlight; this.Listlabel1.UpdateTextColors(ListLabelV2.LLItemState.Enabled, this.myFS.ColorPowerAvailable); this.Listlabel1.UpdateTextColors(ListLabelV2.LLItemState.Selected, this.myFS.ColorPowerTaken); this.Listlabel1.UpdateTextColors(ListLabelV2.LLItemState.SelectedDisabled, this.myFS.ColorPowerTakenDark); this.Listlabel1.UpdateTextColors(ListLabelV2.LLItemState.Disabled, this.myFS.ColorPowerDisabled); this.Listlabel1.Font = new System.Drawing.Font(this.Listlabel1.Font.FontFamily, MidsContext.Config.RtFont.PairedBase); int num = this.Listlabel1.Items.Length - 1; for (int index = 0; index <= num; ++index) { this.Listlabel1.Items[index].Bold = MidsContext.Config.RtFont.PairedBold; } this.Listlabel1.SuspendRedraw = false; this.Listlabel1.Refresh(); MidsContext.Config.RtFont.Assign(iFs); }
void FillEffectView() { string str1 = ""; int[] numArray = new int[DatabaseAPI.NidPowers("set_bonus").Length - 1 + 1]; bool hasOvercap = false; int num1 = MidsContext.Character.CurrentBuild.SetBonus.Count - 1; for (int index1 = 0; index1 <= num1; ++index1) { int num2 = MidsContext.Character.CurrentBuild.SetBonus[index1].SetInfo.Length - 1; for (int index2 = 0; index2 <= num2; ++index2) { if (MidsContext.Character.CurrentBuild.SetBonus[index1].SetInfo[index2].Powers.Length <= 0) { continue; } I9SetData.sSetInfo[] setInfo = MidsContext.Character.CurrentBuild.SetBonus[index1].SetInfo; int index3 = index2; EnhancementSet enhancementSet = DatabaseAPI.Database.EnhancementSets[setInfo[index3].SetIDX]; string str2 = str1 + RTF.Color(RTF.ElementID.Invention) + RTF.Underline(RTF.Bold(enhancementSet.DisplayName)); if (MidsContext.Character.CurrentBuild.Powers[MidsContext.Character.CurrentBuild.SetBonus[index1].PowerIndex].NIDPowerset > -1) { str2 = str2 + RTF.Crlf() + RTF.Color(RTF.ElementID.Faded) + "(" + DatabaseAPI.Database .Powersets[ MidsContext.Character.CurrentBuild .Powers[MidsContext.Character.CurrentBuild.SetBonus[index1].PowerIndex].NIDPowerset] .Powers[ MidsContext.Character.CurrentBuild .Powers[MidsContext.Character.CurrentBuild.SetBonus[index1].PowerIndex].IDXPower].DisplayName + ")"; } string str3 = str2 + RTF.Crlf() + RTF.Color(RTF.ElementID.Text); string str4 = ""; int num3 = enhancementSet.Bonus.Length - 1; for (int index4 = 0; index4 <= num3; ++index4) { if (!(setInfo[index3].SlottedCount >= enhancementSet.Bonus[index4].Slotted & (enhancementSet.Bonus[index4].PvMode == Enums.ePvX.Any | enhancementSet.Bonus[index4].PvMode == Enums.ePvX.PvE & !MidsContext.Config.Inc.DisablePvE | enhancementSet.Bonus[index4].PvMode == Enums.ePvX.PvP & MidsContext.Config.Inc.DisablePvE))) { continue; } if (str4 != "") { str4 += RTF.Crlf(); } bool localOverCap = false; string str5 = " " + enhancementSet.GetEffectString(index4, false, true); int num4 = enhancementSet.Bonus[index4].Index.Length - 1; for (int index5 = 0; index5 <= num4; ++index5) { if (enhancementSet.Bonus[index4].Index[index5] <= -1) { continue; } ++numArray[enhancementSet.Bonus[index4].Index[index5]]; if (numArray[enhancementSet.Bonus[index4].Index[index5]] > 5) { localOverCap = true; } } if (localOverCap) { str5 = RTF.Italic(RTF.Color(RTF.ElementID.Warning) + str5 + " >Cap" + RTF.Color(RTF.ElementID.Text)); } if (localOverCap) { hasOvercap = true; } str4 += str5; } int num5 = MidsContext.Character.CurrentBuild.SetBonus[index1].SetInfo[index2].EnhIndexes.Length - 1; for (int index4 = 0; index4 <= num5; ++index4) { int index5 = DatabaseAPI.IsSpecialEnh(MidsContext.Character.CurrentBuild.SetBonus[index1].SetInfo[index2] .EnhIndexes[index4]); if (index5 <= -1) { continue; } if (str4 != "") { str4 += RTF.Crlf(); } string str5 = str4 + RTF.Color(RTF.ElementID.Enhancement); bool localOverCap = false; string str6 = " " + DatabaseAPI.Database .EnhancementSets[MidsContext.Character.CurrentBuild.SetBonus[index1].SetInfo[index2].SetIDX] .GetEffectString(index5, true, true); int num4 = DatabaseAPI.Database .EnhancementSets[MidsContext.Character.CurrentBuild.SetBonus[index1].SetInfo[index2].SetIDX] .SpecialBonus[index5].Index.Length - 1; for (int index6 = 0; index6 <= num4; ++index6) { if (DatabaseAPI.Database .EnhancementSets[MidsContext.Character.CurrentBuild.SetBonus[index1].SetInfo[index2].SetIDX] .SpecialBonus[index5].Index[index6] <= -1) { continue; } ++numArray[ DatabaseAPI.Database .EnhancementSets[MidsContext.Character.CurrentBuild.SetBonus[index1].SetInfo[index2].SetIDX] .SpecialBonus[index5].Index[index6]]; if (numArray[ DatabaseAPI.Database .EnhancementSets[MidsContext.Character.CurrentBuild.SetBonus[index1].SetInfo[index2].SetIDX] .SpecialBonus[index5].Index[index6]] > 5) { localOverCap = true; } } if (localOverCap) { str6 = RTF.Italic(RTF.Color(RTF.ElementID.Warning) + str6 + " >Cap" + RTF.Color(RTF.ElementID.Text)); } if (localOverCap) { hasOvercap = true; } str4 = str5 + str6; } str1 = str3 + str4 + RTF.Crlf() + RTF.Crlf(); } } string str7; if (hasOvercap) { str7 = RTF.Color(RTF.ElementID.Invention) + RTF.Underline(RTF.Bold("Information:")) + RTF.Crlf() + RTF.Color(RTF.ElementID.Text) + "One or more set bonuses have exceeded the 5 bonus cap, and will not affect your stats. Scroll down this list to find bonuses marked as '" + RTF.Italic(RTF.Color(RTF.ElementID.Warning) + ">Cap") + RTF.Color(RTF.ElementID.Text) + "'" + RTF.Crlf() + RTF.Crlf(); } else { str7 = ""; } string str8 = RTF.StartRTF() + str7 + str1 + RTF.EndRTF(); if (rtxtFX.Rtf != str8) { rtxtFX.Rtf = str8; } IEffect[] cumulativeSetBonuses = MidsContext.Character.CurrentBuild.GetCumulativeSetBonuses(); Array.Sort(cumulativeSetBonuses); string iStr = ""; int num6 = cumulativeSetBonuses.Length - 1; for (int index = 0; index <= num6; ++index) { if (iStr != "") { iStr += RTF.Crlf(); } string str2 = cumulativeSetBonuses[index].BuildEffectString(true); if (!str2.StartsWith("+")) { str2 = "+" + str2; } if (str2.IndexOf("Endurance", StringComparison.Ordinal) > -1) { str2 = str2.Replace("Endurance", "Max Endurance"); } iStr += str2; } string str9 = RTF.StartRTF() + RTF.ToRTF(iStr) + RTF.EndRTF(); if (rtApplied.Rtf == str9) { return; } rtApplied.Rtf = str9; }
void FillEffectView() { string str9 = ""; int[] numArray = new int[DatabaseAPI.NidPowers("set_bonus", "").Length - 1 + 1]; bool flag = false; int num = MidsContext.Character.CurrentBuild.SetBonus.Count - 1; string str10; for (int index = 0; index <= num; index++) { int num2 = MidsContext.Character.CurrentBuild.SetBonus[index].SetInfo.Length - 1; for (int index2 = 0; index2 <= num2; index2++) { if (MidsContext.Character.CurrentBuild.SetBonus[index].SetInfo[index2].Powers.Length > 0) { I9SetData.sSetInfo[] setInfo = MidsContext.Character.CurrentBuild.SetBonus[index].SetInfo; int index3 = index2; EnhancementSet enhancementSet = DatabaseAPI.Database.EnhancementSets[setInfo[index3].SetIDX]; str9 = str9 + RTF.Color(RTF.ElementID.Invention) + RTF.Underline(RTF.Bold(enhancementSet.DisplayName)); if (MidsContext.Character.CurrentBuild.Powers[MidsContext.Character.CurrentBuild.SetBonus[index].PowerIndex].NIDPowerset > -1) { str9 = string.Concat(new string[] { str9, RTF.Crlf(), RTF.Color(RTF.ElementID.Faded), "(", DatabaseAPI.Database.Powersets[MidsContext.Character.CurrentBuild.Powers[MidsContext.Character.CurrentBuild.SetBonus[index].PowerIndex].NIDPowerset].Powers[MidsContext.Character.CurrentBuild.Powers[MidsContext.Character.CurrentBuild.SetBonus[index].PowerIndex].IDXPower].DisplayName, ")" }); } str9 = str9 + RTF.Crlf() + RTF.Color(RTF.ElementID.Text); str10 = ""; int num3 = enhancementSet.Bonus.Length - 1; for (int index4 = 0; index4 <= num3; index4++) { if (setInfo[index3].SlottedCount >= enhancementSet.Bonus[index4].Slotted & (enhancementSet.Bonus[index4].PvMode == Enums.ePvX.Any | (enhancementSet.Bonus[index4].PvMode == Enums.ePvX.PvE & MidsContext.Config.Inc.PvE) | (enhancementSet.Bonus[index4].PvMode == Enums.ePvX.PvP & !MidsContext.Config.Inc.PvE))) { if (str10 != "") { str10 += RTF.Crlf(); } bool flag2 = false; string str11 = " " + enhancementSet.GetEffectString(index4, false, true); int num4 = enhancementSet.Bonus[index4].Index.Length - 1; for (int index5 = 0; index5 <= num4; index5++) { if (enhancementSet.Bonus[index4].Index[index5] > -1) { int[] array = numArray; int[] array2 = enhancementSet.Bonus[index4].Index; int num8 = index5; array[array2[num8]]++; if (numArray[enhancementSet.Bonus[index4].Index[index5]] > 5) { flag2 = true; } } } if (flag2) { str11 = RTF.Italic(RTF.Color(RTF.ElementID.Warning) + str11 + " >Cap" + RTF.Color(RTF.ElementID.Text)); } if (flag2) { flag = true; } str10 += str11; } } int num5 = MidsContext.Character.CurrentBuild.SetBonus[index].SetInfo[index2].EnhIndexes.Length - 1; for (int index4 = 0; index4 <= num5; index4++) { int index6 = DatabaseAPI.IsSpecialEnh(MidsContext.Character.CurrentBuild.SetBonus[index].SetInfo[index2].EnhIndexes[index4]); if (index6 > -1) { if (str10 != "") { str10 += RTF.Crlf(); } str10 += RTF.Color(RTF.ElementID.Enhancement); bool flag2 = false; string str12 = " " + DatabaseAPI.Database.EnhancementSets[MidsContext.Character.CurrentBuild.SetBonus[index].SetInfo[index2].SetIDX].GetEffectString(index6, true, true); int num6 = DatabaseAPI.Database.EnhancementSets[MidsContext.Character.CurrentBuild.SetBonus[index].SetInfo[index2].SetIDX].SpecialBonus[index6].Index.Length - 1; for (int index5 = 0; index5 <= num6; index5++) { if (DatabaseAPI.Database.EnhancementSets[MidsContext.Character.CurrentBuild.SetBonus[index].SetInfo[index2].SetIDX].SpecialBonus[index6].Index[index5] > -1) { int[] array2 = numArray; int[] array = DatabaseAPI.Database.EnhancementSets[MidsContext.Character.CurrentBuild.SetBonus[index].SetInfo[index2].SetIDX].SpecialBonus[index6].Index; int num8 = index5; array2[array[num8]]++; if (numArray[DatabaseAPI.Database.EnhancementSets[MidsContext.Character.CurrentBuild.SetBonus[index].SetInfo[index2].SetIDX].SpecialBonus[index6].Index[index5]] > 5) { flag2 = true; } } } if (flag2) { str12 = RTF.Italic(RTF.Color(RTF.ElementID.Warning) + str12 + " >Cap" + RTF.Color(RTF.ElementID.Text)); } if (flag2) { flag = true; } str10 += str12; } } str9 = str9 + str10 + RTF.Crlf() + RTF.Crlf(); } } } if (flag) { str10 = RTF.Color(RTF.ElementID.Invention) + RTF.Underline(RTF.Bold("Information:")) + RTF.Crlf() + RTF.Color(RTF.ElementID.Text); str10 = string.Concat(new string[] { str10, "One or more set bonuses have exceeded the 5 bonus cap, and will not affect your stats. Scroll down this list to find bonuses marked as '", RTF.Italic(RTF.Color(RTF.ElementID.Warning) + ">Cap"), RTF.Color(RTF.ElementID.Text), "'", RTF.Crlf(), RTF.Crlf() }); } else { str10 = ""; } str9 = RTF.StartRTF() + str10 + str9 + RTF.EndRTF(); if (this.rtxtFX.Rtf != str9) { this.rtxtFX.Rtf = str9; } IEffect[] cumulativeSetBonuses = MidsContext.Character.CurrentBuild.GetCumulativeSetBonuses(); Array.Sort <IEffect>(cumulativeSetBonuses); str9 = ""; int num7 = cumulativeSetBonuses.Length - 1; for (int index = 0; index <= num7; index++) { if (str9 != "") { str9 += RTF.Crlf(); } string str13 = cumulativeSetBonuses[index].BuildEffectString(true, "", false, false, false); if (!str13.StartsWith("+")) { str13 = "+" + str13; } if (str13.IndexOf("Endurance") > -1) { str13 = str13.Replace("Endurance", "Max Endurance"); } str9 += str13; } str9 = RTF.StartRTF() + RTF.ToRTF(str9) + RTF.EndRTF(); if (this.rtApplied.Rtf != str9) { this.rtApplied.Rtf = str9; } }
private void updateColors() { var iFs = new ConfigData.FontSettings(); BGColor.BackColor = _myFs.ColorBackgroundHero; //csVillain.BackColor = _myFs.ColorBackgroundVillain; TextColor.BackColor = _myFs.ColorText; InventionsColor.BackColor = _myFs.ColorInvention; InventionsWhiteColor.BackColor = _myFs.ColorInventionInv; FadedColor.BackColor = _myFs.ColorFaded; EnhancementsColor.BackColor = _myFs.ColorEnhancement; AlertColor.BackColor = _myFs.ColorWarning; ValueColor.BackColor = _myFs.ColorPlName; SpecialCaseColor.BackColor = _myFs.ColorPlSpecial; AvailPowerColor.BackColor = _myFs.ColorPowerAvailable; UnavailPowerColor.BackColor = _myFs.ColorPowerDisabled; TakenHeroColor.BackColor = _myFs.ColorPowerTakenHero; DarkTakenHero.BackColor = _myFs.ColorPowerTakenDarkHero; HighlightHero.BackColor = _myFs.ColorPowerHighlightHero; TakenVillain.BackColor = _myFs.ColorPowerTakenVillain; DarkTakenVillain.BackColor = _myFs.ColorPowerTakenDarkVillain; HighlightVillain.BackColor = _myFs.ColorPowerHighlightVillain; iFs.Assign(MidsContext.Config.RtFont); MidsContext.Config.RtFont.Assign(_myFs); richTextBox1.BackColor = _myFs.ColorBackgroundHero; ctlColorList1.BackColor = _myFs.ColorBackgroundHero; baseDamagebar.BackColor = _myFs.ColorDamageBarBase; enhDamagebar.BackColor = _myFs.ColorDamageBarEnh; MidsContext.Config.RtFont.ColorBackgroundHero = _myFs.ColorPlName; MidsContext.Config.RtFont.ColorBackgroundVillain = _myFs.ColorPlSpecial; richTextBox1.Rtf = RTF.StartRTF() + RTF.Color(RTF.ElementID.Invention) + RTF.Underline("Invention Name") + RTF.Crlf() + RTF.Color(RTF.ElementID.Enhancement) + RTF.Italic("Enhancement Text") + RTF.Color(RTF.ElementID.Warning) + " (Alert)" + RTF.Crlf() + RTF.Color(RTF.ElementID.Text) + " Regular Text" + RTF.Crlf() + RTF.Color(RTF.ElementID.Text) + " Regular Text" + RTF.Crlf() + RTF.Color(RTF.ElementID.Faded) + " Faded Text" + RTF.Crlf() + RTF.Crlf() + RTF.Color(RTF.ElementID.BackgroundHero) + RTF.Bold("Value Name: ") + RTF.Color(RTF.ElementID.Text) + "Normal Text" + RTF.Crlf() + RTF.Color(RTF.ElementID.BackgroundHero) + RTF.Bold("Value Name: ") + RTF.Color(RTF.ElementID.BackgroundVillain) + "Special Case" + RTF.Crlf() + RTF.Color(RTF.ElementID.BackgroundHero) + RTF.Bold("Value Name: ") + RTF.Color(RTF.ElementID.Enhancement) + "Enhanced value" + RTF.Crlf() + RTF.Color(RTF.ElementID.BackgroundHero) + RTF.Bold("Value Name: ") + RTF.Color(RTF.ElementID.Invention) + "Invention Effect" + RTF.Crlf() + RTF.EndRTF(); _myFs.ColorList = new List <Color> { _myFs.ColorPowerTakenHero, _myFs.ColorPowerTakenDarkHero, _myFs.ColorPowerHighlightHero, _myFs.ColorPowerTakenVillain, _myFs.ColorPowerTakenDarkVillain, _myFs.ColorPowerHighlightVillain }; ctlColorList1.Colors = _myFs.ColorList; ctlColorList1.Items.Clear(); var powerColors = new List <string> { "Power Taken (Hero)", "Power Taken Dark (Hero)", "Power Highlight (Hero)", "Power Taken (Villain)", "Power Taken Dark (Villain)", "Power Highlight (Villain)" }; foreach (var itemString in powerColors) { ctlColorList1.Items.Add(itemString); } ctlColorList1.Invalidate(); MidsContext.Config.RtFont.Assign(iFs); }