Esempio n. 1
0
        public void Open(string filepath)
        {
            ZoneList = new RSDKvRS.ZoneList(filepath);
            filePath = filepath;
            RefreshUI();
            RefreshList();

            string        RSDK     = "RSDKvRS (Zones) ";
            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);
        }
Esempio n. 2
0
 public SceneSelect(RSDKvRS.ZoneList RS, RSDKvRS.ZoneList CS, RSDKvRS.ZoneList SS, RSDKvRS.ZoneList BS)
 {
     InitializeComponent();
     LoadFromGameConfig(RS, CS, SS, BS);
     _RStagesvRS = RS;
     _CStagesvRS = CS;
     _SStagesvRS = SS;
     _BStagesvRS = BS;
 }
Esempio n. 3
0
        public void New()
        {
            ZoneList = new RSDKvRS.ZoneList();
            filePath = "";
            RefreshUI();

            string RSDK     = "RSDKvRS (Zones) ";
            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);
        }
Esempio n. 4
0
        public void LoadFromGameConfig(RSDKvRS.ZoneList RS, RSDKvRS.ZoneList CS, RSDKvRS.ZoneList SS, RSDKvRS.ZoneList BS)
        {
            Categories.Clear();
            Directories.Clear();
            for (int c = 0; c < 4; c++)
            {
                List <Tuple <string, string> > scenes = new List <Tuple <string, string> >();

                switch (c)
                {
                case 0:
                    foreach (RSDKvRS.ZoneList.Level scene in RS.Stages)
                    {
                        scenes.Add(new Tuple <string, string>(scene.StageName, scene.StageFolder + "/Act" + scene.ActNo + ".map"));

                        List <string> files;
                        if (!Directories.TryGetValue(scene.StageFolder, out files))
                        {
                            files = new List <string>();
                            Directories[scene.StageFolder] = files;
                        }
                        files.Add("Act" + scene.ActNo + ".map");
                    }
                    break;

                case 1:
                    foreach (RSDKvRS.ZoneList.Level scene in CS.Stages)
                    {
                        scenes.Add(new Tuple <string, string>(scene.StageName, scene.StageFolder + "/Act" + scene.ActNo + ".map"));

                        List <string> files;
                        if (!Directories.TryGetValue(scene.StageFolder, out files))
                        {
                            files = new List <string>();
                            Directories[scene.StageFolder] = files;
                        }
                        files.Add("Act" + scene.ActNo + ".map");
                    }
                    break;

                case 2:
                    foreach (RSDKvRS.ZoneList.Level scene in SS.Stages)
                    {
                        scenes.Add(new Tuple <string, string>(scene.StageName, scene.StageFolder + "/Act" + scene.ActNo + ".map"));

                        List <string> files;
                        if (!Directories.TryGetValue(scene.StageFolder, out files))
                        {
                            files = new List <string>();
                            Directories[scene.StageFolder] = files;
                        }
                        files.Add("Act" + scene.ActNo + ".map");
                    }
                    break;

                case 3:
                    foreach (RSDKvRS.ZoneList.Level scene in BS.Stages)
                    {
                        scenes.Add(new Tuple <string, string>(scene.StageName, scene.StageFolder + "/Act" + scene.ActNo + ".map"));

                        List <string> files;
                        if (!Directories.TryGetValue(scene.StageFolder, out files))
                        {
                            files = new List <string>();
                            Directories[scene.StageFolder] = files;
                        }
                        files.Add("Act" + scene.ActNo + ".map");
                    }
                    break;

                default:
                    break;
                }

                string categoryName = "Unknown Category";

                switch (c)
                {
                case 0:
                    categoryName = "Regular Stages";
                    break;

                case 1:
                    categoryName = "Custom Stages";
                    break;

                case 2:
                    categoryName = "Special Stages";
                    break;

                case 3:
                    categoryName = "Bonus Stages";
                    break;

                default:
                    categoryName = "Unknown Category";
                    break;
                }

                Categories.Add(new Tuple <string, List <Tuple <string, string> > >(categoryName, scenes));
            }

            // Sort
            Directories = Directories.OrderBy(key => key.Key).ToDictionary((keyItem) => keyItem.Key, (valueItem) => valueItem.Value);
            foreach (KeyValuePair <string, List <String> > dir in Directories)
            {
                dir.Value.Sort();
            }

            this.scenesTree.ImageList = new ImageList();
            this.scenesTree.ImageList.Images.Add("Folder", RetroED.Properties.Resources.folder);
            this.scenesTree.ImageList.Images.Add("File", RetroED.Properties.Resources.file);

            UpdateTree();
            if (RetroED.Properties.Settings.Default.IsFilesViewDefault)
            {
                this.isFilesView.Checked = true;
            }
            else
            {
                this.isFilesView.Checked = false;
            }
        }