public void Open(string Filepath) { stageconfig = new RSDKv1.StageConfig(new RSDKv1.Reader(Filepath)); FILEPATH = Filepath; RefreshUI(); refreshLists(); RetroED.MainForm.Instance.CurrentTabText = Path.GetFileName(Filepath); string RSDK = "RSDKv1"; string dispname = ""; string folder = Path.GetDirectoryName(Filepath); DirectoryInfo di = new DirectoryInfo(folder); folder = di.Name; string file = Path.GetFileName(Filepath); if (Filepath != null) { RetroED.MainForm.Instance.CurrentTabText = folder + "/" + file; dispname = folder + "/" + file; } else { RetroED.MainForm.Instance.CurrentTabText = "New Palette - RSDK Stageconfig Editor"; dispname = "New Stageconfig - RSDK Stageconfig Editor"; } Text = Path.GetFileName(Filepath) + " - RSDK Stageconfig Editor"; RetroED.MainForm.Instance.rp.state = "RetroED - RSDK Stageconfig Editor"; RetroED.MainForm.Instance.rp.details = "Editing: " + dispname + " (" + RSDK + ")"; SharpPresence.Discord.RunCallbacks(); SharpPresence.Discord.UpdatePresence(RetroED.MainForm.Instance.rp); }
private void MenuItem_New_Click(object sender, EventArgs e) { StageconfigvRS = new RSDKvRS.Zoneconfig(); Stageconfigv1 = new RSDKv1.StageConfig(); Stageconfigv2 = new RSDKv2.StageConfig(); StageconfigvB = new RSDKvB.StageConfig(); GameconfigvB = new RSDKvB.GameConfig(); colorGrid.Colors.Clear(); for (int i = 0; i < 256; i++) { colorGrid.Colors.Add(Color.FromArgb(255, 255, 0, 255)); } Filepath = null; }
public void New() { stageconfig = new RSDKv1.StageConfig(); FILEPATH = null; refreshLists(); RefreshUI(); RetroED.MainForm.Instance.CurrentTabText = "New stageconfig"; string RSDK = "RSDKv1"; string dispname = ""; RetroED.MainForm.Instance.CurrentTabText = "New Stageconfig"; dispname = "New Stageconfig"; Text = "New Stageconfig"; RetroED.MainForm.Instance.rp.state = "RetroED - RSDK Stageconfig Editor"; RetroED.MainForm.Instance.rp.details = "Editing: " + dispname + " (" + RSDK + ")"; SharpPresence.Discord.RunCallbacks(); SharpPresence.Discord.UpdatePresence(RetroED.MainForm.Instance.rp); }
private void openToolStripMenuItem_Click(object sender, EventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); 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) { MemoryEditing = false; GameType = 0; Cyotek.Windows.Forms.ColorCollection pal = new Cyotek.Windows.Forms.ColorCollection(); colorGrid.Colors.Clear(); //Clear the colourGrid! string RSDK = "RSDKvB"; switch (dlg.FilterIndex - 1) { case 0: StageconfigvRS = new RSDKvRS.Zoneconfig(dlg.FileName); for (int h = 0; h < 2; h++) //For two rows... { for (int w = 0; w < 16; w++) // Get 16 colours... { Color c = Color.FromArgb(255, StageconfigvRS.StagePalette.Colors[h][w].R, StageconfigvRS.StagePalette.Colors[h][w].G, StageconfigvRS.StagePalette.Colors[h][w].B); pal.Add(c); //And place them into the grid! } } RSDK = "RSDKvRS"; break; case 1: Stageconfigv1 = new RSDKv1.StageConfig(dlg.FileName); for (int h = 0; h < 2; h++) // For six rows... { for (int w = 0; w < 16; w++) //Get 16 Colours { Color c = Color.FromArgb(255, Stageconfigv1.StagePalette.Colors[h][w].R, Stageconfigv1.StagePalette.Colors[h][w].G, Stageconfigv1.StagePalette.Colors[h][w].B); pal.Add(c); //And place them into the grid! } } RSDK = "RSDKv1"; break; case 2: Stageconfigv2 = new RSDKv2.StageConfig(dlg.FileName); for (int h = 0; h < 2; h++) // For six rows... { for (int w = 0; w < 16; w++) //Get 16 Colours { Color c = Color.FromArgb(255, Stageconfigv2.StagePalette.Colors[h][w].R, Stageconfigv2.StagePalette.Colors[h][w].G, Stageconfigv2.StagePalette.Colors[h][w].B); pal.Add(c); //And place them into the grid! } } RSDK = "RSDKv2"; break; case 3: StageconfigvB = new RSDKvB.StageConfig(dlg.FileName); for (int h = 0; h < 2; h++) // For six rows... { for (int w = 0; w < 16; w++) //Get 16 Colours { Color c = Color.FromArgb(255, StageconfigvB.StagePalette.Colors[h][w].R, StageconfigvB.StagePalette.Colors[h][w].G, StageconfigvB.StagePalette.Colors[h][w].B); pal.Add(c); //And place them into the grid! } } RSDK = "RSDKvB"; break; case 4: GameconfigvB = new RSDKvB.GameConfig(dlg.FileName); for (int h = 0; h < 6; h++) // For six rows... { for (int w = 0; w < GameconfigvB.MasterPalette.COLORS_PER_COLUMN; w++) //Get 16 Colours { Color c = Color.FromArgb(255, GameconfigvB.MasterPalette.Colors[h][w].R, GameconfigvB.MasterPalette.Colors[h][w].G, GameconfigvB.MasterPalette.Colors[h][w].B); pal.Add(c); //And place them into the grid! } } RSDK = "RSDKvB"; break; case 5: LoadSuperPalettes(dlg.FileName); RSDK = "RSDKvB"; break; case 6: pal = Cyotek.Windows.Forms.ColorCollection.LoadPalette(dlg.FileName); //Load .act file RSDK = ".Act File"; break; default: break; } string dispname = ""; string folder = Path.GetDirectoryName(dlg.FileName); DirectoryInfo di = new DirectoryInfo(folder); folder = di.Name; string file = Path.GetFileName(dlg.FileName); if (dlg.FileName != null) { RetroED.MainForm.Instance.CurrentTabText = folder + "/" + file; dispname = folder + "/" + file; } else { RetroED.MainForm.Instance.CurrentTabText = "New Palette - RSDK Palette Editor"; dispname = "New Palette - RSDK Palette Editor"; } Text = Path.GetFileName(dlg.FileName) + " - RSDK Palette Editor"; Parent.rp.state = "RetroED - " + this.Text; Parent.rp.details = "Editing: " + dispname + " (" + RSDK + ")"; SharpPresence.Discord.RunCallbacks(); SharpPresence.Discord.UpdatePresence(Parent.rp); colorGrid.Colors = pal; //Set the Colourgrid's colours! } }