Exemplo n.º 1
0
        protected void PrepareOutputFolder(IconSet iconSet, String prefix = null)
        {
            // create directories for sub versions
            if (prefix == null)
            {
                prefix = iconSet.Name;
            }
            else
            {
                prefix += "_" + iconSet.Name;
            }


            string outputPath = Path.Combine(Properties.Settings.getOutputLocation(), String.Format(@"{0}\", prefix));

            if (!Directory.Exists(outputPath))
            {
                Console.WriteLine("Creating ouput directory: " + outputPath);
                Directory.CreateDirectory(outputPath);
            }
            iconSet.SetOutputPath(outputPath, prefix);

            // handle versions
            foreach (IconSet version in iconSet.getVersions())
            {
                PrepareOutputFolder(version, prefix);
            }
        }
Exemplo n.º 2
0
        protected void CreateIconSet(IconSet iconSet, TankStats tankStats, string parentPath = null)
        {
            // generate base icon for set, and thne pass it to all other versions
            string iconPath = iconSet.Generate(tankStats, parentPath);

            foreach (IconSet iconVersion in iconSet.getVersions())
            {
                CreateIconSet(iconVersion, tankStats, iconPath);
            }
        }
Exemplo n.º 3
0
        protected void CreateAtlas(IconSet iconSet, IList <Atlas> atlases)
        {
            foreach (IconSet version in iconSet.getVersions())
            {
                CreateAtlas(version, atlases);
            }

            foreach (Atlas atlas in atlases)
            {
                atlas.generate(iconSet);
            }
        }
Exemplo n.º 4
0
        protected void CreatePackage(IconSet iconSet)
        {
            foreach (IconSet version in iconSet.getVersions())
            {
                CreatePackage(version);
            }

            string zipFileName = Properties.Settings.Default.gameVersion + "_" + iconSet.FullName + ".zip";
            string zipPath     = Path.Combine(Properties.Settings.getOutputLocation(), zipFileName);

            using (ZipFile archive = new ZipFile())
            {
                string innerPathIcons = String.Format(@"res_mods\{0}\gui\maps\icons\vehicle\contour\", Properties.Settings.Default.gameVersion);
                archive.AddDirectory(iconSet.OutputPathIcon, innerPathIcons);

                string innerPathAtlases = String.Format(@"res_mods\{0}\gui\flash\atlases\", Properties.Settings.Default.gameVersion);
                archive.AddDirectory(iconSet.OutputPathAtlas, innerPathAtlases);


                archive.Save(zipPath);
            }
        }
Exemplo n.º 5
0
        protected void CreatePackage(IconSet iconSet)
        {
            foreach (IconSet version in iconSet.getVersions())
            {
                CreatePackage(version);
            }

            string zipFileName = String.Format("solo.pogs_" + iconSet.FullName.ToLower() + ".zip");
            string zipPath     = Path.Combine(Properties.Settings.getOutputLocation(), zipFileName);

            using (ZipFile archive = new ZipFile())
            {
                //archive.CompressionMethod = CompressionMethod.None;
                //archive.CompressionLevel = Ionic.Zlib.CompressionLevel.None;

                string innerPathIcons = String.Format(@"res\gui\maps\icons\vehicle\contour\", Properties.Settings.Default.gameVersion);
                archive.AddDirectory(iconSet.OutputPathIcon, innerPathIcons);

                string innerPathAtlases = String.Format(@"res\gui\flash\atlases\", Properties.Settings.Default.gameVersion);
                archive.AddDirectory(iconSet.OutputPathAtlas, innerPathAtlases);

                archive.Save(zipPath);
            }
        }