Elin Decompiled Documentation EA 23.102 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
33 public Slider sliderMissClick;
34
35 public Slider sliderBGMInterval;
36
38
39 public override void OnInstantiate()
40 {
41 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)
42 {
43 base.config.fix.snapType = b;
44 });
45 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)
46 {
47 base.config.fix.divider = b;
48 EClass.core.screen.RefreshScreenSize();
49 });
50 SetSlider(sliderMissClick, base.config.other.antiMissClick, delegate(float a)
51 {
52 base.config.other.antiMissClick = (int)a;
53 EInput.antiMissClick = 0.1f * a;
54 return Lang.Get("antiMissClick") + "(" + 0.1f * a + "s)";
55 });
56 SetSlider(sliderBGMInterval, base.config.other.bgmInterval, delegate(float a)
57 {
58 base.config.other.bgmInterval = (int)a;
59 base.config.ApplyVolume();
60 return Lang.Get("bgmInterval") + "(" + a * 5f + "sec)";
61 });
62 toggleSyncMod.SetToggle(base.config.other.syncMods, delegate(bool on)
63 {
64 base.config.other.syncMods = on;
65 });
66 toggleDisableMods.SetToggle(base.config.other.disableMods, delegate(bool on)
67 {
68 base.config.other.disableMods = on;
69 });
70 toggleNoCensor.SetToggle(base.config.other.noCensor, delegate(bool on)
71 {
72 base.config.other.noCensor = on;
73 base.config.Apply();
74 });
75 toggleRunBackground.SetToggle(base.config.other.runBackground, delegate(bool on)
76 {
77 base.config.other.runBackground = on;
78 base.config.Apply();
79 });
80 toggleMuteBackground.SetToggle(base.config.other.muteBackground, delegate(bool on)
81 {
82 base.config.other.muteBackground = on;
83 base.config.Apply();
84 });
85 toggleAltInv.SetToggle(base.config.game.altInv, delegate(bool on)
86 {
87 base.config.game.altInv = on;
88 EClass.ui.layerFloat.RemoveLayers(removeImportant: true);
89 });
90 toggleAltAbility.SetToggle(base.config.game.altAbility, delegate(bool on)
91 {
92 base.config.game.altAbility = on;
93 EClass.ui.layerFloat.RemoveLayers(removeImportant: true);
94 });
95 toggleTest.SetToggle(base.config.other.showTestOptions, delegate(bool on)
96 {
97 base.config.other.showTestOptions = on;
98 EClass.ui.GetLayer<LayerConfig>().Close();
99 EClass.ui.AddLayer<LayerConfig>();
100 });
101 buttonWallPaper.SetActive(base.config.HasBackerRewardCode());
103 }
104
105 public void OpenLog()
106 {
107 Util.ShowExplorer(CorePath.RootSave);
108 }
109
110 public void OoenConfigFolder()
111 {
112 Util.ShowExplorer(CorePath.RootSave + "config.txt");
113 }
114
115 public void OpenPackage()
116 {
117 Util.ShowExplorer(CorePath.rootMod + "_Elona");
118 }
119
120 public void OpenUser()
121 {
122 Util.ShowExplorer(CorePath.user + "PCC");
123 }
124
125 public void ResetWindows()
126 {
127 Dialog.YesNo("dialogResetWindow", delegate
128 {
129 Window.dictData.Clear();
130 });
131 }
132
134 {
135 Dialog.InputName("dialogBackerCode", "", delegate(bool cancel, string text)
136 {
137 if (!cancel)
138 {
139 if (ElinEncoder.IsValid(text))
140 {
141 base.config.rewardCode = text;
142 SE.Change();
143 EClass.ui.GetLayer<LayerConfig>().Close();
144 EClass.ui.AddLayer<LayerConfig>();
145 }
146 else
147 {
148 Dialog.Ok("invalidRewardCode".lang(text));
149 }
150 }
151 });
152 }
153
155 {
157 {
158 string text = StandaloneFileBrowser.SaveFilePanel("Export Wallpaper", CorePath.RootData, "wallpaper", "zip");
159 Debug.Log(text);
160 if (!string.IsNullOrEmpty(text))
161 {
162 try
163 {
164 TextAsset textAsset = Resources.Load("Etc/wallpaper") as TextAsset;
165 Debug.Log(textAsset);
166 File.WriteAllBytes(text, textAsset.bytes);
167 EClass.ui.Say("umimyaaThankyou");
168 SE.Play("godbless");
169 }
170 catch (Exception ex)
171 {
172 EClass.ui.Say(ex.Message);
173 }
174 }
175 });
176 }
177
178 public void RefreshRewardCode()
179 {
180 buttonBackerCode.interactable = !base.config.HasBackerRewardCode() || EClass.debug.enable;
181 if (base.config.HasBackerRewardCode())
182 {
183 buttonBackerCode.mainText.SetText("rewardCodeActive".lang());
184 }
185 }
186}
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
Definition: UIBook.cs:627
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:285
static string rootMod
Definition: CorePath.cs:169
static string RootData
Definition: CorePath.cs:204
static string RootSave
Definition: CorePath.cs:206
static string user
Definition: CorePath.cs:160
Definition: Dialog.cs:7
static Dialog YesNo(string langDetail, Action actionYes, Action actionNo=null, string langYes="yes", string langNo="no")
Definition: Dialog.cs:244
static Dialog InputName(string langDetail, string text, Action< bool, string > onClose, InputType inputType=InputType.Default)
Definition: Dialog.cs:528
Definition: EClass.cs:5
static Core core
Definition: EClass.cs:6
static CoreDebug debug
Definition: EClass.cs:48
static UI ui
Definition: EClass.cs:16
static bool IsValid(string code)
Definition: ElinEncoder.cs:48
Definition: Lang.cs:6
static string Get(string id)
Definition: Lang.cs:91
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:159
Definition: Window.cs:13
static Dictionary< string, SaveData > dictData
Definition: Window.cs:594