12 public override string GetTextHeader(Window window)
14 return "_configOf".lang(base.GetTextHeader(window),
null,
null,
null,
null);
18 public override void OnBeforeAddLayer()
20 this.windows[0].setting.tabs[5].disable = !
ELayer.core.config.other.showTestOptions;
24 public override void OnInit()
26 this.inputW.text = (
ELayer.config.graphic.w.ToString() ??
"");
27 this.inputH.text = (
ELayer.config.graphic.h.ToString() ??
"");
28 ELayer.config.graphic.fullScreen = Screen.fullScreen;
29 this.windows[0].AddBottomSpace(20);
30 this.buttonReset = this.windows[0].AddBottomButton(
"", delegate
32 Dialog.YesNo(
"dialogResetConfigTab".lang(this.windows[0].CurrentTab.idLang.lang(),
null,
null,
null,
null), delegate
35 if (this.windows[0].idTab == 0)
37 CoreConfig.ResetGeneral();
39 else if (this.windows[0].idTab == 1)
43 else if (this.windows[0].idTab == 2)
47 else if (this.windows[0].idTab == 3)
51 else if (this.windows[0].idTab == 4)
60 },
null,
"yes",
"no");
62 this.windows[0].AddBottomButton(
"resetConfig", delegate
64 Dialog.YesNo(
"dialogResetConfig", delegate
69 },
null,
"yes",
"no");
71 List<PostEffectProfile> list = (from p in Resources.LoadAll<
PostEffectProfile>(
"Scene/Profile/PostEffect/")
73 select p).ToList<PostEffectProfile>();
76 ELayer.config.graphic.idPostProfile = b.name;
78 this.sliderSharpen.value = (float)
ELayer.config.graphic.sharpen;
79 this.sliderSharpen2.value = (float)
ELayer.config.graphic.sharpen2;
80 this.sliderBlur.value = (float)
ELayer.config.graphic.blur;
81 this.toggleKuwahara.SetCheck(
ELayer.config.graphic.kuwahara);
82 ELayer.config.ApplyGrading();
88 public override void OnSwitchContent(Window window)
90 this.buttonReset.mainText.SetText(
"resetConfigTab".lang(this.windows[0].CurrentTab.idLang.lang(),
null,
null,
null,
null));
91 this.windows[0].rectBottom.RebuildLayout(
true);
92 this.windows[0].CurrentContent.RebuildLayout(
true);
98 if (!this.inputW.isFocused && !
this.inputH.isFocused)
100 this.ValidateResolution();
105 public void ValidateResolution()
107 int num = Mathf.Clamp(this.inputW.text.ToInt(), 800, Display.main.systemWidth);
108 int num2 = Mathf.Clamp(this.inputH.text.ToInt(), 600, Display.main.systemHeight);
109 this.inputW.text = (num.ToString() ??
"");
110 this.inputH.text = (num2.ToString() ??
"");
111 ELayer.core.config.graphic.w = this.inputW.text.ToInt();
112 ELayer.core.config.graphic.h = this.inputH.text.ToInt();
116 public override void OnKill()
118 ELayer.core.config.graphic.w = this.inputW.text.ToInt();
119 ELayer.core.config.graphic.h = this.inputH.text.ToInt();
120 ELayer.core.config.Save();
121 ELayer.core.config.Apply();
125 public void Refresh()
127 ELayer.config.ignoreApply =
true;
128 this.SetSlider(this.sliderMaster,
ELayer.config.sound.volumeMaster, delegate(
float a)
130 ELayer.config.sound.volumeMaster = a;
131 ELayer.config.ApplyVolume();
132 return Lang.Get(
"MASTER") +
"(" + ((int)(a * 100f)).ToString() +
"%)";
134 this.SetSlider(this.sliderBGM,
ELayer.config.sound.volumeBGM, delegate(
float a)
136 ELayer.config.sound.volumeBGM = a;
137 ELayer.config.ApplyVolume();
138 return Lang.Get(
"BGM") +
"(" + ((int)(a * 100f)).ToString() +
"%)";
140 this.SetSlider(this.sliderSFX,
ELayer.config.sound.volumeSFX, delegate(
float a)
142 ELayer.config.sound.volumeSFX = a;
143 ELayer.config.ApplyVolume();
144 return Lang.Get(
"SFX") +
"(" + ((int)(a * 100f)).ToString() +
"%)";
146 this.SetSlider(this.sliderAMB,
ELayer.config.sound.volumeAMB, delegate(
float a)
148 ELayer.config.sound.volumeAMB = a;
149 ELayer.config.ApplyVolume();
150 return Lang.Get(
"AMB") +
"(" + ((int)(a * 100f)).ToString() +
"%)";
152 this.SetSlider(this.sliderBrightness,
ELayer.config.graphic.brightness, delegate(
float a)
154 ELayer.config.graphic.brightness = a;
155 ELayer.config.ApplyGrading();
156 return Lang.Get(
"brightness") +
"(" + ((int)(a * 100f)).ToString() +
"%)";
158 this.SetSlider(this.sliderContrast,
ELayer.config.graphic.contrast, delegate(
float a)
160 ELayer.config.graphic.contrast = a;
161 ELayer.config.ApplyGrading();
162 return Lang.Get(
"contrast") +
"(" + ((int)(a * 100f)).ToString() +
"%)";
164 this.SetSlider(this.sliderSaturation,
ELayer.config.graphic.saturation, delegate(
float a)
166 ELayer.config.graphic.saturation = a;
167 ELayer.config.ApplyGrading();
168 return Lang.Get(
"saturation") +
"(" + ((int)(a * 100f)).ToString() +
"%)";
170 this.SetSlider(this.sliderVibrance,
ELayer.config.graphic.vibrance, delegate(
float a)
172 ELayer.config.graphic.vibrance = a;
173 ELayer.config.ApplyGrading();
174 return Lang.Get(
"vibrance") +
"(" + ((int)(a * 100f)).ToString() +
"%)";
176 this.SetSlider(this.sliderSharpen, (
float)
ELayer.config.graphic.sharpen, delegate(
float a)
178 ELayer.config.graphic.sharpen = (int)a;
179 ELayer.config.ApplyGrading();
180 return Lang.Get(
"sharpen") +
"(" + ((int)a).ToString() +
"%)";
182 this.SetSlider(this.sliderSharpen2, (
float)
ELayer.config.graphic.sharpen2, delegate(
float a)
184 ELayer.config.graphic.sharpen2 = (int)a;
185 ELayer.config.ApplyGrading();
186 return Lang.Get(
"sharpen2") +
"(" + ((int)a).ToString() +
"%)";
188 this.SetSlider(this.sliderBlur, (
float)
ELayer.config.graphic.blur, delegate(
float a)
190 ELayer.config.graphic.blur = (int)a;
191 ELayer.config.ApplyGrading();
192 return Lang.Get(
"blur") +
"(" + ((int)a).ToString() +
"%)";
194 this.SetSlider(this.sliderScrollSense,
ELayer.config.ui.scrollSens, delegate(
float a)
196 ELayer.config.ui.scrollSens = a;
197 UIScrollView.sensitivity =
ELayer.config.ui.ScrollSensitivity;
198 return Lang.Get(
"scrollSens") +
"(" + ((int)(a * 100f)).ToString() +
")";
200 this.SetSlider(this.sliderScale, (
float)
ELayer.config.ui.scale, delegate(
float a)
202 ELayer.config.ui.scale = (int)a;
203 ELayer.config.ApplyScale();
204 ELayer.core.OnChangeResolution();
205 return Lang.Get(
"uiScale") +
"(" + (a * 5f).ToString() +
"%)";
207 this.SetSlider(this.sliderUIBrightness, (
float)
ELayer.config.ui.brightness, delegate(
float a)
209 ELayer.config.ui.brightness = (int)a;
210 ELayer.config.ApplyGrading();
211 return Lang.Get(
"uiBrightness") +
"(" + a.ToString() +
"%)";
213 this.SetSlider(this.sliderUIContrast, (
float)
ELayer.config.ui.contrast, delegate(
float a)
215 ELayer.config.ui.contrast = (int)a;
216 ELayer.config.ApplyGrading();
217 return Lang.Get(
"uiContrast") +
"(" + a.ToString() +
"%)";
219 this.SetSlider(this.sliderBalloon, (
float)
ELayer.config.ui.outlineAlpha, delegate(
float a)
221 ELayer.config.ui.outlineAlpha = (int)a;
223 return Lang.Get(
"outlineAlpha") +
"(" + a.ToString() +
"%)";
225 this.SetGroup(this.groupVSync,
ELayer.config.graphic.fps, delegate(
int a)
227 ELayer.config.graphic.fps = a;
230 if (!this.moldLanguage)
232 this.moldLanguage = this.layoutLanguage.CreateMold(
null);
234 this.layoutLanguage.DestroyChildren(
false,
true);
236 List<LangSetting> list =
new List<LangSetting>();
237 foreach (LangSetting langSetting
in MOD.langs.Values)
239 Util.Instantiate<UIButton>(this.moldLanguage, this.layoutLanguage).mainText.text = langSetting.name +
"(" + langSetting.name_en +
")";
240 if (
ELayer.config.lang == langSetting.id)
244 list.Add(langSetting);
246 this.layoutLanguage.RebuildLayout(
false);
247 this.SetGroup(this.groupLang, value, delegate(
int a)
249 if (
ELayer.config.lang != list[a].id)
251 ELayer.config.lang = list[a].id;
254 IChangeLanguage[] componentsInChildren =
ELayer.ui.GetComponentsInChildren<IChangeLanguage>();
255 for (
int i = 0; i < componentsInChildren.Length; i++)
257 componentsInChildren[i].OnChangeLanguage();
260 Dialog.Ok(
"dialogChangeLang");
264 this.toggleGradientWater.SetToggle(
ELayer.config.graphic.gradientWater, delegate(
bool on)
266 ELayer.config.graphic.gradientWater = on;
267 ELayer.scene.ApplyZoneConfig();
269 this.toggleVsync.SetToggle(
ELayer.config.graphic.vsync, delegate(
bool on)
271 ELayer.config.graphic.vsync = on;
274 this.toggleAutoscale.SetToggle(
ELayer.config.ui.autoscale, delegate(
bool on)
276 ELayer.config.ui.autoscale = on;
277 ELayer.core.OnChangeResolution();
278 ELayer.config.ApplyScale();
280 this.toggleOpenLastTab.SetToggle(
ELayer.config.ui.openLastTab, delegate(
bool on)
282 ELayer.config.ui.openLastTab = on;
285 this.toggleBalloon.SetToggle(
ELayer.config.ui.balloonBG, delegate(
bool on)
287 ELayer.config.ui.balloonBG = on;
290 this.toggleRightClickClose.SetToggle(
ELayer.config.ui.rightClickClose, delegate(
bool on)
292 ELayer.config.ui.rightClickClose = on;
295 this.toggleFullscreen.SetToggle(
ELayer.config.graphic.fullScreen, delegate(
bool on)
297 ELayer.config.graphic.fullScreen = on;
300 this.togglePixelPerfectUI.SetToggle(
ELayer.config.graphic.pixelperfectUI, delegate(
bool on)
302 ELayer.config.graphic.pixelperfectUI = on;
305 this.toggleFixedResolution.SetToggle(
ELayer.config.graphic.fixedResolution, delegate(
bool on)
307 ELayer.config.graphic.fixedResolution = on;
310 this.toggleBloom.SetToggle(
ELayer.config.graphic.bloom, delegate(
bool on)
312 ELayer.config.graphic.bloom = on;
315 this.toggleHDR.SetToggle(
ELayer.config.graphic.hdr, delegate(
bool on)
317 ELayer.config.graphic.hdr = on;
320 this.toggleKuwahara.SetToggle(
ELayer.config.graphic.kuwahara, delegate(
bool on)
322 ELayer.config.graphic.kuwahara = on;
323 ELayer.config.ApplyGrading();
325 this.toggleDisableShake.SetToggle(
ELayer.config.graphic.disableShake, delegate(
bool on)
327 ELayer.config.graphic.disableShake = on;
329 this.toggleFirefly.SetToggle(
ELayer.config.graphic.firefly, delegate(
bool on)
331 ELayer.config.graphic.firefly = on;
332 ELayer.screen.RefreshSky();
334 this.toggleGodray.SetToggle(
ELayer.config.graphic.godray, delegate(
bool on)
336 ELayer.config.graphic.godray = on;
337 ELayer.screen.RefreshSky();
339 this.toggleBlizzard.SetToggle(
ELayer.config.graphic.blizzard, delegate(
bool on)
341 ELayer.config.graphic.blizzard = on;
342 ELayer.screen.RefreshSky();
344 this.toggleAllyLight.SetToggle(
ELayer.config.graphic.drawAllyLight, delegate(
bool on)
346 ELayer.config.graphic.drawAllyLight = on;
347 if (
ELayer.core.IsGameStarted)
349 ELayer._map.RefreshFOVAll();
352 this.toggleBlur.SetToggle(
ELayer.config.ui.blur, delegate(
bool on)
354 ELayer.config.ui.blur = on;
356 this.toggleDynamicBrightness.SetToggle(
ELayer.config.ui.dynamicBrightness, delegate(
bool on)
358 ELayer.config.ui.dynamicBrightness = on;
359 ELayer.config.RefreshUIBrightness();
361 this.toggleSecureWidth.SetToggle(
ELayer.config.ui.secureMinWidth, delegate(
bool on)
363 ELayer.config.ui.secureMinWidth = on;
365 this.toggleShowFloatButtons.SetToggle(
ELayer.config.ui.showFloatButtons, delegate(
bool on)
367 ELayer.config.ui.showFloatButtons = on;
369 this.buttonApplyScreenSize.SetOnClick(delegate
371 this.ValidateResolution();
372 ELayer.config.ApplyResolution(
true);
374 List<string> list3 =
new List<string>();
377 list3.Add(
"focusPause");
378 List<string> list2 =
new List<string>();
384 this.SetFont(
ELayer.config.font.fontUI,
this.fontUI,
"fontUI");
385 this.SetFont(
ELayer.config.font.fontChatbox,
this.fontChatbox,
"fontChatbox");
386 this.SetFont(
ELayer.config.font.fontBalloon,
this.fontBalloon,
"fontBalloon");
387 this.SetFont(
ELayer.config.font.fontDialog,
this.fontDialog,
"fontDialog");
388 this.SetFont(
ELayer.config.font.fontWidget,
this.fontWidget,
"widget");
389 this.SetFont(
ELayer.config.font.fontNews,
this.fontNews,
"fontNews");
390 ELayer.config.ignoreApply =
false;
394 public void SetFont(SkinManager.FontSaveData data, UIItem item,
string lang)
396 item.text1.SetLang(lang);
397 UIDropdown componentInChildren = item.GetComponentInChildren<UIDropdown>();
398 UIButtonLR uibuttonLR = item.button1 as UIButtonLR;
399 List<string> langs =
new List<string>
408 SkinManager skins =
ELayer.ui.skins;
409 uibuttonLR.SetOptions(data.size, langs, delegate(
int i)
414 componentInChildren.options.Clear();
415 for (
int j = 0; j < skins.FontList.Count; j++)
417 FontSource fontSource = skins.FontList[j];
418 componentInChildren.options.Add(
new Dropdown.OptionData
420 text = fontSource._name
424 componentInChildren.value = j;
427 componentInChildren.onValueChanged.RemoveAllListeners();
428 componentInChildren.onValueChanged.AddListener(delegate(
int i)
436 public void ApplyFont()
438 ELayer.config.ApplyFont();
439 this.RebuildLayout(
true);
443 public void SetSlider(Slider slider,
float value, Func<float, string> action,
bool notify =
false)
445 slider.onValueChanged.RemoveAllListeners();
446 slider.onValueChanged.AddListener(delegate(
float a)
448 slider.GetComponentInChildren<UIText>(
true).text = action(a);
452 slider.value = value;
456 slider.SetValueWithoutNotify(value);
458 slider.GetComponentInChildren<UIText>(
true).text = action(value);
462 public void SetGroup(UISelectableGroup group,
int value, UnityAction<int> action)
464 group.Init(value, action,
false);
468 public Slider sliderMaster;
471 public Slider sliderBGM;
474 public Slider sliderSFX;
477 public Slider sliderAMB;
480 public Slider sliderBrightness;
483 public Slider sliderContrast;
486 public Slider sliderSaturation;
489 public Slider sliderVibrance;
492 public Slider sliderScrollSense;
495 public Slider sliderScale;
498 public Slider sliderSharpen;
501 public Slider sliderSharpen2;
504 public Slider sliderBlur;
507 public UISelectableGroup groupVSync;
510 public UISelectableGroup groupLang;
513 public UIButton toggleVsync;
516 public UIButton toggleFixedResolution;
519 public UIButton toggleOpenLastTab;
522 public UIButton toggleRightClickClose;
525 public UIButton toggleFullscreen;
528 public UIButton togglePixelPerfectUI;
531 public UIButton toggleBloom;
534 public UIButton toggleHDR;
537 public UIButton toggleBlur;
540 public UIButton toggleAutoscale;
543 public UIButton toggleDynamicBrightness;
546 public UIButton toggleKuwahara;
549 public UIButton toggleBlizzard;
552 public UIButton toggleDisableShake;
555 public UIButton toggleFirefly;
558 public UIButton toggleSecureWidth;
561 public UIButton toggleGradientWater;
564 public UIButton toggleGodray;
567 public UIButton toggleShowFloatButtons;
570 public UIButton toggleAllyLight;
573 public UIButton toggleBalloon;
576 public UIItem fontUI;
579 public UIItem fontChatbox;
582 public UIItem fontBalloon;
585 public UIItem fontDialog;
588 public UIItem fontWidget;
591 public UIItem fontNews;
594 public UIDropdown ddPostEffect;
597 public UIButton buttonReset;
600 public Slider sliderUIBrightness;
603 public Slider sliderUIContrast;
606 public Slider sliderBalloon;
609 public LayoutGroup layoutLanguage;
612 public UIButton moldLanguage;
615 public UIButton buttonApplyScreenSize;
618 public InputField inputW;
621 public InputField inputH;