Elin Modding Docs Doc
Loading...
Searching...
No Matches
LayerLoadGame.cs
1using System;
2using System.Collections.Generic;
3using UnityEngine;
4
5// Token: 0x0200059A RID: 1434
6public class LayerLoadGame : ELayer
7{
8 // Token: 0x0600275C RID: 10076 RVA: 0x000DEF07 File Offset: 0x000DD107
9 public override void OnAfterInit()
10 {
11 this.RefreshList();
12 }
13
14 // Token: 0x0600275D RID: 10077 RVA: 0x000DEF10 File Offset: 0x000DD110
15 public void RefreshList()
16 {
17 if (this.worlds == null)
18 {
19 this.worlds = GameIO.GetGameList();
20 }
21 this.goInfo.SetActive(false);
22 this.goNoInfo.SetActive(true);
23 this.list.Clear();
24 BaseList baseList = this.list;
25 UIList.Callback<GameIndex, UIButton> callback = new UIList.Callback<GameIndex, UIButton>();
26 callback.onInstantiate = delegate(GameIndex a, UIButton b)
27 {
28 FontColor c = ELayer.core.version.IsSaveCompatible(a.version) ? FontColor.Good : FontColor.Bad;
29 string s = a.Title + ((ELayer.core.IsGameStarted && a.id == Game.id) ? "currentSave".lang() : "") + Environment.NewLine;
30 b.mainText.SetText(s, c);
31 b.subText.SetText(a.RealDate ?? "");
32 b.subText2.SetText(string.Concat(new string[]
33 {
34 (a.difficulty == 2) ? "★" : ((a.difficulty == 1) ? "☆" : ""),
35 a.pcName,
36 " (",
37 a.zoneName,
38 ")"
39 }), c);
40 b.GetComponent<UIItem>().text1.SetText(a.version.GetText() ?? "");
41 };
42 callback.onClick = delegate(GameIndex a, UIButton b)
43 {
44 this.RefreshInfo(a);
45 };
46 baseList.callbacks = callback;
47 foreach (GameIndex o in this.worlds)
48 {
49 this.list.Add(o);
50 }
51 this.list.Refresh(false);
52 if (this.list.items.Count == 0)
53 {
54 this.buttonLoad.SetActive(false);
55 this.buttonDelete.SetActive(false);
56 this.goNoInfo.SetActive(true);
57 }
58 }
59
60 // Token: 0x0600275E RID: 10078 RVA: 0x000DF028 File Offset: 0x000DD228
61 public void RefreshInfo(GameIndex i)
62 {
63 this.goInfo.SetActive(true);
64 this.goNoInfo.SetActive(false);
65 this.note.Clear();
66 this.note.AddTopic("version".lang(), i.version.GetText());
67 this.note.AddTopic("date_real".lang(), i.RealDate);
68 this.note.AddTopic("date_game".lang(), i.GameData);
69 this.note.AddTopic("ID", i.id);
70 bool flag = ELayer.core.version.IsSaveCompatible(i.version);
71 if (!flag)
72 {
73 this.note.Space(0, 1);
74 this.note.AddText("incompatible".lang(), FontColor.Bad);
75 }
76 else
77 {
78 this.note.AddTopic("currentZone".lang(), i.zoneName);
79 }
80 this.textAka.SetText(i.aka);
81 this.textName.SetText(i.pcName);
82 this.textDays.SetText("infoHire".lang(i.days.ToString() ?? "", null, null, null, null));
83 this.textDeepest.SetText("deepestLv2".lang(i.deepest.ToString() ?? "", null, null, null, null));
84 UIText uitext = this.textRace;
85 SourceRace.Row row = ELayer.sources.races.map.TryGetValue(i.idRace, null);
86 uitext.SetText(((row != null) ? row.GetName().ToTitleCase(false) : null) ?? "");
87 UIText uitext2 = this.textJob;
88 SourceJob.Row row2 = ELayer.sources.jobs.map.TryGetValue(i.idJob, null);
89 uitext2.SetText(((row2 != null) ? row2.GetName().ToTitleCase(false) : null) ?? "");
90 if (!i.idPortrait.IsEmpty())
91 {
92 this.portrait.SetActive(true);
93 Color white = Color.white;
94 ColorUtility.TryParseHtmlString("#" + i.color, out white);
95 this.portrait.SetPortrait(i.idPortrait, white);
96 }
97 else
98 {
99 this.portrait.SetActive(false);
100 }
101 this.note.Build();
102 this.buttonLoad.onClick.RemoveAllListeners();
103 this.buttonDelete.onClick.RemoveAllListeners();
104 this.buttonLoad.SetOnClick(delegate
105 {
106 LayerTitle.KillActor();
107 Game.Load(i.id);
108 });
109 Action <>9__3;
110 this.buttonDelete.SetOnClick(delegate
111 {
112 string langDetail = "dialogDeleteGame";
113 Action actionYes;
114 if ((actionYes = <>9__3) == null)
115 {
116 actionYes = (<>9__3 = delegate()
117 {
118 GameIO.DeleteGame(i.id);
119 this.worlds = null;
120 this.RefreshList();
121 SE.Trash();
122 });
123 }
124 Dialog.YesNo(langDetail, actionYes, null, "yes", "no");
125 });
126 this.buttonBackup.SetOnClick(delegate
127 {
128 GameIO.MakeBackup(i.id, "_manual");
129 ELayer.ui.Say("backupDone", null);
130 SE.WriteJournal();
131 });
132 this.buttonLoad.SetActive(flag);
133 }
134
135 // Token: 0x040015CF RID: 5583
136 public UIList list;
137
138 // Token: 0x040015D0 RID: 5584
139 public GameObject goInfo;
140
141 // Token: 0x040015D1 RID: 5585
142 public GameObject goNoInfo;
143
144 // Token: 0x040015D2 RID: 5586
145 public UINote note;
146
147 // Token: 0x040015D3 RID: 5587
148 public UIButton buttonLoad;
149
150 // Token: 0x040015D4 RID: 5588
151 public UIButton buttonDelete;
152
153 // Token: 0x040015D5 RID: 5589
154 public UIButton buttonBackup;
155
156 // Token: 0x040015D6 RID: 5590
157 public List<GameIndex> worlds;
158
159 // Token: 0x040015D7 RID: 5591
160 public Portrait portrait;
161
162 // Token: 0x040015D8 RID: 5592
163 public UIText textAka;
164
165 // Token: 0x040015D9 RID: 5593
166 public UIText textName;
167
168 // Token: 0x040015DA RID: 5594
169 public UIText textInfo;
170
171 // Token: 0x040015DB RID: 5595
172 public UIText textRace;
173
174 // Token: 0x040015DC RID: 5596
175 public UIText textJob;
176
177 // Token: 0x040015DD RID: 5597
178 public UIText textDeepest;
179
180 // Token: 0x040015DE RID: 5598
181 public UIText textDays;
182}
Definition Game.cs:10