コード例 #1
0
        private void GenerateModFile(string game, SonicRetro.SAModel.SAEditorCommon.UI.ProgressDialog progress, string projectFolder, string name)
        {
            progress.StepProgress();
            progress.SetStep("Generating mod.ini");
            string outputPath;

            switch (game)
            {
            case ("SADXPC"):
                SADXModInfo modInfoSADX = new SADXModInfo
                {
                    Name = name
                };
                outputPath = Path.Combine(projectFolder, string.Format("mod.ini"));

                SA_Tools.IniSerializer.Serialize(modInfoSADX, outputPath);
                break;

            case ("SA2PC"):
                SA2ModInfo modInfoSA2PC = new SA2ModInfo
                {
                    Name = name
                };
                outputPath = Path.Combine(projectFolder, string.Format("mod.ini"));

                SA_Tools.IniSerializer.Serialize(modInfoSA2PC, outputPath);
                break;

            default:
                break;
            }
        }
コード例 #2
0
ファイル: gameOptions.cs プロジェクト: Shadowth117/sa_tools
        private void btnOK_Click(object sender, EventArgs e)
        {
            string modName;

            switch (SAToolsHub.setGame)
            {
            case ("SADXPC"):
                SADXModInfo modInfoDX = SplitTools.IniSerializer.Deserialize <SADXModInfo>(Path.Combine(SAToolsHub.projectDirectory, "mod.ini"));
                modName = modInfoDX.Name;
                break;

            case ("SA2PC"):
                SA2ModInfo modInfoSA2 = SplitTools.IniSerializer.Deserialize <SA2ModInfo>(Path.Combine(SAToolsHub.projectDirectory, "mod.ini"));
                modName = modInfoSA2.Name;
                break;

            default:
                modName = "";
                break;
            }

            if (!Directory.Exists(Path.Combine(SAToolsHub.gameDirectory, "mods", modName)))
            {
                DialogResult buildCheckWindow = MessageBox.Show("No folder for this mod exists in " + SAToolsHub.setGame + "'s mod directory.\n\nWould you like to build a mod?", "Build Mod", MessageBoxButtons.YesNo);
                if (buildCheckWindow == DialogResult.Yes)
                {
                    buildWindowDiag.Show();
                }
                if (buildCheckWindow == DialogResult.No)
                {
                    if (gameLaunch == true)
                    {
                        RunGame();
                    }
                    else
                    {
                        RunModManager();
                    }

                    this.Close();
                }
            }
            else
            {
                UpdateModLoader(modName);
                if (gameLaunch == true)
                {
                    RunGame();
                }
                else
                {
                    RunModManager();
                }

                this.Close();
            }
        }
