Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
TraitStoryBook.cs
Go to the documentation of this file.
1using System.Collections.Generic;
2
4{
5 public virtual string IdBook => "_main";
6
7 public override void OnRead(Chara c)
8 {
9 if (this is TraitTutorialBook)
10 {
11 Tutorial.debugSkip = false;
12 }
13 ExcelData excelData = new ExcelData();
14 excelData.path = CorePath.DramaData + IdBook + ".xlsx";
15 if (!Lang.isBuiltin)
16 {
17 excelData.path = CorePath.DramaDataLocal + IdBook + ".xlsx";
18 }
19 excelData.BuildList("index");
20 ExcelData.Sheet sheet = excelData.sheets["index"];
21 List<Dictionary<string, string>> rows = sheet.list;
23 {
24 rows.ForeachReverse(delegate(Dictionary<string, string> a)
25 {
26 int num = a["id"].ToInt();
27 if (!EClass.player.flags.IsStoryPlayed(num) || num >= 950)
28 {
29 rows.Remove(a);
30 }
31 });
32 }
33 EClass.ui.AddLayer<LayerList>().SetSize().SetList2(rows, (Dictionary<string, string> a) => GetText(a, "text"), delegate(Dictionary<string, string> a, ItemGeneral b)
34 {
35 EClass.player.flags.PlayStory(IdBook, a["id"].ToInt(), fromBook: true);
36 }, delegate
37 {
38 }, autoClose: false);
39 static string GetText(Dictionary<string, string> dict, string id)
40 {
41 if (!Lang.isBuiltin)
42 {
43 return dict[id];
44 }
45 if (!dict.ContainsKey(id + "_" + Lang.langCode))
46 {
47 return dict[id + "_JP"];
48 }
49 return dict[id + "_" + Lang.langCode];
50 }
51 }
52}
Definition: Chara.cs:10
bool allStory
Definition: CoreDebug.cs:238
Definition: EClass.cs:5
static Player player
Definition: EClass.cs:12
static CoreDebug debug
Definition: EClass.cs:48
static UI ui
Definition: EClass.cs:16
List< Dictionary< string, string > > list
Definition: ExcelData.cs:16
List< Dictionary< string, string > > BuildList(string sheetName="_default")
Definition: ExcelData.cs:92
Dictionary< string, Sheet > sheets
Definition: ExcelData.cs:25
Definition: Lang.cs:6
static string langCode
Definition: Lang.cs:28
static bool isBuiltin
Definition: Lang.cs:42
bool IsStoryPlayed(int flag)
Definition: Player.cs:561
bool PlayStory(string idBook, int id, bool fromBook=false)
Definition: Player.cs:603
Flags flags
Definition: Player.cs:895
virtual string IdBook
override void OnRead(Chara c)