Elin Decompiled Documentation EA 23.316 Nightly
Loading...
Searching...
No Matches
SourceManager.cs
Go to the documentation of this file.
1using System.Collections.Generic;
2using System.Linq;
3using System.Reflection;
4using UnityEngine;
5
6public class SourceManager : EMono
7{
9
11
13
15
17
18 public SourceCard cards = new SourceCard();
19
21
23
25
27
29
31
33
35
37
39
41
43
45
47
49
51
53
55
57
59
61
63
65
67
69
71
73
75
77
79
81
83
85
87
89
91
92 private List<SourceData> list = new List<SourceData>();
93
94 public bool initialized;
95
96 public void InitLang()
97 {
98 langGeneral.Init();
99 langGame.Init();
100 langList.Init();
101 langNote.Init();
102 langWord.Init();
103 Lang.General = langGeneral;
104 Lang.Game = langGame;
105 Lang.List = langList;
106 Lang.Note = langNote;
107 WordGen.source = langWord;
108 }
109
110 public void OnChangeLang()
111 {
112 }
113
114 public void Init()
115 {
116 Debug.Log("SourceManager Init");
117 if (initialized)
118 {
119 return;
120 }
121 initialized = true;
122 list.Clear();
123 FieldInfo[] fields = GetType().GetFields();
124 foreach (FieldInfo fieldInfo in fields)
125 {
126 if (typeof(SourceData).IsAssignableFrom(fieldInfo.FieldType))
127 {
128 list.Add((SourceData)fieldInfo.GetValue(this));
129 }
130 }
131 BaseModManager.PublishEvent("elin.source.importing");
132 elements.Init();
133 materials.Init();
134 charas.Init();
135 things.Init();
136 thingV.Init();
137 foods.Init();
138 cards.Init();
139 checks.Init();
140 races.Init();
141 persons.Init();
142 categories.Init();
143 spawnLists.Init();
144 religions.Init();
145 factions.Init();
146 jobs.Init();
147 hobbies.Init();
148 floors.Init();
149 decos.Init();
150 blocks.Init();
151 cellEffects.Init();
152 objs.Init();
153 stats.Init();
154 areas.Init();
155 zones.Init();
156 zoneAffixes.Init();
157 researches.Init();
158 homeResources.Init();
159 globalTiles.Init();
161 quests.Init();
162 charaText.Init();
163 calc.Init();
164 recipes.Init();
165 backers.Init();
166 tactics.Init();
167 keyItems.Init();
168 ACT.Init();
169 TimeTable.Init();
171 Element.ListAttackElements.AddRange(EMono.sources.elements.rows.Where((SourceElement.Row r) => r.categorySub == "eleAttack"));
172 BaseModManager.PublishEvent("elin.source.imported");
173 }
174
175 public void Reload()
176 {
177 initialized = false;
178 foreach (SourceData item in list)
179 {
180 item.Reset();
181 }
182 Init();
183 }
184
185 public void ExportSourceTexts(string path)
186 {
187 foreach (SourceData item in list)
188 {
189 item.ExportTexts(path);
190 }
191 }
192
193 public void UpdateSourceTexts(string path)
194 {
195 foreach (SourceData item in list)
196 {
197 item.ExportTexts(path, update: true);
198 }
199 }
200
201 public void ImportSourceTexts()
202 {
203 foreach (SourceData item in list)
204 {
205 if (item is SourceThingV)
206 {
207 things.ImportTexts(item.nameSheet);
208 }
209 else
210 {
211 item.ImportTexts();
212 }
213 }
214 }
215
216 public void ValidateLang()
217 {
218 Log.system = "";
219 foreach (SourceData item in list)
220 {
221 item.ValidateLang();
222 }
223 string text = Lang.setting.dir + "validation.txt";
224 IO.SaveText(text, Log.system);
225 Util.Run(text);
226 }
227}
Definition: ACT.cs:6
static void Init()
Definition: ACT.cs:25
static void PublishEvent(string eventId, object data=null)
Definition: EMono.cs:4
static SourceManager sources
Definition: EMono.cs:41
static List< SourceElement.Row > ListAttackElements
Definition: ELEMENT.cs:277
Definition: Log.cs:4
static string system
Definition: Log.cs:5
void Init()
Definition: SourceCard.cs:15
void OnAfterInit()
Definition: SourceFloor.cs:287
SourceFaction factions
SourceMaterial materials
SourceRace races
LangGeneral langGeneral
Definition: SourceManager.cs:8
SourceStat stats
SourceKeyItem keyItems
void ValidateLang()
SourceResearch researches
SourceCalc calc
SourceHomeResource homeResources
SourceCard cards
SourceThingV thingV
SourceObj objs
SourceThing things
List< SourceData > list
SourceZone zones
SourceCollectible collectibles
SourceHobby hobbies
SourceFood foods
SourceSpawnList spawnLists
void UpdateSourceTexts(string path)
SourceGlobalTile globalTiles
SourceDeco decos
SourceCheck checks
SourceCellEffect cellEffects
SourceBlock blocks
SourcePerson persons
void ImportSourceTexts()
LangGame langGame
SourceAsset asset
LangWord langWord
LangNote langNote
SourceRecipe recipes
SourceArea areas
SourceCharaText charaText
SourceZoneAffix zoneAffixes
SourceBacker backers
SourceCategory categories
SourceElement elements
SourceChara charas
LangList langList
void OnChangeLang()
void ExportSourceTexts(string path)
SourceQuest quests
SourceJob jobs
SourceReligion religions
SourceTactics tactics
SourceFloor floors
static void Init()
Definition: TimeTable.cs:19