コード例 #3
0
        private void buttonOK_Click(object sender, EventArgs e)
        {
            string moddir = Path.Combine(Path.Combine(Environment.CurrentDirectory, "mods"), ValidateFilename(textModName.Text));

            if (textModName.Text.Length <= 0)
            {
                MessageBox.Show("You can't have a mod without a name.", "Invalid mod name", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            try
            {
                if (Directory.Exists(moddir))
                {
                    MessageBox.Show("A mod with that name already exists."
                                    + "\nPlease choose a different name or rename the existing one.", "Mod already exists",
                                    MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    return;
                }

                Directory.CreateDirectory(moddir);

                if (checkRedirectMainSave.Checked || checkRedirectChaoSave.Checked)
                {
                    Directory.CreateDirectory(Path.Combine(moddir, "SAVEDATA"));
                }

                SADXModInfo newMod = new SADXModInfo
                {
                    Name             = textModName.Text,
                    Author           = textModAuthor.Text,
                    Description      = textModDescription.Text,
                    Version          = textVersion.Text,
                    RedirectMainSave = checkRedirectMainSave.Checked,
                    RedirectChaoSave = checkRedirectChaoSave.Checked,
                    GitHubRepo       = textGitHubRepo.Text,
                    GitHubAsset      = textGitHubAttachment.Text,
                    UpdateUrl        = textDirUrl.Text
                };

                IniSerializer.Serialize(newMod, Path.Combine(moddir, "mod.ini"));

                if (checkOpenFolder.Checked)
                {
                    System.Diagnostics.Process.Start(moddir);
                }

                DialogResult = DialogResult.OK;
                Close();
            }
            catch (Exception error)
            {
                MessageBox.Show(this, error.Message, "Mod Creation Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #4
0
        private void GenerateSADXModFile(string gameFolder, string projectName)
        {
            SADXModInfo modInfo = new SADXModInfo
            {
                Author      = AuthorTextBox.Text,
                Name        = ProjectNameBox.Text,
                Version     = string.Format("0"),
                Description = DescriptionTextBox.Text
            };

            string outputPath = Path.Combine(gameFolder, string.Format("Projects/{0}/mod.ini", projectName));

            SA_Tools.IniSerializer.Serialize(modInfo, outputPath);
        }
コード例 #5
0
ファイル: ModConfigEditor.cs プロジェクト: inrg/sa_tools
        void Save()
        {
            string modInfoPath = Path.Combine(projectFolder, "mod.ini");

            // save mod info
            if (game == Game.SADX)
            {
                SADXModInfo sadxModInfo = IniSerializer.Deserialize <SADXModInfo>(modInfoPath);
                sadxModInfo.Name        = displayNameTextBox.Text;
                sadxModInfo.Description = descriptionTextBox.Text;

                IniSerializer.Serialize(sadxModInfo, modInfoPath);
            }
            else
            {
                SA2ModInfo sa2ModInfo = IniSerializer.Deserialize <SA2ModInfo>(modInfoPath);
                sa2ModInfo.Name        = displayNameTextBox.Text;
                sa2ModInfo.Description = descriptionTextBox.Text;

                IniSerializer.Serialize(sa2ModInfo, modInfoPath);
            }

            // save project settings
            string projectSettingsPath = Path.Combine(projectFolder, "ProjectSettings.ini");

            projectSettings.OtherModsToRun.Clear();

            string[] otherMods = otherModsTextBox.Text.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);

            foreach (string otherMod in otherMods)
            {
                if (otherMod.Length > 0)
                {
                    projectSettings.OtherModsToRun.Add(otherMod);
                }
            }

            // update project settings
            projectSettings.PostBuildScript = postBuildScript.Text;

            IniSerializer.Serialize(projectSettings, projectSettingsPath);
        }
コード例 #6
0
ファイル: ModConfigEditor.cs プロジェクト: inrg/sa_tools
        private void ModConfigEditor_Shown(object sender, EventArgs e)
        {
            // load mod info
            if (game == Game.SADX)
            {
                SADXModInfo sadxModInfo = IniSerializer.Deserialize <SADXModInfo>(Path.Combine(projectFolder, "mod.ini"));

                displayNameTextBox.Text = sadxModInfo.Name;
                descriptionTextBox.Text = sadxModInfo.Description;
            }
            else
            {
                SA2ModInfo sa2ModInfo = IniSerializer.Deserialize <SA2ModInfo>(Path.Combine(projectFolder, "mod.ini"));

                displayNameTextBox.Text = sa2ModInfo.Name;
                descriptionTextBox.Text = sa2ModInfo.Description;
            }

            // load project settings
            string projectSettingsPath = Path.Combine(projectFolder, "ProjectSettings.ini");

            if (File.Exists(projectSettingsPath))
            {
                projectSettings = IniSerializer.Deserialize <ProjectSettings>(projectSettingsPath);
            }
            else
            {
                projectSettings = new ProjectSettings();
            }


            otherModsTextBox.Text = "";

            foreach (string otherMod in projectSettings.OtherModsToRun)
            {
                otherModsTextBox.Text = string.Format("{0}{1}{2}", otherModsTextBox.Text, (otherModsTextBox.Text.Length > 0) ? Environment.NewLine : "", otherMod);
            }

            postBuildScript.Text = projectSettings.PostBuildScript;
        }
コード例 #7
0
        private void editProj_Shown(object sender, EventArgs e)
        {
            setVariables();
            clearVariables();
            string game = SAToolsHub.setGame;

            radGitHub.Checked = true;

            switch (game)
            {
            case "SADXPC":
                SADXModInfo modInfoSADX = SA_Tools.IniSerializer.Deserialize <SADXModInfo>(projModFile);
                txtName.Text   = modInfoSADX.Name;
                txtAuth.Text   = modInfoSADX.Author;
                txtDesc.Text   = modInfoSADX.Description;
                txtVerNum.Text = modInfoSADX.Version;

                if (modInfoSADX.DLLFile != null)
                {
                    chkDLLFile.Checked = true;
                    txtDLLName.Text    = modInfoSADX.DLLFile;
                }
                if (modInfoSADX.RedirectMainSave)
                {
                    chkMainRedir.Checked = true;
                }
                if (modInfoSADX.RedirectChaoSave)
                {
                    chkChaoRedir.Checked = true;
                }
                if (modInfoSADX.GitHubRepo != null || modInfoSADX.GameBananaItemId.HasValue || modInfoSADX.UpdateUrl != null)
                {
                    chkUpdates.Checked = true;
                    if (modInfoSADX.GitHubRepo != null)
                    {
                        radGitHub.Checked = true;
                        txtUpdateURL.Text = modInfoSADX.GitHubRepo;
                        txtAsset.Text     = modInfoSADX.GitHubAsset;
                    }
                    if (modInfoSADX.GameBananaItemId.HasValue)
                    {
                        radGamebanana.Checked = true;
                        txtUpdateURL.Text     = modInfoSADX.GameBananaItemId.ToString();
                        lstGBItems.Text       = modInfoSADX.GameBananaItemType;
                    }
                    if (modInfoSADX.UpdateUrl != null)
                    {
                        radManual.Checked = true;
                        txtUpdateURL.Text = modInfoSADX.UpdateUrl;
                        txtAsset.Text     = modInfoSADX.ChangelogUrl;
                    }
                }
                break;

            case "SA2PC":
                SA2ModInfo modInfoSA2PC = SA_Tools.IniSerializer.Deserialize <SA2ModInfo>(projModFile);
                txtName.Text   = modInfoSA2PC.Name;
                txtAuth.Text   = modInfoSA2PC.Author;
                txtDesc.Text   = modInfoSA2PC.Description;
                txtVerNum.Text = modInfoSA2PC.Version;
                if (modInfoSA2PC.DLLFile != null)
                {
                    chkDLLFile.Checked = true;
                    txtDLLName.Text    = modInfoSA2PC.DLLFile;
                }
                if (modInfoSA2PC.RedirectMainSave)
                {
                    chkMainRedir.Checked = true;
                }
                if (modInfoSA2PC.RedirectChaoSave)
                {
                    chkChaoRedir.Checked = true;
                }
                if (modInfoSA2PC.GitHubRepo != null || modInfoSA2PC.GameBananaItemId.HasValue || modInfoSA2PC.UpdateUrl != null)
                {
                    chkUpdates.Checked = true;
                    if (modInfoSA2PC.GitHubRepo != null)
                    {
                        radGitHub.Checked = true;
                        txtUpdateURL.Text = modInfoSA2PC.GitHubRepo;
                        txtAsset.Text     = modInfoSA2PC.GitHubAsset;
                    }
                    if (modInfoSA2PC.GameBananaItemId.HasValue)
                    {
                        radGamebanana.Checked = true;
                        txtUpdateURL.Text     = modInfoSA2PC.GameBananaItemId.ToString();
                        txtAsset.Text         = modInfoSA2PC.GameBananaItemType;
                    }
                    if (modInfoSA2PC.UpdateUrl != null)
                    {
                        radManual.Checked = true;
                        txtUpdateURL.Text = modInfoSA2PC.UpdateUrl;
                        txtAsset.Text     = modInfoSA2PC.ChangelogUrl;
                    }
                }
                break;

            default:
                break;
            }
        }
コード例 #8
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            string game = SAToolsHub.setGame;

            switch (game)
            {
            case "SADXPC":
                SADXModInfo modInfoSADX = new SADXModInfo();
                modInfoSADX.Name        = txtName.Text;
                modInfoSADX.Author      = txtAuth.Text;
                modInfoSADX.Description = txtDesc.Text;
                modInfoSADX.Version     = txtVerNum.Text;
                if (chkDLLFile.Checked)
                {
                    modInfoSADX.DLLFile = txtDLLName.Text;
                }
                if (chkMainRedir.Checked)
                {
                    modInfoSADX.RedirectMainSave = true;
                }
                if (chkChaoRedir.Checked)
                {
                    modInfoSADX.RedirectChaoSave = true;
                }
                if (chkUpdates.Checked && radGitHub.Checked)
                {
                    modInfoSADX.GitHubRepo  = txtUpdateURL.Text;
                    modInfoSADX.GitHubAsset = txtAsset.Text;
                }
                if (chkUpdates.Checked && radGamebanana.Checked)
                {
                    modInfoSADX.GameBananaItemId   = Convert.ToInt64(txtUpdateURL.Text);
                    modInfoSADX.GameBananaItemType = lstGBItems.Text;
                }
                if (chkUpdates.Checked && radManual.Checked)
                {
                    modInfoSADX.UpdateUrl    = txtUpdateURL.Text;
                    modInfoSADX.ChangelogUrl = txtAsset.Text;
                }

                SA_Tools.IniSerializer.Serialize(modInfoSADX, projModFile);
                break;

            case "SA2PC":
                SADXModInfo modInfoSA2PC = new SADXModInfo();
                modInfoSA2PC.Name        = txtName.Text;
                modInfoSA2PC.Author      = txtAuth.Text;
                modInfoSA2PC.Description = txtDesc.Text;
                modInfoSA2PC.Version     = txtVerNum.Text;
                if (chkDLLFile.Checked)
                {
                    modInfoSA2PC.DLLFile = txtDLLName.Text;
                }
                if (chkMainRedir.Checked)
                {
                    modInfoSA2PC.RedirectMainSave = true;
                }
                if (chkChaoRedir.Checked)
                {
                    modInfoSA2PC.RedirectChaoSave = true;
                }
                if (chkUpdates.Checked && radGitHub.Checked)
                {
                    modInfoSA2PC.GitHubRepo  = txtUpdateURL.Text;
                    modInfoSA2PC.GitHubAsset = txtAsset.Text;
                }
                if (chkUpdates.Checked && radGamebanana.Checked)
                {
                    modInfoSA2PC.GameBananaItemId   = Convert.ToInt64(txtUpdateURL.Text);
                    modInfoSA2PC.GameBananaItemType = lstGBItems.Text;
                }
                if (chkUpdates.Checked && radManual.Checked)
                {
                    modInfoSA2PC.UpdateUrl    = txtUpdateURL.Text;
                    modInfoSA2PC.ChangelogUrl = txtAsset.Text;
                }

                SA_Tools.IniSerializer.Serialize(modInfoSA2PC, projModFile);
                break;

            default:
                break;
            }

            this.Close();
        }
コード例 #9
0
        private void AutoBuild(Action showProgress, Action <string> updateProgress)
        {
            showProgress();

            Dictionary <string, SonicRetro.SAModel.SAEditorCommon.ManualBuildWindow.AssemblyType> assemblies =
                new Dictionary <string, SonicRetro.SAModel.SAEditorCommon.ManualBuildWindow.AssemblyType>();

            string modFolder = Path.Combine(Program.Settings.GetModPathForGame(game),
                                            projectName);

            Directory.CreateDirectory(modFolder);

            updateProgress("Getting Assemblies");
            switch (game)
            {
            case SA_Tools.Game.SADX:
                List <String> sadxAssemblyNames = GetSADXAssemblyNames();

                // check for chrmodels or chrmodels_orig
                string chrmodels     = "chrmodels";
                string chrmodelsOrig = "chrmodels_orig";

                string chrmodelsCompletePath     = Path.Combine(projectFolder, chrmodels + "_data.ini");
                string chrmodelsOrigCompletePath = Path.Combine(projectFolder, chrmodelsOrig + "_data.ini");

                if (File.Exists(chrmodelsCompletePath))
                {
                    sadxAssemblyNames.Add(chrmodels);
                }
                else
                {
                    sadxAssemblyNames.Add(chrmodelsOrig);
                }

                assemblies.Add("sonic", SonicRetro.SAModel.SAEditorCommon.ManualBuildWindow.AssemblyType.Exe);

                foreach (string assemblyName in sadxAssemblyNames)
                {
                    assemblies.Add(assemblyName, SonicRetro.SAModel.SAEditorCommon.ManualBuildWindow.AssemblyType.DLL);
                }
                break;

            case SA_Tools.Game.SA2B:
                // dll
                assemblies.Add("Data_DLL_orig", SonicRetro.SAModel.SAEditorCommon.ManualBuildWindow.AssemblyType.DLL);

                // exe
                assemblies.Add("sonic2app", SonicRetro.SAModel.SAEditorCommon.ManualBuildWindow.AssemblyType.Exe);
                break;

            default:
                break;
            }

            // export only the modified items in each assembly
            updateProgress("Exporting Assembies");

            foreach (KeyValuePair <string, SonicRetro.SAModel.SAEditorCommon.ManualBuildWindow.AssemblyType> assembly in
                     assemblies)
            {
                string iniPath = Path.Combine(projectFolder, assembly.Key + "_data.ini");

                Dictionary <string, bool> itemsToExport = new Dictionary <string, bool>();

                switch (assembly.Value)
                {
                case SonicRetro.SAModel.SAEditorCommon.ManualBuildWindow.AssemblyType.Exe:
                    SA_Tools.IniData iniData = SonicRetro.SAModel.SAEditorCommon.StructConverter.StructConverter.LoadINI(iniPath, ref itemsToExport);

                    SonicRetro.SAModel.SAEditorCommon.StructConverter.StructConverter.ExportINI(iniData,
                                                                                                itemsToExport, Path.Combine(modFolder, assembly.Key + "_data.ini"));
                    break;

                case SonicRetro.SAModel.SAEditorCommon.ManualBuildWindow.AssemblyType.DLL:
                    SA_Tools.SplitDLL.DllIniData dllIniData =
                        SonicRetro.SAModel.SAEditorCommon.DLLModGenerator.DLLModGen.LoadINI(iniPath, ref itemsToExport);

                    SonicRetro.SAModel.SAEditorCommon.DLLModGenerator.DLLModGen.ExportINI(dllIniData,
                                                                                          itemsToExport, Path.Combine(modFolder, assembly.Key + "_data.ini"));
                    break;

                default:
                    break;
                }
            }

            // copy system folder
            updateProgress("Copying System Folder");
            CopySystemFolder(modFolder);

            // generate final mod.ini based off of one in project folder
            updateProgress("Creating Mod.ini");

            string       baseModIniPath   = Path.Combine(projectFolder, "mod.ini");
            string       outputModIniPath = Path.Combine(modFolder, "mod.ini");
            const string dataSuffix       = "_data.ini";

            switch (game)
            {
            case SA_Tools.Game.SADX:
                SADXModInfo sadxModInfo = SA_Tools.IniSerializer.Deserialize <SADXModInfo>(baseModIniPath);

                // set all of our assemblies properly
                string ADV00MODELS               = "ADV00MODELS";
                string ADV01CMODELS              = "ADV01CMODELS";
                string ADV01MODELS               = "ADV01MODELS";
                string ADV02MODELS               = "ADV02MODELS";
                string ADV03MODELS               = "ADV03MODELS";
                string BOSSCHAOS0MODELS          = "BOSSCHAOS0MODELS";
                string CHAOSTGGARDEN02MR_DAYTIME = "CHAOSTGGARDEN02MR_DAYTIME";
                string CHAOSTGGARDEN02MR_EVENING = "CHAOSTGGARDEN02MR_EVENING";
                string CHAOSTGGARDEN02MR_NIGHT   = "CHAOSTGGARDEN02MR_NIGHT";

                if (assemblies.ContainsKey(ADV00MODELS))
                {
                    sadxModInfo.ADV00MODELSData = ADV00MODELS + dataSuffix;
                }
                if (assemblies.ContainsKey(ADV01CMODELS))
                {
                    sadxModInfo.ADV01CMODELSData = ADV01CMODELS + dataSuffix;
                }
                if (assemblies.ContainsKey(ADV01MODELS))
                {
                    sadxModInfo.ADV01MODELSData = ADV01MODELS + dataSuffix;
                }
                if (assemblies.ContainsKey(ADV02MODELS))
                {
                    sadxModInfo.ADV02MODELSData = ADV02MODELS + dataSuffix;
                }
                if (assemblies.ContainsKey(ADV03MODELS))
                {
                    sadxModInfo.ADV03MODELSData = ADV03MODELS + dataSuffix;
                }
                if (assemblies.ContainsKey(BOSSCHAOS0MODELS))
                {
                    sadxModInfo.BOSSCHAOS0MODELSData = BOSSCHAOS0MODELS + dataSuffix;
                }
                if (assemblies.ContainsKey(CHAOSTGGARDEN02MR_DAYTIME))
                {
                    sadxModInfo.CHAOSTGGARDEN02MR_DAYTIMEData = CHAOSTGGARDEN02MR_DAYTIME + dataSuffix;
                }
                if (assemblies.ContainsKey(CHAOSTGGARDEN02MR_EVENING))
                {
                    sadxModInfo.CHAOSTGGARDEN02MR_EVENINGData = CHAOSTGGARDEN02MR_EVENING + dataSuffix;
                }
                if (assemblies.ContainsKey(CHAOSTGGARDEN02MR_NIGHT))
                {
                    sadxModInfo.CHAOSTGGARDEN02MR_NIGHTData = CHAOSTGGARDEN02MR_NIGHT + dataSuffix;
                }
                if (assemblies.ContainsKey("sonic"))
                {
                    sadxModInfo.EXEData = "sonic_data.ini";
                }

                // save our output
                SA_Tools.IniSerializer.Serialize(sadxModInfo, outputModIniPath);
                break;

            case SA_Tools.Game.SA2B:
                SA2ModInfo sa2ModInfo = SA_Tools.IniSerializer.Deserialize <SA2ModInfo>(baseModIniPath);

                if (assemblies.ContainsKey("Data_DLL_orig"))
                {
                    sa2ModInfo.DLLData = "Data_DLL_orig" + dataSuffix;
                }
                if (assemblies.ContainsKey("sonic2app"))
                {
                    sa2ModInfo.EXEData = "sonic2app_data.ini";
                }

                // save our output
                SA_Tools.IniSerializer.Serialize(sa2ModInfo, outputModIniPath);
                break;

            default:
                break;
            }

            // execute our post-build script
            string projectSettingsPath = Path.Combine(projectFolder, "ProjectSettings.ini");

            if (File.Exists(projectSettingsPath))
            {
                ProjectSettings projectSettings = SA_Tools.IniSerializer.Deserialize <ProjectSettings>(projectSettingsPath);

                string storedEnvironmentDirectory = Environment.CurrentDirectory;

                if (File.Exists(projectSettings.PostBuildScript))
                {
                    System.Diagnostics.ProcessStartInfo procStartInfo =
                        new System.Diagnostics.ProcessStartInfo(projectSettings.PostBuildScript);

                    System.Diagnostics.Process process = System.Diagnostics.Process.Start(procStartInfo);

                    while (!process.HasExited)
                    {
                        System.Threading.Thread.Sleep(100);
                    }

                    Environment.CurrentDirectory = storedEnvironmentDirectory;
                }
            }
        }
コード例 #10
0
ファイル: buildWindow.cs プロジェクト: Shadowth117/sa_tools
        private void buildWindow_Shown(object sender, EventArgs e)
        {
            chkBoxEXE.Items.Clear();
            chkBoxDLL.Items.Clear();
            chkBoxMDL.Items.Clear();
            iniEXEFiles.Clear();
            iniDLLFiles.Clear();
            sa2MdlMtnFiles.Clear();

            switch (SAToolsHub.setGame)
            {
            case ("SADXPC"):
                SADXModInfo sadxMod = SplitTools.IniSerializer.Deserialize <SADXModInfo>(Path.Combine(SAToolsHub.projectDirectory, "mod.ini"));
                modName   = sadxMod.Name;
                gameEXE   = "sonic";
                sysFolder = "system";

                tabControl1.TabPages.Remove(tabMDL);
                break;

            case ("SA2PC"):
                SA2ModInfo sa2Mod = SplitTools.IniSerializer.Deserialize <SA2ModInfo>(Path.Combine(SAToolsHub.projectDirectory, "mod.ini"));
                modName   = sa2Mod.Name;
                gameEXE   = "sonic2app";
                sysFolder = "gd_PC";

                if (!tabControl1.Contains(tabMDL))
                {
                    tabControl1.TabPages.Add(tabMDL);
                }
                DirectoryInfo charFiles = new DirectoryInfo(Path.Combine(SAToolsHub.projectDirectory, "figure\\bin"));

                foreach (DirectoryInfo dir in charFiles.GetDirectories())
                {
                    string name = dir.Name;
                    if (name.Contains("mdl") || name.Contains("mtn"))
                    {
                        chkBoxMDL.Items.Add(name);
                    }
                }
                break;
            }

            foreach (Templates.SplitEntry splitEntry in SAToolsHub.projSplitEntries)
            {
                string srcFile = splitEntry.SourceFile.ToLower();
                if (srcFile.Contains("exe"))
                {
                    chkBoxEXE.Items.Add(splitEntry);
                    if (splitEntry.CmnName != null)
                    {
                        chkBoxEXE.DisplayMember = "CmnName";
                    }
                    else
                    {
                        chkBoxEXE.DisplayMember = "IniFile";
                    }
                }

                if (srcFile.Contains("dll"))
                {
                    chkBoxDLL.Items.Add(splitEntry);
                    if (splitEntry.CmnName != null)
                    {
                        chkBoxDLL.DisplayMember = "CmnName";
                    }
                    else
                    {
                        chkBoxDLL.DisplayMember = "IniFile";
                    }
                }
            }
        }
コード例 #11
0
ファイル: buildWindow.cs プロジェクト: Shadowth117/sa_tools
        void createMod()
        {
            string       baseModIniPath   = Path.Combine(SAToolsHub.projectDirectory, "mod.ini");
            string       outputModIniPath = Path.Combine(modFolder, "mod.ini");
            const string dataSuffix       = "_data.ini";

            switch (SAToolsHub.setGame)
            {
            case "SADXPC":
                SADXModInfo sadxModInfo = SplitTools.IniSerializer.Deserialize <SADXModInfo>(baseModIniPath);

                // set all of our assemblies properly
                string ADV00MODELS               = "adv00_dll";
                string ADV01CMODELS              = "adv0130_dll";
                string ADV01MODELS               = "adv0100_dll";
                string ADV02MODELS               = "adv02_dll";
                string ADV03MODELS               = "adv03_dll";
                string BOSSCHAOS0MODELS          = "b_chaos0_dll";
                string CHAOSTGGARDEN02MR_DAYTIME = "chaostggarden02mr_daytime";
                string CHAOSTGGARDEN02MR_EVENING = "chaostggarden02mr_evening";
                string CHAOSTGGARDEN02MR_NIGHT   = "chaostggarden02mr_night";

                if (assemblies.ContainsKey(ADV00MODELS))
                {
                    sadxModInfo.ADV00MODELSData = ADV00MODELS + dataSuffix;
                }
                if (assemblies.ContainsKey(ADV01CMODELS))
                {
                    sadxModInfo.ADV01CMODELSData = ADV01CMODELS + dataSuffix;
                }
                if (assemblies.ContainsKey(ADV01MODELS))
                {
                    sadxModInfo.ADV01MODELSData = ADV01MODELS + dataSuffix;
                }
                if (assemblies.ContainsKey(ADV02MODELS))
                {
                    sadxModInfo.ADV02MODELSData = ADV02MODELS + dataSuffix;
                }
                if (assemblies.ContainsKey(ADV03MODELS))
                {
                    sadxModInfo.ADV03MODELSData = ADV03MODELS + dataSuffix;
                }
                if (assemblies.ContainsKey(BOSSCHAOS0MODELS))
                {
                    sadxModInfo.BOSSCHAOS0MODELSData = BOSSCHAOS0MODELS + dataSuffix;
                }
                if (assemblies.ContainsKey(CHAOSTGGARDEN02MR_DAYTIME))
                {
                    sadxModInfo.CHAOSTGGARDEN02MR_DAYTIMEData = CHAOSTGGARDEN02MR_DAYTIME + dataSuffix;
                }
                if (assemblies.ContainsKey(CHAOSTGGARDEN02MR_EVENING))
                {
                    sadxModInfo.CHAOSTGGARDEN02MR_EVENINGData = CHAOSTGGARDEN02MR_EVENING + dataSuffix;
                }
                if (assemblies.ContainsKey(CHAOSTGGARDEN02MR_NIGHT))
                {
                    sadxModInfo.CHAOSTGGARDEN02MR_NIGHTData = CHAOSTGGARDEN02MR_NIGHT + dataSuffix;
                }
                if (iniEXEFiles.Count > 0)
                {
                    sadxModInfo.EXEData = "sonic_data.ini";
                }
                if (assemblies.ContainsKey("chrmodels"))
                {
                    sadxModInfo.CHRMODELSData = "chrmodels_data.ini";
                }

                SplitTools.IniSerializer.Serialize(sadxModInfo, outputModIniPath);
                break;

            case "SA2PC":
                SA2ModInfo sa2ModInfo = SplitTools.IniSerializer.Deserialize <SA2ModInfo>(baseModIniPath);

                if (iniDLLFiles.Count > 0)
                {
                    sa2ModInfo.DLLData = "Data_DLL_orig_data.ini";
                }
                if (iniEXEFiles.Count > 0)
                {
                    sa2ModInfo.EXEData = "sonic2app_data.ini";
                }

                SplitTools.IniSerializer.Serialize(sa2ModInfo, outputModIniPath);
                break;

            default:
                break;
            }
        }
コード例 #12
0
        void createMod()
        {
            string       baseModIniPath   = Path.Combine(SAToolsHub.projectDirectory, "mod.ini");
            string       outputModIniPath = Path.Combine(modFolder, "mod.ini");
            const string dataSuffix       = "_data.ini";

            switch (SAToolsHub.setGame)
            {
            case "SADXPC":
                SADXModInfo sadxModInfo = SA_Tools.IniSerializer.Deserialize <SADXModInfo>(baseModIniPath);

                // set all of our assemblies properly
                string ADV00MODELS               = "ADV00MODELS";
                string ADV01CMODELS              = "ADV01CMODELS";
                string ADV01MODELS               = "ADV01MODELS";
                string ADV02MODELS               = "ADV02MODELS";
                string ADV03MODELS               = "ADV03MODELS";
                string BOSSCHAOS0MODELS          = "BOSSCHAOS0MODELS";
                string CHAOSTGGARDEN02MR_DAYTIME = "CHAOSTGGARDEN02MR_DAYTIME";
                string CHAOSTGGARDEN02MR_EVENING = "CHAOSTGGARDEN02MR_EVENING";
                string CHAOSTGGARDEN02MR_NIGHT   = "CHAOSTGGARDEN02MR_NIGHT";

                if (assemblies.ContainsKey(ADV00MODELS))
                {
                    sadxModInfo.ADV00MODELSData = ADV00MODELS + dataSuffix;
                }
                if (assemblies.ContainsKey(ADV01CMODELS))
                {
                    sadxModInfo.ADV01CMODELSData = ADV01CMODELS + dataSuffix;
                }
                if (assemblies.ContainsKey(ADV01MODELS))
                {
                    sadxModInfo.ADV01MODELSData = ADV01MODELS + dataSuffix;
                }
                if (assemblies.ContainsKey(ADV02MODELS))
                {
                    sadxModInfo.ADV02MODELSData = ADV02MODELS + dataSuffix;
                }
                if (assemblies.ContainsKey(ADV03MODELS))
                {
                    sadxModInfo.ADV03MODELSData = ADV03MODELS + dataSuffix;
                }
                if (assemblies.ContainsKey(BOSSCHAOS0MODELS))
                {
                    sadxModInfo.BOSSCHAOS0MODELSData = BOSSCHAOS0MODELS + dataSuffix;
                }
                if (assemblies.ContainsKey(CHAOSTGGARDEN02MR_DAYTIME))
                {
                    sadxModInfo.CHAOSTGGARDEN02MR_DAYTIMEData = CHAOSTGGARDEN02MR_DAYTIME + dataSuffix;
                }
                if (assemblies.ContainsKey(CHAOSTGGARDEN02MR_EVENING))
                {
                    sadxModInfo.CHAOSTGGARDEN02MR_EVENINGData = CHAOSTGGARDEN02MR_EVENING + dataSuffix;
                }
                if (assemblies.ContainsKey(CHAOSTGGARDEN02MR_NIGHT))
                {
                    sadxModInfo.CHAOSTGGARDEN02MR_NIGHTData = CHAOSTGGARDEN02MR_NIGHT + dataSuffix;
                }
                if (iniEXEFiles.Count > 0)
                {
                    sadxModInfo.EXEData = "sonic_data.ini";
                }
                if (File.Exists(Path.Combine(SAToolsHub.projectDirectory, "chrmodels_orig_data.ini")))
                {
                    if (assemblies.ContainsKey("CHRMODELS_Orig"))
                    {
                        sadxModInfo.CHRMODELSData = "chrmodels_orig_data.ini";
                    }
                }
                else
                {
                    if (assemblies.ContainsKey("CHRMODELS"))
                    {
                        sadxModInfo.CHRMODELSData = "chrmodels_data.ini";
                    }
                }

                SA_Tools.IniSerializer.Serialize(sadxModInfo, outputModIniPath);
                break;

            case "SA2PC":
                SA2ModInfo sa2ModInfo = SA_Tools.IniSerializer.Deserialize <SA2ModInfo>(baseModIniPath);

                if (File.Exists(Path.Combine(SAToolsHub.projectDirectory, "Data_DLL_orig.ini")))
                {
                    if (assemblies.ContainsKey("Data_DLL_orig"))
                    {
                        sa2ModInfo.DLLData = "Data_DLL_orig.ini";
                    }
                }
                else
                {
                    if (assemblies.ContainsKey("Data_DLL"))
                    {
                        sa2ModInfo.DLLData = "Data_DLL.ini";
                    }
                }

                if (iniEXEFiles.Count > 0)
                {
                    sa2ModInfo.EXEData = "sonic2app_data.ini";
                }

                SA_Tools.IniSerializer.Serialize(sa2ModInfo, outputModIniPath);
                break;

            default:
                break;
            }
        }