//起動用CSVをコンバート CsvInfo ConvertBootSetting(List <AdvExcelSheets> excelSheets, string chapterName, int version) { if (string.IsNullOrEmpty(chapterName)) { chapterName = AdvSheetParser.SheetNameBoot; } StringGrid grid = new StringGrid(chapterName, chapterName, CsvType.Tsv); grid.AddRow(new List <string> { AdvParser.Localize(AdvColumnName.Tag), AdvParser.Localize(AdvColumnName.Param1), AdvParser.Localize(AdvColumnName.Version) }); ///起動用データをコンバート foreach (var excel in excelSheets) { string excelName = System.IO.Path.GetFileNameWithoutExtension(excel.Path); //シナリオ設定シートは個別にコンバート AddFileDataToTsv(grid, version, excelName, AdvSheetParser.SheetNameScenario); foreach (var sheet in excel.SettingsSheets) { AddFileDataToTsv(grid, version, excelName, sheet.SheetName); } } string path = chapterName; return(new CsvInfo(grid, path)); }
/// <summary> /// CSVにコンバートする際起動用のBootファイルを作成 /// </summary> /// <param name="grid">エクセル側のデータ</param> public static StringGrid CreateOnCsvOnvert(StringGrid grid, int version) { if (grid == null) { grid = new StringGrid(AdvSettingDataManager.SheetNameBoot, CsvType.Tsv); grid.AddRow(new List <string> { AdvParser.Localize(AdvColumnName.Tag), AdvParser.Localize(AdvColumnName.Param1), AdvParser.Localize(AdvColumnName.Version) }); } ///起動用データをコンバート AdvBootSetting.AddDefaultUrlSettingsOnCsvOnvert(grid, version); return(grid); }
StringGrid MakeScenarioSettingGrid(int version) { StringGrid grid = new StringGrid(AdvSheetParser.SheetNameScenario, AdvSheetParser.SheetNameScenario, CsvType.Tsv); grid.AddRow(new List <string> { AdvParser.Localize(AdvColumnName.FileName), AdvParser.Localize(AdvColumnName.Version) }); grid.ParseHeader(); foreach (var sheet in ScenarioSheets) { grid.AddRow(new List <string> { this.Name + "/Scenario/" + sheet.SheetName, "" + version }); } return(grid); }
//#if UNITY_EDITOR /// <summary> /// エクセルからCSVファイルにコンバートする際に、シナリオ設定データをマージして作成する /// </summary> /// <param name="grid">シナリオ設定データ</param> /// <param name="scenarioSheetDictionary">シナリオデータ</param> /// <returns>マージしたシナリオ設定データ</returns> public static StringGrid MargeScenarioData(StringGrid grid, StringGridDictionary scenarioSheetDictionary, int version) { if (grid == null) { grid = new StringGrid(AdvSettingDataManager.SheetNameScenario, CsvType.Tsv); grid.AddRow(new List <string> { AdvParser.Localize(AdvColumnName.FileName), AdvParser.Localize(AdvColumnName.Version) }); grid.ParseHeader(); } List <string> addScnenarioList = new List <string>(); foreach (string sheetName in scenarioSheetDictionary.Keys) { bool isFind = false; foreach (StringGridRow row in grid.Rows) { if (AdvParser.ParseCell <string>(row, AdvColumnName.FileName) == sheetName) { isFind = true; } } if (!isFind) { addScnenarioList.Add(sheetName); } } foreach (string sheetName in addScnenarioList) { grid.AddRow(new List <string> { sheetName, "" + version }); } return(grid); }