public void OpenMcPackFile(Form1 form)
        {
            OpenFileDialog fdb = new OpenFileDialog
            {
                Title  = MCPACK_OPEN_TITLE,
                Filter = MCPACK_FILTER
            };

            var result = fdb.ShowDialog();

            if (result == DialogResult.OK)
            {
                Global.McpackFilePath = fdb.FileName;

                FileProcessing.ExtractMcpackFile(form);
                FileProcessing.LoadSkinsJson(form);

                if (Global.Skins.SkinList.Count <= 0)
                {
                    throw new DataException($"No skins found in {Path.GetFileName(Global.McpackFilePath)}.");
                }

                FileProcessing.FillSkinsList(form);
                FileProcessing.LoadManifestJson(form);
                FileProcessing.LoadPackSettings(form);

                form.Set_StatusLabel(LOAD_OK);
            }
        }
 private void UpdateDefaultSkinName(Form1 form, int index, string filename)
 {
     if (Global.Skins.SkinList[index].SkinName.Contains(SKIN_DEFAULT_NAME))
     {
         Global.Skins.SkinList[index].SkinName = filename;
         FileProcessing.FillSkinsList(form);
         form.Set_SkinListSelectedItem(index);
     }
 }
        public void RemoveSkin(Form1 form)
        {
            var index = form.Get_SkinListSelectedIndex();
            var file  = $"{Global.WorkDir}\\{Global.Skins.SkinList[index].SkinTextureFile}";

            if (File.Exists(file))
            {
                File.Delete(file);
            }

            Global.Skins.SkinList.RemoveAt(index);

            FileProcessing.FillSkinsList(form);
            Utils.SelectNextListItem(form, index);
        }
        public void OpenMultipleTextureFiles(Form1 form)
        {
            OpenFileDialog Ofd = new OpenFileDialog
            {
                Title       = MULTIPLE_TEXTURE_OPEN_TITLE,
                Filter      = IMAGE_FILTER,
                Multiselect = true
            };

            var result = Ofd.ShowDialog();

            if (result == DialogResult.OK)
            {
                var imagens = Ofd.FileNames.Where(x => Path.GetExtension(x) == IMAGE_EXTENSION);

                foreach (var item in imagens)
                {
                    var filename = Path.GetFileNameWithoutExtension(item);
                    var file     = Path.GetFileName(item);

                    Global.Skins.SkinList.Add(
                        new SkinModel.Skin()
                    {
                        SkinFormat      = Global.DefaultSkinFormat,
                        SkinName        = filename,
                        SkinTextureFile = file,
                        SkinType        = "free"
                    }
                        );

                    form.Set_SkinTexture(item);

                    File.Copy(item, $"{Global.WorkDir}\\{file}", true);

                    FileProcessing.FillSkinsList(form);
                }

                var index = form.Get_SkinListItemsCount() - 1;
                Utils.SelectNextListItem(form, index);
                form.Set_SkinBoxPicture(Utils.LoadImagePreview(form, index));
            }
        }
        public void AddNewSkin(Form1 form)
        {
            Global.Skins.SkinList.Add(
                new SkinModel.Skin()
            {
                SkinFormat      = Global.DefaultSkinFormat,
                SkinName        = $"New Skin ({Global.Skins.SkinList.Count + 1})",
                SkinTextureFile = "",
                SkinType        = "free"
            }
                );

            FileProcessing.FillSkinsList(form);
            Utils.SelectNextListItem(form, Global.Skins.SkinList.Count - 1);

            form.Focus_SkinName();
            form.SelectAll_SkinName();

            form.Set_StatusLabel(NEW_SKIN);
        }