Elin Modding Docs Doc
Loading...
Searching...
No Matches
LayerFeedback.cs
1using System;
2using System.Collections.Generic;
3using System.IO;
4using System.Runtime.CompilerServices;
5using AeLa.EasyFeedback;
6using AeLa.EasyFeedback.FormElements;
7using Ionic.Zip;
8using UnityEngine;
9using UnityEngine.UI;
10
11// Token: 0x02000546 RID: 1350
12public class LayerFeedback : ELayer
13{
14 // Token: 0x060024AF RID: 9391 RVA: 0x000CEDD8 File Offset: 0x000CCFD8
15 public override void OnInit()
16 {
17 this.transUpload.SetActive(false);
18 this.buttonSubmit.interactable = false;
19 if (!ELayer.config.nameReport.IsEmpty())
20 {
21 this.inputName.text = ELayer.config.nameReport;
22 }
23 else if (ELayer.core.IsGameStarted)
24 {
25 this.inputName.text = "nameBraced".lang(ELayer.pc.NameSimple, ELayer.pc.Aka, null, null, null);
26 }
27 if (!ELayer.config.emailReport.IsEmpty())
28 {
29 this.inputEmail.text = ELayer.config.emailReport;
30 }
31 this.inputVersion.text = ELayer.core.version.GetText() + "/" + ELayer.config.lang;
32 this.inputLang.text = ELayer.config.lang;
33 this.inputDetail.text = LayerFeedback.lastDetail;
34 this.inputSummary.text = LayerFeedback.lastSummary;
35 this.collector.onSubmit = delegate()
36 {
37 this.CollectFiles();
38 };
39 this.category.Init((string s) => ("form_" + s).lang());
40 List<GameIndex> gameList = GameIO.GetGameList();
41 if (gameList.Count > 0)
42 {
43 int index = 0;
44 this.saveIndex = gameList[0];
45 for (int i = 0; i < gameList.Count; i++)
46 {
47 if (ELayer.core.IsGameStarted && gameList[i].id == Game.id)
48 {
49 index = i;
50 this.saveIndex = gameList[i];
51 }
52 }
53 this.ddSave.SetList<GameIndex>(index, gameList, (GameIndex a, int b) => ((ELayer.core.IsGameStarted && a.id == Game.id) ? "currentSave".lang() : "") + a.FormTitle, delegate(int a, GameIndex b)
54 {
55 this.saveIndex = b;
56 }, true);
57 }
58 else
59 {
60 this.toggleSave.SetActive(false);
61 }
62 this.toggleSave.onValueChanged.AddListener(delegate(bool a)
63 {
64 this.ddSave.SetActive(a);
65 });
66 this.toggleSave.isOn = false;
67 this.ddSave.SetActive(this.toggleSave.isOn);
68 this.form.Init();
69 this.inputDetail.onValueChanged.AddListener(delegate(string a)
70 {
71 this.Validate();
72 });
73 this.inputSummary.onValueChanged.AddListener(delegate(string a)
74 {
75 this.Validate();
76 });
77 this.Validate();
78 }
79
80 // Token: 0x060024B0 RID: 9392 RVA: 0x000CF05C File Offset: 0x000CD25C
81 public void Validate()
82 {
83 bool interactable = true;
84 if (this.inputSummary.text.Length < 4)
85 {
86 interactable = false;
87 }
88 if (this.inputDetail.text.Length < 4)
89 {
90 interactable = false;
91 }
92 this.buttonSubmit.interactable = interactable;
93 }
94
95 // Token: 0x060024B1 RID: 9393 RVA: 0x000CF0A4 File Offset: 0x000CD2A4
96 public void CollectFiles()
97 {
98 string str = Application.persistentDataPath + "/";
99 string text = str + "_temp";
100 string text2 = text + "/log.zip";
101 IO.CreateDirectory(text);
102 IO.Copy(str + "Player.log", text);
103 IO.Copy(str + "Player-prev.log", text);
104 IO.SaveText(text + "/System.txt", this.GetSystemText());
105 using (ZipFile zipFile = new ZipFile())
106 {
107 zipFile.ExtractExistingFile = ExtractExistingFileAction.OverwriteSilently;
108 zipFile.AddDirectory(text);
109 zipFile.Save(text2);
110 }
111 this.form.CurrentReport.AttachFile("log.zip", File.ReadAllBytes(text2));
112 if (this.toggleSave.isOn)
113 {
114 string text3 = text + "/save.zip";
115 using (ZipFile zipFile2 = new ZipFile())
116 {
117 zipFile2.ExtractExistingFile = ExtractExistingFileAction.OverwriteSilently;
118 zipFile2.AddDirectory(GameIO.pathSaveRoot + this.saveIndex.id);
119 zipFile2.Save(text3);
120 }
121 this.form.CurrentReport.AttachFile(this.saveIndex.id + ".zip", File.ReadAllBytes(text3));
122 }
123 IO.DeleteDirectory(text);
124 }
125
126 // Token: 0x060024B2 RID: 9394 RVA: 0x000CF200 File Offset: 0x000CD400
127 public void OnCancel()
128 {
129 LayerFeedback.lastDetail = this.inputDetail.text;
130 LayerFeedback.lastSummary = this.inputSummary.text;
131 this.form.Clean();
132 this.Close();
133 }
134
135 // Token: 0x060024B3 RID: 9395 RVA: 0x000CF234 File Offset: 0x000CD434
136 public void OnSubmit()
137 {
138 if (!this.inputEmail.text.IsEmpty())
139 {
140 ELayer.config.emailReport = this.inputEmail.text;
141 }
142 if (!this.inputName.text.IsEmpty())
143 {
144 ELayer.config.nameReport = this.inputName.text;
145 }
146 this.transUpload.SetActive(true);
147 this.form.IncludeScreenshot = this.toggleScreenshot.isOn;
148 this.cgForm.alpha = 0.5f;
149 this.form.transform.SetParent(ELayer.ui.transform, false);
150 this.Close();
151 LayerFeedback.lastDetail = (LayerFeedback.lastSummary = "");
152 }
153
154 // Token: 0x060024B4 RID: 9396 RVA: 0x000CF2F4 File Offset: 0x000CD4F4
155 public string GetSystemText()
156 {
157 LayerFeedback.<>c__DisplayClass24_0 CS$<>8__locals1;
158 CS$<>8__locals1.txt = "";
159 LayerFeedback.<GetSystemText>g__Append|24_0("OS: " + SystemInfo.operatingSystem, ref CS$<>8__locals1);
160 LayerFeedback.<GetSystemText>g__Append|24_0("Processor: " + SystemInfo.processorType, ref CS$<>8__locals1);
161 LayerFeedback.<GetSystemText>g__Append|24_0("Memory: " + SystemInfo.systemMemorySize.ToString(), ref CS$<>8__locals1);
162 LayerFeedback.<GetSystemText>g__Append|24_0("Graphics API: " + SystemInfo.graphicsDeviceType.ToString(), ref CS$<>8__locals1);
163 LayerFeedback.<GetSystemText>g__Append|24_0("Graphics Processor: " + SystemInfo.graphicsDeviceName, ref CS$<>8__locals1);
164 LayerFeedback.<GetSystemText>g__Append|24_0("Graphics Memory: " + SystemInfo.graphicsMemorySize.ToString(), ref CS$<>8__locals1);
165 LayerFeedback.<GetSystemText>g__Append|24_0("Graphics Vendor: " + SystemInfo.graphicsDeviceVendor, ref CS$<>8__locals1);
166 LayerFeedback.<GetSystemText>g__Append|24_0("Quality Level: " + QualitySettings.names[QualitySettings.GetQualityLevel()], ref CS$<>8__locals1);
167 LayerFeedback.<GetSystemText>g__Append|24_0("Resolution: " + Screen.width.ToString() + "x" + Screen.height.ToString(), ref CS$<>8__locals1);
168 LayerFeedback.<GetSystemText>g__Append|24_0("Full Screen: " + Screen.fullScreen.ToString(), ref CS$<>8__locals1);
169 return CS$<>8__locals1.txt;
170 }
171
172 // Token: 0x060024BC RID: 9404 RVA: 0x000CF482 File Offset: 0x000CD682
173 [CompilerGenerated]
174 internal static void <GetSystemText>g__Append|24_0(string s, ref LayerFeedback.<>c__DisplayClass24_0 A_1)
175 {
176 A_1.txt = A_1.txt + s + Environment.NewLine;
177 }
178
179 // Token: 0x04001426 RID: 5158
180 public static string lastSummary = "";
181
182 // Token: 0x04001427 RID: 5159
183 public static string lastDetail = "";
184
185 // Token: 0x04001428 RID: 5160
186 public UIText textProgress;
187
188 // Token: 0x04001429 RID: 5161
189 public InputField inputVersion;
190
191 // Token: 0x0400142A RID: 5162
192 public InputField inputName;
193
194 // Token: 0x0400142B RID: 5163
195 public InputField inputEmail;
196
197 // Token: 0x0400142C RID: 5164
198 public InputField inputLang;
199
200 // Token: 0x0400142D RID: 5165
201 public InputField inputSummary;
202
203 // Token: 0x0400142E RID: 5166
204 public InputField inputDetail;
205
206 // Token: 0x0400142F RID: 5167
207 public FeedbackForm form;
208
209 // Token: 0x04001430 RID: 5168
210 public DebugLogCollector collector;
211
212 // Token: 0x04001431 RID: 5169
213 public Transform transUpload;
214
215 // Token: 0x04001432 RID: 5170
216 public UIDropdown ddSave;
217
218 // Token: 0x04001433 RID: 5171
219 public Toggle toggleSave;
220
221 // Token: 0x04001434 RID: 5172
222 public Toggle toggleScreenshot;
223
224 // Token: 0x04001435 RID: 5173
225 public GameIndex saveIndex;
226
227 // Token: 0x04001436 RID: 5174
228 public CanvasGroup cgForm;
229
230 // Token: 0x04001437 RID: 5175
231 public CategoryDropdown category;
232
233 // Token: 0x04001438 RID: 5176
234 public Button buttonSubmit;
235}
Definition Game.cs:10