2using System.Collections.Generic;
4using NPOI.SS.UserModel;
5using NPOI.XSSF.UserModel;
10 public static Dictionary<string, string>
fallbackTypes =
new Dictionary<string, string>();
23 string text =
"type_resolver.txt";
24 string[] array =
new string[0];
31 array =
new string[2] {
"TrueArena,ArenaWaveEvent,ZoneEvent",
"Elin-GeneRecombinator,Elin_GeneRecombinator.IncubationSacrifice,Chara" };
34 string[] array2 = array;
35 for (
int i = 0; i < array2.Length; i++)
37 string[] array3 = array2[i].Split(
',');
38 if (array3.Length >= 2)
52 Debug.Log(
"ImportExcel source:" + source?.ToString() +
" Path:" + pathToExcelFile);
53 using FileStream @is = File.Open(pathToExcelFile, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
54 XSSFWorkbook xSSFWorkbook =
new XSSFWorkbook((Stream)@is);
55 for (
int i = 0; i < xSSFWorkbook.NumberOfSheets; i++)
57 ISheet sheetAt = xSSFWorkbook.GetSheetAt(i);
58 if (sheetAt.SheetName != sheetName)
62 Debug.Log(
"Importing Sheet:" + sheetName);
65 if (!source.
ImportData(sheetAt,
new FileInfo(pathToExcelFile).Name, overwrite:
true))
70 Debug.Log(
"Imported " + sheetAt.SheetName);
75 Debug.LogError(
"[Error] Skipping import " + sheetAt.SheetName +
" :" + ex.Message +
"/" + ex.Source +
"/" + ex.StackTrace);
static SourceManager sources
static void RegisterSerializedTypeFallback(string nameAssembly, string nameType, string nameFallbackType)
static Dictionary< string, string > fallbackTypes
static void OnModsActivated()
static void LoadTypeFallback()
static void ImportExcel(string pathToExcelFile, string sheetName, SourceData source)
override bool ImportData(ISheet sheet, string bookname, bool overwrite=false)