private void createPng(string outputFile, IconSet iconSet) { Bitmap AtlasPNG = new Bitmap(2048, 2048); AtlasPNG.SetResolution(96.0F, 96.0F); foreach (SubTexture subTexture in ImageList) { //load icon String iconPath = Path.Combine(iconSet.OutputPathIcon, subTexture.name + ".png"); if (!File.Exists(iconPath)) { iconPath = Path.Combine(tmpDir, subTexture.name + ".png"); } using (Graphics gPNG = Graphics.FromImage(AtlasPNG)) { Bitmap PNG = Image.FromFile(iconPath) as Bitmap; PNG.SetResolution(96.0F, 96.0F); gPNG.DrawImage(PNG, (int)subTexture.dimension.X, (int)subTexture.dimension.Y); PNG.Dispose(); } } AtlasPNG.Save(outputFile); AtlasPNG.Dispose(); }
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); } }
static IconSet getTahti() { // IList<IconSet> iconSet = new List<IconSet>(); /* * -addStat "reload time" 35 10 235 215 5 4 * addStat "short view range" 65 2 20 237 253 3 * addStat "bonus view range" 65 2 242 234 1 * -addStat "hull" 80 17 255 255 255 4 * -addStat "turret" 80 10 255 255 255 4 * -addStat "penetration" 80 2 248 186 114 4 * -addStat "damage" 37 17 248 186 114 4 */ IconSet tahti = new IconSet("TAHTI"); tahti.addLayer(Tahti.ReloadTime); tahti.addLayer(Armor.TurretArmorFSR); tahti.addLayer(Armor.HullArmorFSR); tahti.addLayer(Tahti.Damage); tahti.addLayer(Tahti.Penetration); tahti.addLayer(Tahti.ShortViewRange); tahti.addLayer(Tahti.BonusViewRange); return(tahti); // iconSet.Add(tahti); // return iconSet; }
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); } }
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); } }
static IconSet getArtSet() { IconSet dmgArt = new IconSet("DMG_ART"); // Turret FRONT dmgArt.addLayer(Armor.TurretArmorFront); // PEN AND DAM dmgArt.addLayer(Basic.PenetrationAndDamage); // HULL FSR dmgArt.addLayer(Armor.HullArmorFSR); return(dmgArt); }
/// <summary> /// Clone current IconSet, allow it to be used as child in other parent. /// Also clone all it's versions. /// </summary> protected IconSet Clone() { IconSet clone = new IconSet(Name); clone.OutputPathIcon = null; clone.Layers = new List <Layer>(Layers); // clone all versions foreach (IconSet version in Versions) { clone.Versions.Add(version.Clone()); } return(clone); }
public void generate(IconSet iconSet) { Directory.CreateDirectory(iconSet.OutputPathAtlas); String atlasPngFile = Path.Combine(iconSet.OutputPathAtlas, file + ".png"); Console.WriteLine("Generating altas " + atlasPngFile); createPng(atlasPngFile, iconSet); //Copy tmp XML to outputDir String atlasXmlFile = Path.Combine(iconSet.OutputPathAtlas, file + ".xml"); File.Copy(xmlTempFile, atlasXmlFile); }
public static IList <IconSet> getPogsMaxFSRVRRld() { IList <IconSet> iconSet = new List <IconSet>(); IconSet colored = new IconSet("COLOR"); colored.addLayer(Colored.GrandientBackground); colored.addLayer(Colored.TankNameHeader); colored.addLayer(Vehicle.Shield); colored.addLayer(Vehicle.Premium); colored.addLayer(Vehicle.Tier); colored.addLayer(Vehicle.TankName); colored.addLayer(Vehicle.ContourIcon); colored.addLayer(Basic.PenetrationOrDamage); colored.addLayer(Basic.ViewRange); colored.addLayer(Armor.TurretArmorFSR); colored.addLayer(Armor.HullArmorFSR); colored.addLayer(Basic.ReloadTime); iconSet.Add(colored); return(iconSet); }
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); } }
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); } }
public static IList <IconSet> getSet() { IList <IconSet> iconSet = new List <IconSet>(); // RLD IconSet rld = new IconSet("RLD"); rld.addLayer(Basic.ReloadTime); // HP IconSet hp = new IconSet("HP"); hp.addLayer(Basic.HealPoints); hp.addVersion(rld); // VR IconSet vr = new IconSet("VR"); vr.addLayer(Basic.ViewRange); vr.addVersion(rld); // RSF IconSet rsf = new IconSet("RSF"); rsf.addLayer(Armor.TurretArmorRSF); rsf.addLayer(Armor.HullArmorRSF); rsf.addVersion(hp); rsf.addVersion(vr); // FSR IconSet fsr = new IconSet("FSR"); fsr.addLayer(Armor.TurretArmorFSR); fsr.addLayer(Armor.HullArmorFSR); fsr.addVersion(hp); fsr.addVersion(vr); // MAX IconSet max = new IconSet("MAX"); max.addLayer(Basic.PenetrationOrDamage); max.addVersion(rsf); max.addVersion(fsr); // ART DMG IconSet artDmg = getArtSet(); artDmg.addVersion(hp); artDmg.addVersion(vr); // TAHTI //IconSet tahti = getTahti(); // COLORED IconSet colored = new IconSet("COLOR"); colored.addLayer(Colored.GrandientBackground); colored.addLayer(Colored.TankNameHeader); colored.addLayer(Vehicle.Shield); colored.addLayer(Vehicle.Premium); colored.addLayer(Vehicle.Tier); colored.addLayer(Vehicle.TankName); colored.addLayer(Vehicle.ContourIcon); colored.addVersion(max); colored.addVersion(artDmg); //colored.addVersion(tahti); // CLEAR IconSet clear = new IconSet("CLEAR"); clear.addLayer(Clear.TransaprentBackground); clear.addLayer(Clear.ColoredTankNameHeader); clear.addLayer(Vehicle.Shield); clear.addLayer(Vehicle.Premium); clear.addLayer(Vehicle.Tier); clear.addLayer(Vehicle.TankName); clear.addLayer(Vehicle.ContourIcon); clear.addVersion(max); clear.addVersion(artDmg); //clear.addVersion(tahti); iconSet.Add(colored); iconSet.Add(clear); return(iconSet); }
/// <summary> /// Add new version for this set /// </summary> public void addVersion(IconSet version) { Versions.Add(version.Clone()); }