private void ConvertFile()
        {
            var texturesToAtlasConverter = new TexturesToAtlasConverter(TexturesFile, ScmlFile);

            atlasFile = texturesToAtlasConverter.GetAtlasFile();
            buildFile = texturesToAtlasConverter.GetBuildFile();
        }
 public KAnimToScmlConverter(AtlasFile atlasFile, BuildFile buildFile, AnimFile animationFile, string outDir,
                             string outFile)
 {
     AtlasFile     = atlasFile;
     BuildFile     = buildFile;
     AnimationFile = animationFile;
     OutDir        = outDir;
     OutPath       = Path.Join(outDir, outFile);
 }
예제 #3
0
 //for the tostring thing
 public override string ToString()
 {
     return(string.Format("NativeProcessingFile: {0}\nActualPatchName: {1}\nPkg: {2}\nDirectoryInArchive: {3}\nAtlasFile: {4}\nStlasSaveDirectory: {5}\nSltas width: {6}\nSltas hight: {7}\nPadding: {8}\nPowOf2: {9}\nSquare: {10}\nFastImagePacker: {11}\nGenerateMap: {12}\nMapTypeName: {13}\nImageFolderList: {14}\nTexturelist: {15}\nAllowToAddNewPictures: {16}",
                          NativeProcessingFile.Equals("") ? "(empty)" : NativeProcessingFile,
                          ActualPatchName.Equals("") ? "(empty)" : ActualPatchName,
                          Pkg.Equals("") ? "(empty)" : Pkg,
                          DirectoryInArchive.Equals("") ? "(empty)" : DirectoryInArchive,
                          AtlasFile.Equals("") ? "(empty)" : AtlasFile,
                          AtlasSaveDirectory.Equals("") ? "(empty)" : AtlasSaveDirectory,
                          AtlasWidth == 0 ? "(empty)" : "" + AtlasWidth,
                          AtlasHeight == 0 ? "(empty)" : "" + AtlasHeight,
                          Padding == 0 ? "(empty)" : "" + Padding,
                          PowOf2 == State.None ? "(empty)" : PowOf2 == State.True ? "True" : "False",
                          Square == State.None ? "(empty)" : Square == State.True ? "True" : "False",
                          FastImagePacker ? "True" : "False",
                          GenerateMap == State.None ? "(empty)" : GenerateMap == State.True ? "True" : "False",
                          MapType == MapTypes.None ? "(none selected)" : MapTypeName(MapType),
                          ImageFolderList.Count == 0 ? "(empty)" : ImageFolderList.ToString(),
                          TextureList.Count == 0 ? "(empty)" : TextureList.Count.ToString(),
                          AllowToAddAdditionalImages ? "True" : "False"));
 }
        private void Button1Click(object sender, EventArgs e)
        {
            var dialog = new OpenFileDialog {
                Filter = "Atlas File(*.atlas)|*.atlas"
            };

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                try {
                    using (Stream stream = new FileStream(dialog.FileName, FileMode.Open)) {
                        atlasFile = AtlasCodec.Instance.Decode(stream);
                        CreateGrid();
                    }
                } catch (IOException) {
                    MessageBox.Show("Error opening *.atlas file", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                dialog.Dispose();
            }
        }
 public AtlasToTexturesConverter(AtlasFile atlasFile, BuildFile buildFile, string outDir)
 {
     AtlasFile = atlasFile;
     BuildFile = buildFile;
     OutDir    = outDir;
 }