Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
ModUtil Class Reference
Inheritance diagram for ModUtil:
EClass

Static Public Member Functions

static void Test ()
 
static void OnModsActivated ()
 
static void RegisterSerializedTypeFallback (string nameAssembly, string nameType, string nameFallbackType)
 
static void ImportExcel (string pathToExcelFile, string sheetName, SourceData source)
 
- Static Public Member Functions inherited from EClass
static int rnd (int a)
 
static int curve (int a, int start, int step, int rate=75)
 
static int rndHalf (int a)
 
static float rndf (float a)
 
static int rndSqrt (int a)
 
static void Wait (float a, Card c)
 
static void Wait (float a, Point p)
 
static int Bigger (int a, int b)
 
static int Smaller (int a, int b)
 

Static Public Attributes

static Dictionary< string, string > fallbackTypes = new Dictionary<string, string>()
 
- Static Public Attributes inherited from EClass
static Core core
 

Additional Inherited Members

- Properties inherited from EClass
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static FactionBranch Branch [get]
 
static FactionBranch BranchOrHomeBranch [get]
 
static Faction Home [get]
 
static Faction Wilds [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static GameSetting setting [get]
 
static GameData gamedata [get]
 
static ColorProfile Colors [get]
 
static World world [get]
 
static SourceManager sources [get]
 
static SourceManager editorSources [get]
 
static SoundManager Sound [get]
 
static CoreDebug debug [get]
 

Detailed Description

Definition at line 8 of file ModUtil.cs.

Member Function Documentation

◆ ImportExcel()

static void ModUtil.ImportExcel ( string  pathToExcelFile,
string  sheetName,
SourceData  source 
)
inlinestatic

Definition at line 27 of file ModUtil.cs.

28 {
29 Debug.Log("ImportExcel source:" + source?.ToString() + " Path:" + pathToExcelFile);
30 using FileStream @is = File.Open(pathToExcelFile, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
31 XSSFWorkbook xSSFWorkbook = new XSSFWorkbook((Stream)@is);
32 for (int i = 0; i < xSSFWorkbook.NumberOfSheets; i++)
33 {
34 ISheet sheetAt = xSSFWorkbook.GetSheetAt(i);
35 if (sheetAt.SheetName != sheetName)
36 {
37 continue;
38 }
39 Debug.Log("Importing Sheet:" + sheetName);
40 try
41 {
42 if (!source.ImportData(sheetAt, new FileInfo(pathToExcelFile).Name, overwrite: true))
43 {
44 Debug.LogError(ERROR.msg);
45 break;
46 }
47 Debug.Log("Imported " + sheetAt.SheetName);
48 source.Reset();
49 }
50 catch (Exception ex)
51 {
52 Debug.LogError("[Error] Skipping import " + sheetAt.SheetName + " :" + ex.Message + "/" + ex.Source + "/" + ex.StackTrace);
53 break;
54 }
55 }
56 }
Definition: ERROR.cs:2
static string msg
Definition: ERROR.cs:3
override bool ImportData(ISheet sheet, string bookname, bool overwrite=false)
Definition: SourceData.cs:134
override void Reset()
Definition: SourceData.cs:113

References Debug, SourceData< T, T2 >.ImportData(), ERROR.msg, and SourceData< T, T2 >.Reset().

Referenced by Test().

◆ OnModsActivated()

static void ModUtil.OnModsActivated ( )
inlinestatic

Definition at line 17 of file ModUtil.cs.

18 {
19 RegisterSerializedTypeFallback("TrueArena", "ArenaWaveEvent", "ZoneEvent");
20 }
static void RegisterSerializedTypeFallback(string nameAssembly, string nameType, string nameFallbackType)
Definition: ModUtil.cs:22

References RegisterSerializedTypeFallback().

Referenced by ModManager.RefreshMods().

◆ RegisterSerializedTypeFallback()

static void ModUtil.RegisterSerializedTypeFallback ( string  nameAssembly,
string  nameType,
string  nameFallbackType 
)
inlinestatic

Definition at line 22 of file ModUtil.cs.

23 {
24 fallbackTypes[nameType] = nameFallbackType;
25 }
static Dictionary< string, string > fallbackTypes
Definition: ModUtil.cs:10

References fallbackTypes.

Referenced by OnModsActivated().

◆ Test()

static void ModUtil.Test ( )
inlinestatic

Definition at line 12 of file ModUtil.cs.

13 {
15 }
Definition: EClass.cs:5
static SourceManager sources
Definition: EClass.cs:42
static void ImportExcel(string pathToExcelFile, string sheetName, SourceData source)
Definition: ModUtil.cs:27
SourceChara charas

References SourceManager.charas, ImportExcel(), and EClass.sources.

Member Data Documentation

◆ fallbackTypes

Dictionary<string, string> ModUtil.fallbackTypes = new Dictionary<string, string>()
static

The documentation for this class was generated from the following file: