private void saveAsToolStripMenuItem_Click(object sender, EventArgs e) { SaveFileDialog dlg = new SaveFileDialog(); dlg.Filter = "RSDKv1 ZoneConfig Files|Zone*.zcf|RSDKv4 GameConfig Files|GameConfig*.bin|Adobe Colour Table Files|*.act"; if (dlg.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) { switch (dlg.FilterIndex - 1) { case 0: int i1 = 0; for (int h = 0; h < 2; h++) { for (int w = 0; w < 16; w++) { Color c = Color.FromArgb(255, colorGrid.Colors[i1].R, colorGrid.Colors[i1].G, colorGrid.Colors[i1].B); i1++; //Set the colours in the Stage Config to the modified colours in the ColourGrid! sc1.palette.Colors[h][w].R = c.R; sc1.palette.Colors[h][w].G = c.G; sc1.palette.Colors[h][w].B = c.B; } } sc1.Write(dlg.FileName); //Save that! break; case 1: int i4 = 0; for (int h = 0; h < 6; h++) { for (int w = 0; w < gc4.Palette.COLORS_PER_COLUMN; w++) { Color c = Color.FromArgb(255, colorGrid.Colors[i4].R, colorGrid.Colors[i4].G, colorGrid.Colors[i4].B); i4++; //Set the colours in the Stage Config to the modified colours in the ColourGrid! gc4.Palette.Colors[h][w].R = c.R; gc4.Palette.Colors[h][w].G = c.G; gc4.Palette.Colors[h][w].B = c.B; } } gc4.Write(dlg.FileName); //Save that! break; case 2: Cyotek.Windows.Forms.IPaletteSerializer serializer; serializer = new Cyotek.Windows.Forms.AdobeColorTablePaletteSerializer(); using (Stream stream = File.Create(dlg.FileName)) { serializer.Serialize(stream, colorGrid.Colors); //Save a .act file } break; default: break; } } }
private void exportLoadedPaletteToolStripMenuItem_Click(object sender, EventArgs e) { SaveFileDialog dlg = new SaveFileDialog(); dlg.Filter = "Adobe Colour Table Files|*.act"; if (dlg.ShowDialog(this) == DialogResult.OK) { Cyotek.Windows.Forms.IPaletteSerializer serializer; serializer = new Cyotek.Windows.Forms.AdobeColorTablePaletteSerializer(); using (Stream stream = File.Create(dlg.FileName)) { serializer.Serialize(stream, colorGrid.Colors); //Save a .act file } } }
private void MenuItem_Save_Click(object sender, EventArgs e) { if (Filepath != null) { switch (Type) { case 0: int i1 = 0; for (int h = 0; h < 2; h++) { for (int w = 0; w < 16; w++) { Color c = Color.FromArgb(255, colorGrid.Colors[i1].R, colorGrid.Colors[i1].G, colorGrid.Colors[i1].B); i1++; //Set the colours in the Stage Config to the modified colours in the ColourGrid! StageconfigvRS.StagePalette.Colors[h][w].R = c.R; StageconfigvRS.StagePalette.Colors[h][w].G = c.G; StageconfigvRS.StagePalette.Colors[h][w].B = c.B; } } StageconfigvRS.Write(Filepath); //Save that! break; case 1: int i2 = 0; for (int h = 0; h < 2; h++) { for (int w = 0; w < 16; w++) { Color c = Color.FromArgb(255, colorGrid.Colors[i2].R, colorGrid.Colors[i2].G, colorGrid.Colors[i2].B); i2++; //Set the colours in the Stage Config to the modified colours in the ColourGrid! Stageconfigv1.StagePalette.Colors[h][w].R = c.R; Stageconfigv1.StagePalette.Colors[h][w].G = c.G; Stageconfigv1.StagePalette.Colors[h][w].B = c.B; } } Stageconfigv1.Write(Filepath); //Save that! break; case 2: int i3 = 0; for (int h = 0; h < 2; h++) { for (int w = 0; w < 16; w++) { Color c = Color.FromArgb(255, colorGrid.Colors[i3].R, colorGrid.Colors[i3].G, colorGrid.Colors[i3].B); i3++; //Set the colours in the Stage Config to the modified colours in the ColourGrid! Stageconfigv2.StagePalette.Colors[h][w].R = c.R; Stageconfigv2.StagePalette.Colors[h][w].G = c.G; Stageconfigv2.StagePalette.Colors[h][w].B = c.B; } } Stageconfigv2.Write(Filepath); //Save that! break; case 3: int is4 = 0; for (int h = 0; h < 2; h++) { for (int w = 0; w < 16; w++) { Color c = Color.FromArgb(255, colorGrid.Colors[is4].R, colorGrid.Colors[is4].G, colorGrid.Colors[is4].B); is4++; //Set the colours in the Stage Config to the modified colours in the ColourGrid! StageconfigvB.StagePalette.Colors[h][w].R = c.R; StageconfigvB.StagePalette.Colors[h][w].G = c.G; StageconfigvB.StagePalette.Colors[h][w].B = c.B; } } Stageconfigv2.Write(Filepath); //Save that! break; case 4: int i4 = 0; for (int h = 0; h < 6; h++) { for (int w = 0; w < GameconfigvB.MasterPalette.COLORS_PER_COLUMN; w++) { Color c = Color.FromArgb(255, colorGrid.Colors[i4].R, colorGrid.Colors[i4].G, colorGrid.Colors[i4].B); i4++; //Set the colours in the Stage Config to the modified colours in the ColourGrid! GameconfigvB.MasterPalette.Colors[h][w].R = c.R; GameconfigvB.MasterPalette.Colors[h][w].G = c.G; GameconfigvB.MasterPalette.Colors[h][w].B = c.B; } } GameconfigvB.Write(Filepath); //Save that! break; case 5: Cyotek.Windows.Forms.IPaletteSerializer serializer; serializer = new Cyotek.Windows.Forms.AdobeColorTablePaletteSerializer(); using (Stream stream = File.Create(Filepath)) { serializer.Serialize(stream, colorGrid.Colors); //Save a .act file } break; default: break; } } else { saveAsToolStripMenuItem_Click(this, e); } }
private void saveAsToolStripMenuItem_Click(object sender, EventArgs e) { SaveFileDialog dlg = new SaveFileDialog(); dlg.Filter = "RSDKvRS ZoneConfig Files|Zone*.zcf|RSDKv1 StageConfig Files|StageConfig*.bin|RSDKv2 StageConfig Files|StageConfig*.bin|RSDKvB StageConfig Files|StageConfig*.bin|RSDKvB GameConfig Files|GameConfig*.bin|RSDKvB Super Palettes|GlobalCode*.bin|Adobe Colour Table Files|*.act"; if (dlg.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) { Type = dlg.FilterIndex - 1; switch (Type) { case 0: int i1 = 0; for (int h = 0; h < 2; h++) { for (int w = 0; w < 16; w++) { Color c = Color.FromArgb(255, colorGrid.Colors[i1].R, colorGrid.Colors[i1].G, colorGrid.Colors[i1].B); i1++; //Set the colours in the Stage Config to the modified colours in the ColourGrid! StageconfigvRS.StagePalette.Colors[h][w].R = c.R; StageconfigvRS.StagePalette.Colors[h][w].G = c.G; StageconfigvRS.StagePalette.Colors[h][w].B = c.B; } } StageconfigvRS.Write(dlg.FileName); //Save that! break; case 1: int i2 = 0; for (int h = 0; h < 2; h++) { for (int w = 0; w < 16; w++) { Color c = Color.FromArgb(255, colorGrid.Colors[i2].R, colorGrid.Colors[i2].G, colorGrid.Colors[i2].B); i2++; //Set the colours in the Stage Config to the modified colours in the ColourGrid! Stageconfigv1.StagePalette.Colors[h][w].R = c.R; Stageconfigv1.StagePalette.Colors[h][w].G = c.G; Stageconfigv1.StagePalette.Colors[h][w].B = c.B; } } Stageconfigv1.Write(dlg.FileName); //Save that! break; case 2: int i3 = 0; for (int h = 0; h < 2; h++) { for (int w = 0; w < 16; w++) { Color c = Color.FromArgb(255, colorGrid.Colors[i3].R, colorGrid.Colors[i3].G, colorGrid.Colors[i3].B); i3++; //Set the colours in the Stage Config to the modified colours in the ColourGrid! Stageconfigv2.StagePalette.Colors[h][w].R = c.R; Stageconfigv2.StagePalette.Colors[h][w].G = c.G; Stageconfigv2.StagePalette.Colors[h][w].B = c.B; } } Stageconfigv2.Write(dlg.FileName); //Save that! break; case 3: int is4 = 0; for (int h = 0; h < 2; h++) { for (int w = 0; w < 16; w++) { Color c = Color.FromArgb(255, colorGrid.Colors[is4].R, colorGrid.Colors[is4].G, colorGrid.Colors[is4].B); is4++; //Set the colours in the Stage Config to the modified colours in the ColourGrid! StageconfigvB.StagePalette.Colors[h][w].R = c.R; StageconfigvB.StagePalette.Colors[h][w].G = c.G; StageconfigvB.StagePalette.Colors[h][w].B = c.B; } } Stageconfigv2.Write(dlg.FileName); //Save that! break; case 4: int i4 = 0; for (int h = 0; h < 6; h++) { for (int w = 0; w < GameconfigvB.MasterPalette.COLORS_PER_COLUMN; w++) { Color c = Color.FromArgb(255, colorGrid.Colors[i4].R, colorGrid.Colors[i4].G, colorGrid.Colors[i4].B); i4++; //Set the colours in the Stage Config to the modified colours in the ColourGrid! GameconfigvB.MasterPalette.Colors[h][w].R = c.R; GameconfigvB.MasterPalette.Colors[h][w].G = c.G; GameconfigvB.MasterPalette.Colors[h][w].B = c.B; } } GameconfigvB.Write(dlg.FileName); //Save that! break; case 5: SaveSuperPalettes(dlg.FileName); break; case 6: Cyotek.Windows.Forms.IPaletteSerializer serializer; serializer = new Cyotek.Windows.Forms.AdobeColorTablePaletteSerializer(); using (Stream stream = File.Create(dlg.FileName)) { serializer.Serialize(stream, colorGrid.Colors); //Save a .act file } break; default: break; } } }