Ejemplo n.º 1
0
        public void Open(string Filepath)
        {
            gameconfig = new RSDKvB.GameConfig(new RSDKvB.Reader(Filepath));
            FILEPATH   = Filepath;
            RefreshUI();
            refreshLists();
            RetroED.MainForm.Instance.CurrentTabText = Path.GetFileName(Filepath);

            string        RSDK     = "RSDKvB";
            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 Gameconfig - RSDK Gameconfig Editor";
                dispname = "New Stageconfig - RSDK Gameconfig Editor";
            }

            Text = Path.GetFileName(Filepath) + " - RSDK Gameconfig Editor";

            RetroED.MainForm.Instance.rp.state   = "RetroED - RSDK Gameconfig Editor";
            RetroED.MainForm.Instance.rp.details = "Editing: " + dispname + " (" + RSDK + ")";
            SharpPresence.Discord.RunCallbacks();
            SharpPresence.Discord.UpdatePresence(RetroED.MainForm.Instance.rp);
        }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
        private void loadStagelistFromGameconfigToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog();

            dlg.Filter = "RSDKvB Gameconfig files|Gameconfig*.bin";

            if (dlg.ShowDialog(this) == DialogResult.OK)
            {
                RSDKvB.GameConfig gc = new RSDKvB.GameConfig(dlg.FileName);
                StageList.Items.Clear();
                StageList.Items.Add("Erase Save Game");
                for (int i = 0; i < gc.Categories[1].Scenes.Count; i++)
                {
                    StageList.Items.Add(gc.Categories[1].Scenes[i].Name);
                }
                listLoaded = true;
            }
        }
Ejemplo n.º 4
0
        public void New()
        {
            gameconfig = new RSDKvB.GameConfig();
            FILEPATH   = null;
            refreshLists();
            RefreshUI();
            RetroED.MainForm.Instance.CurrentTabText = "New Gameconfig";

            string RSDK     = "RSDKvB";
            string dispname = "";

            RetroED.MainForm.Instance.CurrentTabText = "New Gameconfig";
            dispname = "New Gameconfig";

            Text = "New Stageconfig";

            RetroED.MainForm.Instance.rp.state   = "RetroED - RSDK Gameconfig Editor";
            RetroED.MainForm.Instance.rp.details = "Editing: " + dispname + " (" + RSDK + ")";
            SharpPresence.Discord.RunCallbacks();
            SharpPresence.Discord.UpdatePresence(RetroED.MainForm.Instance.rp);
        }
Ejemplo n.º 5
0
        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!
            }
        }