private void frmCGEditor_FormClosed(object sender, FormClosedEventArgs e) { Cursor.Current = Cursors.WaitCursor; // Save info lstCGs.SaveToFile(); // Save images foreach (CGData item in lstCGs.Data) { WorkingDirectory.CreateDirectory(@"Images\CGs\" + item.Name); if (item.BGImage1 != null) { WorkingDirectory.SaveImage(@"CGs\" + item.Name + @"\BG1", item.BGImage1.ToBitmap(Palette.BasePalette)); } if (item.BGImage2 != null) { WorkingDirectory.SaveImage(@"CGs\" + item.Name + @"\BG2", item.BGImage2.ToBitmap(Palette.BasePalette)); } if (item.FGImage1 != null) { WorkingDirectory.SaveImage(@"CGs\" + item.Name + @"\FG1", item.FGImage1.ToBitmap(Palette.BasePalette)); } if (item.FGImage2 != null) { WorkingDirectory.SaveImage(@"CGs\" + item.Name + @"\FG2", item.FGImage2.ToBitmap(Palette.BasePalette)); } } Cursor.Current = Cursors.Default; }
private void frmClassEditor_FormClosed(object sender, FormClosedEventArgs e) { // Save classes lstClasses.SaveToFile(); // Save class images foreach (ClassData item in lstClasses.Data) { if (item.MapSprite != null) { WorkingDirectory.SaveImage(@"ClassMapSprites\" + item.Name, item.MapSprite.ToBitmap(Palette.BasePalette)); } WorkingDirectory.CreateDirectory(@"Images\ClassBattleAnimations\" + item.Name); for (int i = 0; i < item.BattleAnimations.Count; i++) { if (item.BattleAnimations[i]?.Image?.Target != null) { WorkingDirectory.SaveImage(@"ClassBattleAnimations\" + item.Name + @"\" + item.BattleAnimations[i].Name, item.BattleAnimations[i].Image.ToBitmap(Palette.BasePalette)); } } if (item.ProjectileImage != null) { WorkingDirectory.CreateDirectory(@"Images\ClassBattleAnimations\_Projectiles"); WorkingDirectory.SaveImage(@"ClassBattleAnimations\_Projectiles\" + item.Name, item.ProjectileImage.ToBitmap(Palette.BasePalette)); } } // Save units lstUnits.SaveToFile(); }
private void frmTilesetEditor_FormClosed(object sender, FormClosedEventArgs e) { Cursor.Current = Cursors.WaitCursor; // Save tilemaps lstTilemaps.SaveToFile(); // Save tile images & battle backgrounds images foreach (TilesetData item in lstTilemaps.Data) { WorkingDirectory.CreateDirectory(@"Images\Tilesets\" + item.Name); for (int i = 0; i < item.Tiles.Count; i++) { if (item.Tiles[i]?.Image?.Target != null) { item.Tiles[i].Image.CurrentPalette = Palette.BasePalette; WorkingDirectory.SaveImage(@"Tilesets\" + item.Name + @"\" + i, item.Tiles[i].Image.Target); } } for (int i = 0; i < item.BattleBackgrounds.Count; i++) { if (item.BattleBackgrounds[i]?.Layer1?.Target != null) { item.BattleBackgrounds[i].Layer1.CurrentPalette = Palette.BasePalette; WorkingDirectory.SaveImage( @"BattleBackgrounds\" + item.Name + @"\" + item.BattleBackgrounds[i].Name + "1", item.BattleBackgrounds[i].Layer1.Target); } if (item.BattleBackgrounds[i]?.Layer2?.Target != null) { item.BattleBackgrounds[i].Layer2.CurrentPalette = Palette.BasePalette; WorkingDirectory.SaveImage( @"BattleBackgrounds\" + item.Name + @"\" + item.BattleBackgrounds[i].Name + "2", item.BattleBackgrounds[i].Layer2.Target); } } } Cursor.Current = Cursors.Default; }
private void GenericDataToUI(GenericPortraitData data) { txtGenericsID.Text = data.Name; txtGenericsTags.Text = data.tags; trkGenericsVoiceType.Value = data.VoiceType; WorkingDirectory.CreateDirectory(@"Images\GenericPortraits\" + data.Name); picGenericsBG.Image = data.Background ?? new PalettedImage(WorkingDirectory.LoadImage(@"GenericPortraits\" + data.Name + @"\B") ?? new Bitmap(1, 1)); picGenericsFG.Image = data.Foreground ?? new PalettedImage(WorkingDirectory.LoadImage(@"GenericPortraits\" + data.Name + @"\F") ?? new Bitmap(1, 1)); UpdateGenericPreview(); CurrentFile = data.Name; Dirty = false; }
private void BattleAnimationsFromClassData(ClassData data) { WorkingDirectory.CreateDirectory(@"Images\ClassBattleAnimations\" + data.Name); for (int i = 0; i < data.BattleAnimations.Count; i++) { if (data.BattleAnimations[i].Image == null) { data.BattleAnimations[i].Image = PalettedImage.FromFile(WorkingDirectory, @"ClassBattleAnimations\" + data.Name + @"\" + data.BattleAnimations[i].Name); } } balBattleAnimations.Datas = data.BattleAnimations; }
private void frmPortraitEditor_FormClosed(object sender, FormClosedEventArgs e) { Cursor.Current = Cursors.WaitCursor; // Characters save lstCharacters.SaveToFile(); // Characters save images foreach (PortraitData item in lstCharacters.Data) { WorkingDirectory.CreateDirectory(@"Images\Portraits\" + item.Name); if (item.Foreground != null) { item.Foreground.CurrentPalette = Palette.BasePalette; WorkingDirectory.SaveImage(@"Portraits\" + item.Name + @"\F", item.Foreground.Target); } if (item.Background != null) { item.Background.CurrentPalette = Palette.BasePalette; WorkingDirectory.SaveImage(@"Portraits\" + item.Name + @"\B", item.Background.Target); } } // Generics save lstGenerics.SaveToFile(); // Generics save images foreach (GenericPortraitData item in lstGenerics.Data) { WorkingDirectory.CreateDirectory(@"Images\GenericPortraits\" + item.Name); if (item.Foreground != null) { item.Foreground.CurrentPalette = Palette.BasePalette; WorkingDirectory.SaveImage(@"GenericPortraits\" + item.Name + @"\F", item.Foreground.Target); } if (item.Background != null) { item.Background.CurrentPalette = Palette.BasePalette; WorkingDirectory.SaveImage(@"GenericPortraits\" + item.Name + @"\B", item.Background.Target); } } // Generics global data save GlobalData.GenericPossibleBackgroundColors = pleGenericsPossibleBGPalettes.Datas; WorkingDirectory.SaveFile("GenericPortraitsGlobalData", GlobalData.ToJson(), ".json"); Cursor.Current = Cursors.Default; }