Example #1
0
        public ModInfo(string mod)
        {
            InitializeComponent();

            modDirectory = Path.GetDirectoryName(mod);

            string[] getThumbnail = Directory.GetFiles(modDirectory, "thumbnail*", SearchOption.TopDirectoryOnly);
            foreach (var img in getThumbnail)
            {
                pic_Thumbnail.BackgroundImage = Image.FromFile(img);
            }

            lbl_Title.Text       = Text = INI.DeserialiseKey("Title", mod);
            tb_Information.Text += $"Version: {version = INI.DeserialiseKey("Version", mod)}\n";
            tb_Information.Text += $"Date: {INI.DeserialiseKey("Date", mod)}\n";
            tb_Information.Text += $"Author: {INI.DeserialiseKey("Author", mod)}\n";
            tb_Information.Text += $"Platform: {INI.DeserialiseKey("Platform", mod)}\n";
            tb_Information.Text += $"Merge: {Literal.Bool(INI.DeserialiseKey("Merge", mod))}\n";
            tb_Description.Text += INI.DeserialiseKey("Description", mod).Replace(@"\n", Environment.NewLine);
            if ((metadata = INI.DeserialiseKey("Metadata", mod)) != string.Empty)
            {
                btn_Update.Enabled = pgb_Progress.Enabled = true;
            }
            data = INI.DeserialiseKey("Data", mod);

            if (lbl_Title.Width >= (MinimumSize.Width - pic_Logo.Width))
            {
                Width       = lbl_Title.Width + 110;
                MinimumSize = new Size(Width, Height);
            }
        }