コード例 #1
0
 // Token: 0x0600006D RID: 109 RVA: 0x0000689C File Offset: 0x00004A9C
 public ctlDamageDisplay()
 {
     BackColorChanged += ctlDamageDisplay_BackColorChanged;
     Load             += ctlDamageDisplay_Load;
     Paint            += ctlDamageDisplayt_Paint;
     pStyle            = (Enums.eDDStyle) 3;
     pText             = 0;
     pGraph            = (Enums.eDDGraph) 2;
     pFadeBackStart    = Color.Lime;
     pFadeBackEnd      = Color.Yellow;
     pFadeBaseStart    = Color.Blue;
     pFadeBaseEnd      = Color.LightBlue;
     pFadeEnhStart     = Color.Blue;
     pFadeEnhEnd       = Color.Red;
     pTextColor        = Color.Black;
     pvPadding         = 6;
     phPadding         = 3;
     pAlign            = (Enums.eDDAlign) 1;
     nBase             = 100f;
     nEnhanced         = 196f;
     nMaxEnhanced      = 207f;
     nHighestBase      = 200f;
     nHighestEnhanced  = 414f;
     pString           = "196 (100)";
     InitializeComponent();
 }
コード例 #2
0
    void Load(string iFilename)
    {
        if (iFilename.EndsWith("json"))
        {
        }
        //using (FileStream fileStream = new FileStream(iFilename, FileMode.Open, FileAccess.Read))
        {
            using (BinaryReader reader = new BinaryReader(File.Open(iFilename, FileMode.Open, FileAccess.Read)))
            {
                float num1;
                switch (reader.ReadString())
                {
                // legacy string, refers to something specific in files, do not change
                case "Mids' Hero Designer Config":
                    num1 = 0.9f;
                    break;

                // legacy string, refers to something specific in files, do not change
                // here's something F# doesn't do easily(fallthrough where one branch has a when variable declared)
                case "Mids' Hero Designer Config V2":
                case string x when x == header:
                    num1 = reader.ReadSingle();
                    break;

                default:
                    MessageBox.Show("Config file was missing a header! Using defaults.");
                    reader.Close();
                    //fileStream.Close();
                    return;
                }

                /* Commenting out for now - will remove later
                 * this.DNickName = reader.ReadString();
                 * this.DSelServer = reader.ReadString();
                 * this.DChannel = reader.ReadString();*/
                this.NoToolTips = reader.ReadBoolean();
                this.BaseAcc    = reader.ReadSingle();
                double num3 = (double)reader.ReadSingle();
                double num4 = (double)reader.ReadSingle();
                double num5 = (double)reader.ReadSingle();
                double num6 = (double)reader.ReadSingle();
                double num7 = (double)reader.ReadSingle();
                this.CalcEnhLevel  = (Enums.eEnhRelative)reader.ReadInt32();
                this.CalcEnhOrigin = (Enums.eEnhGrade)reader.ReadInt32();
                this.ExempHigh     = reader.ReadInt32();
                this.ExempLow      = reader.ReadInt32();
                this.Inc.PvE       = reader.ReadBoolean();
                reader.ReadBoolean();
                this.DamageMath.Calculate = (ConfigData.EDamageMath)reader.ReadInt32();
                reader.ReadSingle();
                if ((double)num1 < 1.24000000953674)
                {
                    reader.ReadBoolean();
                }
                else
                {
                    reader.ReadInt32();
                }
                this.DamageMath.ReturnValue        = (ConfigData.EDamageReturn)reader.ReadInt32();
                this.DataDamageGraph               = reader.ReadBoolean();
                this.DataDamageGraphPercentageOnly = reader.ReadBoolean();
                this.DataGraphType = (Enums.eDDGraph)reader.ReadInt32();
                this.ExportScheme  = reader.ReadInt32();
                this.ExportTarget  = reader.ReadInt32();
                if ((double)num1 >= 1.24000000953674)
                {
                    this.ExportBonusTotals = reader.ReadBoolean();
                    this.ExportBonusList   = reader.ReadBoolean();
                }
                this._hideOriginEnhancements = reader.ReadBoolean();
                this.ShowVillainColours      = reader.ReadBoolean();
                this.CheckForUpdates         = reader.ReadBoolean();
                this.Columns         = reader.ReadInt32();
                this.LastSize.Width  = reader.ReadInt32();
                this.LastSize.Height = reader.ReadInt32();
                this.DvState         = (Enums.eVisibleSize)reader.ReadInt32();
                this.StatGraphStyle  = (Enums.GraphStyle)reader.ReadInt32();
                if ((double)num1 >= 1.0)
                {
                    this.FreshInstall = reader.ReadBoolean();
                }
                if ((double)num1 >= 1.10000002384186)
                {
                    this.ForceLevel = reader.ReadInt32();
                }
                if ((double)num1 >= 1.20000004768372)
                {
                    this.I9.DefaultIOLevel = reader.ReadInt32();
                    if (this.I9.DefaultIOLevel > 49)
                    {
                        this.I9.DefaultIOLevel = 49;
                    }
                    this.I9.DisplayIOLevels        = reader.ReadBoolean();
                    this.I9.CalculateEnahncementFX = reader.ReadBoolean();
                    this.I9.CalculateSetBonusFX    = reader.ReadBoolean();
                    this.I9.ExportIOLevels         = reader.ReadBoolean();
                    this.I9.PrintIOLevels          = reader.ReadBoolean();
                    this.I9.ExportCompress         = reader.ReadBoolean();
                    this.I9.ExportDataChunk        = reader.ReadBoolean();
                    this.I9.ExportStripEnh         = reader.ReadBoolean();
                    this.I9.ExportStripSetNames    = reader.ReadBoolean();
                    this.I9.ExportExtraSep         = reader.ReadBoolean();
                    this.PrintInColour             = reader.ReadBoolean();
                    this._printScheme = reader.ReadInt32();
                }
                if ((double)num1 >= 1.21000003814697)
                {
                    this.RtFont.PairedBase             = reader.ReadSingle();
                    this.RtFont.PairedBold             = reader.ReadBoolean();
                    this.RtFont.RTFBase                = reader.ReadInt32();
                    this.RtFont.RTFBold                = reader.ReadBoolean();
                    this.RtFont.ColorBackgroundHero    = ConfigData.ReadRGB(reader);
                    this.RtFont.ColorBackgroundVillain = ConfigData.ReadRGB(reader);
                    this.RtFont.ColorEnhancement       = ConfigData.ReadRGB(reader);
                    this.RtFont.ColorFaded             = ConfigData.ReadRGB(reader);
                    this.RtFont.ColorInvention         = ConfigData.ReadRGB(reader);
                    this.RtFont.ColorInventionInv      = ConfigData.ReadRGB(reader);
                    this.RtFont.ColorText              = ConfigData.ReadRGB(reader);
                    this.RtFont.ColorWarning           = ConfigData.ReadRGB(reader);
                    this.RtFont.ColorPlName            = ConfigData.ReadRGB(reader);
                    this.RtFont.ColorPlSpecial         = ConfigData.ReadRGB(reader);
                }
                if ((double)num1 >= 1.22000002861023)
                {
                    this.ShowSlotLevels             = reader.ReadBoolean();
                    this.LoadLastFileOnStart        = reader.ReadBoolean();
                    this.LastFileName               = reader.ReadString();
                    this.RtFont.ColorPowerAvailable = ConfigData.ReadRGB(reader);
                    this.RtFont.ColorPowerTaken     = ConfigData.ReadRGB(reader);
                    this.RtFont.ColorPowerTakenDark = ConfigData.ReadRGB(reader);
                    this.RtFont.ColorPowerDisabled  = ConfigData.ReadRGB(reader);
                    this.RtFont.ColorPowerHighlight = ConfigData.ReadRGB(reader);
                }
                if ((double)num1 >= 1.23000001907349)
                {
                    this.Tips = new Tips(reader);
                    this.DefaultSaveFolderOverride = reader.ReadString();
                }
                if ((double)num1 >= 1.24000000953674)
                {
                    this.EnhanceVisibility = reader.ReadBoolean();
                    reader.ReadBoolean();
                    this.BuildMode   = (Enums.dmModes)reader.ReadInt32();
                    this.BuildOption = (Enums.dmItem)reader.ReadInt32();
                    this.UpdatePath  = reader.ReadString();
                    if (string.IsNullOrEmpty(this.UpdatePath))
                    {
                        this.UpdatePath = "";
                    }
                }
                if ((double)num1 >= 1.25)
                {
                    this.ShowEnhRel     = reader.ReadBoolean();
                    this.ShowRelSymbols = reader.ReadBoolean();
                    this.ShowPopup      = reader.ReadBoolean();
                    if ((double)num1 >= 1.32000005245209)
                    {
                        this.ShowAlphaPopup = reader.ReadBoolean();
                    }
                    this.PopupRecipes = reader.ReadBoolean();
                    this.ShoppingListIncludesRecipes = reader.ReadBoolean();
                    this.PrintProfile         = (ConfigData.PrintOptionProfile)reader.ReadInt32();
                    this.PrintHistory         = reader.ReadBoolean();
                    this.LastPrinter          = reader.ReadString();
                    this.PrintProfileEnh      = reader.ReadBoolean();
                    this.DesaturateInherent   = reader.ReadBoolean();
                    this.ReapeatOnMiddleClick = reader.ReadBoolean();
                }
                if ((double)num1 >= 1.25999999046326)
                {
                    this.ExportHex = reader.ReadBoolean();
                }
                if ((double)num1 >= 1.26999998092651)
                {
                    this.SpeedFormat = (Enums.eSpeedMeasure)reader.ReadInt32();
                }
                if ((double)num1 >= 1.27999997138977)
                {
                    this.SaveFolderChecked = reader.ReadBoolean();
                }
                if ((double)num1 >= 1.28999996185303)
                {
                    this.UseArcanaTime = reader.ReadBoolean(); //this is correct
                }

                /*Commented out to expidite release.... Will not load forum Export settings  or supression settings
                 * if ((double)num1 >= 1.29999995231628)
                 * {  // numbers seem really off which is screwing up the rest of the read
                 *  tempNum = reader.ReadInt16();
                 *  this.Suppression = (Enums.eSuppress)tempNum;
                 * }
                 * if ((double)num1 >= 1.30999994277954)
                 * {
                 *  for (int index = 0; index < 19; ++index) {
                 *      this.DragDropScenarioAction[index] = reader.ReadInt16();
                 * }
                 * }//589825 or 2305
                 * tempNum = reader.ReadInt16();
                 * this.Export.ColorSchemes = new ExportConfig.ColorScheme[(int)tempNum];
                 * for (int index = 0; index < this.Export.ColorSchemes.Length; ++index)
                 * { //crashes at index 14
                 *  this.Export.ColorSchemes[index].SchemeName = reader.ReadString();
                 *  this.Export.ColorSchemes[index].Heading = ConfigData.ReadRGB(reader);
                 *  this.Export.ColorSchemes[index].Level = ConfigData.ReadRGB(reader);
                 *  this.Export.ColorSchemes[index].Slots = ConfigData.ReadRGB(reader);
                 *  this.Export.ColorSchemes[index].Title = ConfigData.ReadRGB(reader);
                 *  if ((double)num1 >= 1.20000004768372)
                 *  {
                 *      this.Export.ColorSchemes[index].IOColor = ConfigData.ReadRGB(reader);
                 *      this.Export.ColorSchemes[index].SetColor = ConfigData.ReadRGB(reader);
                 *      this.Export.ColorSchemes[index].HOColor = ConfigData.ReadRGB(reader);
                 *      this.Export.ColorSchemes[index].Power = ConfigData.ReadRGB(reader);
                 *  }
                 * }
                 * this.Export.FormatCode = new ExportConfig.FormatCodes[reader.ReadInt32() + 1];
                 * for (int index = 0; index < this.Export.FormatCode.Length; ++index)
                 * {
                 *  this.Export.FormatCode[index].Name = reader.ReadString();
                 *  this.Export.FormatCode[index].Notes = reader.ReadString();
                 *  this.Export.FormatCode[index].BoldOff = reader.ReadString();
                 *  this.Export.FormatCode[index].BoldOn = reader.ReadString();
                 *  this.Export.FormatCode[index].ColourOff = reader.ReadString();
                 *  this.Export.FormatCode[index].ColourOn = reader.ReadString();
                 *  this.Export.FormatCode[index].ItalicOff = reader.ReadString();
                 *  this.Export.FormatCode[index].ItalicOn = reader.ReadString();
                 *  this.Export.FormatCode[index].SizeOff = reader.ReadString();
                 *  this.Export.FormatCode[index].SizeOn = reader.ReadString();
                 *  this.Export.FormatCode[index].UnderlineOff = reader.ReadString();
                 *  this.Export.FormatCode[index].UnderlineOn = reader.ReadString();
                 *  this.Export.FormatCode[index].Space = (ExportConfig.WhiteSpace)reader.ReadInt32();
                 * } */
                this.CreateDefaultSaveFolder();
            }
        }
    }