Elin Decompiled Documentation EA 23.331 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 InitLang();
113 }
114
115 public void Init()
116 {
117 Debug.Log("SourceManager Init");
118 if (initialized)
119 {
120 return;
121 }
122 initialized = true;
123 list.Clear();
124 FieldInfo[] fields = GetType().GetFields();
125 foreach (FieldInfo fieldInfo in fields)
126 {
127 if (typeof(SourceData).IsAssignableFrom(fieldInfo.FieldType))
128 {
129 list.Add((SourceData)fieldInfo.GetValue(this));
130 }
131 }
132 BaseModManager.PublishEvent("elin.source.importing");
133 elements.Init();
134 materials.Init();
135 charas.Init();
136 things.Init();
137 thingV.Init();
138 foods.Init();
139 cards.Init();
140 checks.Init();
141 races.Init();
142 persons.Init();
143 categories.Init();
144 spawnLists.Init();
145 religions.Init();
146 factions.Init();
147 jobs.Init();
148 hobbies.Init();
149 floors.Init();
150 decos.Init();
151 blocks.Init();
152 cellEffects.Init();
153 objs.Init();
154 stats.Init();
155 areas.Init();
156 zones.Init();
157 zoneAffixes.Init();
158 researches.Init();
159 homeResources.Init();
160 globalTiles.Init();
162 quests.Init();
163 charaText.Init();
164 calc.Init();
165 recipes.Init();
166 backers.Init();
167 tactics.Init();
168 keyItems.Init();
169 ACT.Init();
170 TimeTable.Init();
172 Element.ListAttackElements.AddRange(EMono.sources.elements.rows.Where((SourceElement.Row r) => r.categorySub == "eleAttack"));
173 BaseModManager.PublishEvent("elin.source.imported");
174 }
175
176 public void Reload()
177 {
178 initialized = false;
179 foreach (SourceData item in list)
180 {
181 item.Reset();
182 }
183 Init();
184 }
185
186 public void ExportSourceTexts(string path)
187 {
188 foreach (SourceData item in list)
189 {
190 item.ExportTexts(path);
191 }
192 }
193
194 public void UpdateSourceTexts(string path)
195 {
196 foreach (SourceData item in list)
197 {
198 item.ExportTexts(path, update: true);
199 }
200 }
201
202 public void ImportSourceTexts()
203 {
204 foreach (SourceData item in list)
205 {
206 if (item is SourceThingV)
207 {
208 things.ImportTexts(item.nameSheet);
209 }
210 else
211 {
212 item.ImportTexts();
213 }
214 }
215 }
216
217 public void ValidateLang()
218 {
219 Log.system = "";
220 foreach (SourceData item in list)
221 {
222 item.ValidateLang();
223 }
224 string text = Lang.setting.dir + "validation.txt";
225 IO.SaveText(text, Log.system);
226 Util.Run(text);
227 }
228}
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:279
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