Elin Decompiled Documentation EA 23.318 Nightly
Loading...
Searching...
No Matches
ContentConfigOther.cs
Go to the documentation of this file.
1using System;
2using System.IO;
3using SFB;
4using UnityEngine;
5using UnityEngine.UI;
6
8{
10
12
14
16
18
20
22
24
26
28
30
32
34
35 public Slider sliderMissClick;
36
37 public Slider sliderBGMInterval;
38
40
41 public override void OnInstantiate()
42 {
43 ddSnap.SetList((int)base.config.fix.snapType, Util.EnumToList<CoreConfig.ScreenSnapType>(), (CoreConfig.ScreenSnapType a, int b) => a.ToString().lang(), delegate(int a, CoreConfig.ScreenSnapType b)
44 {
45 base.config.fix.snapType = b;
46 });
47 ddDivider.SetList((int)base.config.fix.divider, Util.EnumToList<CameraSupport.Divider>(), (CameraSupport.Divider a, int b) => a.ToString().lang(), delegate(int a, CameraSupport.Divider b)
48 {
49 base.config.fix.divider = b;
50 EClass.core.screen.RefreshScreenSize();
51 });
52 SetSlider(sliderMissClick, base.config.other.antiMissClick, delegate(float a)
53 {
54 base.config.other.antiMissClick = (int)a;
55 EInput.antiMissClick = 0.1f * a;
56 return Lang.Get("antiMissClick") + "(" + 0.1f * a + "s)";
57 });
58 SetSlider(sliderBGMInterval, base.config.other.bgmInterval, delegate(float a)
59 {
60 base.config.other.bgmInterval = (int)a;
61 base.config.ApplyVolume();
62 return Lang.Get("bgmInterval") + "(" + a * 5f + "sec)";
63 });
64 toggleSyncMod.SetToggle(base.config.other.syncMods, delegate(bool on)
65 {
66 base.config.other.syncMods = on;
67 });
68 toggleDisableMods.SetToggle(base.config.other.disableMods, delegate(bool on)
69 {
70 base.config.other.disableMods = on;
71 });
72 toggleExceptionPopup.SetToggle(base.config.other.exceptionPopup, delegate(bool on)
73 {
74 base.config.other.exceptionPopup = on;
75 });
76 toggleNoCensor.SetToggle(base.config.other.noCensor, delegate(bool on)
77 {
78 base.config.other.noCensor = on;
79 base.config.Apply();
80 });
81 toggleRunBackground.SetToggle(base.config.other.runBackground, delegate(bool on)
82 {
83 base.config.other.runBackground = on;
84 base.config.Apply();
85 });
86 toggleMuteBackground.SetToggle(base.config.other.muteBackground, delegate(bool on)
87 {
88 base.config.other.muteBackground = on;
89 base.config.Apply();
90 });
91 toggleAltInv.SetToggle(base.config.game.altInv, delegate(bool on)
92 {
93 base.config.game.altInv = on;
94 EClass.ui.layerFloat.RemoveLayers(removeImportant: true);
95 });
96 toggleAltAbility.SetToggle(base.config.game.altAbility, delegate(bool on)
97 {
98 base.config.game.altAbility = on;
99 EClass.ui.layerFloat.RemoveLayers(removeImportant: true);
100 });
101 toggleTest.SetToggle(base.config.other.showTestOptions, delegate(bool on)
102 {
103 base.config.other.showTestOptions = on;
104 EClass.ui.GetLayer<LayerConfig>().Close();
105 EClass.ui.AddLayer<LayerConfig>();
106 });
107 buttonWallPaper.SetActive(base.config.HasBackerRewardCode());
109 }
110
111 public void OpenLog()
112 {
113 Util.ShowExplorer(CorePath.RootSave);
114 }
115
116 public void OoenConfigFolder()
117 {
118 Util.ShowExplorer(CorePath.RootSave + "config.txt");
119 }
120
121 public void OpenPackage()
122 {
123 Util.ShowExplorer(CorePath.rootMod + "_Elona");
124 }
125
126 public void OpenUser()
127 {
128 Util.ShowExplorer(CorePath.user + "PCC");
129 }
130
131 public void ResetWindows()
132 {
133 Dialog.YesNo("dialogResetWindow", delegate
134 {
135 Window.dictData.Clear();
136 });
137 }
138
140 {
141 Dialog.InputName("dialogBackerCode", "", delegate(bool cancel, string text)
142 {
143 if (!cancel)
144 {
145 if (ElinEncoder.IsValid(text))
146 {
147 base.config.rewardCode = text;
148 SE.Change();
149 EClass.ui.GetLayer<LayerConfig>().Close();
150 EClass.ui.AddLayer<LayerConfig>();
151 }
152 else
153 {
154 Dialog.Ok("invalidRewardCode".lang(text));
155 }
156 }
157 });
158 }
159
161 {
163 {
164 string text = StandaloneFileBrowser.SaveFilePanel("Export Wallpaper", CorePath.RootData, "wallpaper", "zip");
165 Debug.Log(text);
166 if (!string.IsNullOrEmpty(text))
167 {
168 try
169 {
170 TextAsset textAsset = Resources.Load("Etc/wallpaper") as TextAsset;
171 Debug.Log(textAsset);
172 File.WriteAllBytes(text, textAsset.bytes);
173 EClass.ui.Say("umimyaaThankyou");
174 SE.Play("godbless");
175 }
176 catch (Exception ex)
177 {
178 EClass.ui.Say(ex.Message);
179 }
180 }
181 });
182 }
183
184 public void RefreshRewardCode()
185 {
186 buttonBackerCode.interactable = !base.config.HasBackerRewardCode() || EClass.debug.enable;
187 if (base.config.HasBackerRewardCode())
188 {
189 buttonBackerCode.mainText.SetText("rewardCodeActive".lang());
190 }
191 }
192}
if(!match.Success)
void WaitForEndOfFrame(Action action)
Definition: BaseCore.cs:61
override void OnInstantiate()
void SetSlider(Slider slider, float value, Func< float, string > action)
Definition: ContentConfig.cs:8
bool enable
Definition: CoreDebug.cs:301
static string rootMod
Definition: CorePath.cs:165
static string RootData
Definition: CorePath.cs:200
static string RootSave
Definition: CorePath.cs:202
static string user
Definition: CorePath.cs:156
Definition: Dialog.cs:7
static Dialog YesNo(string langDetail, Action actionYes, Action actionNo=null, string langYes="yes", string langNo="no")
Definition: Dialog.cs:252
static Dialog InputName(string langDetail, string text, Action< bool, string > onClose, InputType inputType=InputType.Default)
Definition: Dialog.cs:536
Definition: EClass.cs:6
static Core core
Definition: EClass.cs:7
static CoreDebug debug
Definition: EClass.cs:49
static UI ui
Definition: EClass.cs:17
static bool IsValid(string code)
Definition: ElinEncoder.cs:48
Definition: Lang.cs:7
static string Get(string id)
Definition: Lang.cs:90
static string SaveFilePanel(string title, string directory, string defaultName, string extension)
UIText mainText
Definition: UIButton.cs:102
void SetToggle(bool isOn, Action< bool > onToggle=null)
Definition: UIButton.cs:341
Definition: UIText.cs:6
void SetText(string s)
Definition: UIText.cs:163
Definition: Window.cs:13
static Dictionary< string, SaveData > dictData
Definition: Window.cs:594