Esempio n. 1
0
        private void ReplaceCharacterImage(string image)
        {
            Tools.CurrentFolder = Path.GetDirectoryName(image);
            console             = isPS3 ? "ps3" : (isWii ? "wii" : "xbox");
            var xfile  = ImageFolder + "character_" + (cboCharacter.SelectedIndex + 1) + ".png_" + console;
            var file   = ImageFolder + "character_" + (cboCharacter.SelectedIndex + 1) + ".png";
            var backup = xfile + ".bak";

            File.Copy(xfile, backup);

            Tools.isSaveFileCharacter = true;
            Tools.isSaveFileArt       = false;
            Tools.TextureSize         = isWii? 256 : 512;
            Tools.isVerticalTexture   = true;

            if (isWii)
            {
                Tools.ConvertImagetoWii(wimgt, image, xfile);
            }
            else
            {
                Tools.ConvertImagetoRB(image, xfile, false, isPS3);
            }


            if (File.Exists(xfile))
            {
                Tools.DeleteFile(file);
                if (isWii)
                {
                    Tools.ConvertWiiImage(xfile, image, file);
                }
                else
                {
                    Tools.ConvertRBImage(xfile, file);
                }
                picCharacter.Image = Tools.NemoLoadImage(file);
                Log("Replaced image for character '" + cboCharacter.Items[cboCharacter.SelectedIndex] + "' successfully");
                NeedsToSave(true);
                Log("Ready");
                Tools.DeleteFile(backup);
                return;
            }
            Log("Replacing image for character '" + cboCharacter.Items[cboCharacter.SelectedIndex] + "' failed");

            //set everything back
            File.Move(backup, xfile);
            Tools.DeleteFile(file);
            if (isWii)
            {
                Tools.ConvertImagetoWii(wimgt, image, xfile);
            }
            else
            {
                Tools.ConvertImagetoRB(image, xfile, false, isPS3);
            }
            ChangeImagePadding();
            picCharacter.Image = Tools.NemoLoadImage(file);
        }
Esempio n. 2
0
        private void ToWii(string image)
        {
            if (!File.Exists(image))
            {
                return;
            }

            imgCounter++;
            Log("Converting file " + imgCounter + " of " + (imageCount + imagesXbox.Count() + imagesDDS.Count() + imagesPS3.Count() + imagesTPL.Count()));
            Log(" - " + Path.GetFileName(image));

            Log(Tools.ConvertImagetoWii(wimgt, image) ? "Converted to png_wii format successfully" : "Error converting to png_wii format");
        }