16 public static string path
20 return CorePath.ConfigFile;
26 public static int ZoomStep
45 return EClass.scene.camSupport;
50 public static bool Exist()
62 if (!File.Exists(CorePath.VersionFile))
67 if (!
CoreConfig.IsCompatible(coreConfig.version))
69 Debug.Log(
"Config version is different. deleting:" + coreConfig.version.ToString() +
"/" +
EClass.core.version.GetText());
72 if (coreConfig.version.IsBelow(0, 22, 17))
74 coreConfig.game.tutorial =
true;
76 if (coreConfig.version.IsBelow(0, 22, 24))
78 coreConfig.ui.balloonBG =
true;
80 if (coreConfig.input.keys.examine.key == KeyCode.None)
82 coreConfig.input.keys.examine.key = KeyCode.X;
84 if (coreConfig.input.keys.getAll.key == KeyCode.None)
86 coreConfig.input.keys.getAll.key = KeyCode.G;
92 public static bool IsCompatible(global::Version v)
98 public static void Init()
100 if (
EClass.core.config ==
null)
102 Debug.Log(
"Creating new config.");
104 coreConfig.SetLang(
EClass.core.langCode);
105 if (!
EClass.debug.useNewConfig)
109 coreConfig.GetPostEffectProfile(
false).OnChangeProfile();
112 coreConfig.other.showTestOptions =
true;
113 coreConfig.test.showNumbers =
true;
114 coreConfig.game.waiter = 0;
115 coreConfig.game.advancedMenu =
true;
118 EClass.core.config.OnInit();
124 EClass.core.ui.skins.SetMainSkin(this.test.idSkin);
128 this.net.enable =
false;
133 public bool HasBackerRewardCode()
135 return ElinEncoder.IsValid(this.rewardCode);
139 public static void Reset()
141 string text =
EClass.core.config.lang;
142 string text2 =
EClass.core.config.rewardCode;
144 EClass.core.config.SetLang(text);
145 EClass.core.config.OnReset();
146 EClass.core.config.rewardCode = text2;
150 public static void ResetGeneral()
153 EClass.core.config.ui = coreConfig.ui;
154 EClass.core.config.font = coreConfig.font;
155 EClass.core.config.sound = coreConfig.sound;
156 EClass.core.config.Apply();
157 EClass.core.config.ApplyFont();
161 public static void ResetGraphics()
164 EClass.core.config.graphic = coreConfig.graphic;
165 EClass.core.config.GetPostEffectProfile(
false).OnChangeProfile();
166 EClass.core.config.Apply();
170 public static void ResetGame()
173 EClass.core.config.game = coreConfig.game;
174 EClass.core.config.net = coreConfig.net;
175 EClass.core.config.backer = coreConfig.backer;
176 EClass.core.config.Apply();
180 public static void ResetInput()
183 EClass.core.config.input = coreConfig.input;
184 EClass.core.config.camera = coreConfig.camera;
185 EClass.core.config.Apply();
189 public static void ResetOther()
192 EClass.core.config.fix = coreConfig.fix;
193 EClass.core.config.other = coreConfig.other;
194 EClass.core.config.Apply();
198 public static void ResetTest()
201 EClass.core.config.test = coreConfig.test;
202 EClass.core.config.Apply();
206 public void OnReset()
208 EClass.core.config.GetPostEffectProfile(
false).OnChangeProfile();
215 public void SetLang(
string id)
223 this.version =
EClass.core.version;
224 IO.SaveFile(
CoreConfig.path,
this,
false, IO.jsWriteConfig);
225 IO.SaveFile(CorePath.VersionFile,
this.version,
false,
null);
226 Debug.Log(
"Config saved to " +
CoreConfig.path);
230 public void OnChangeResolution()
236 public void ApplyFPS(
bool force =
false)
238 if (!
EClass.core.IsGameStarted && !force)
240 QualitySettings.vSyncCount = 0;
241 Application.targetFrameRate = 60;
244 if (this.graphic.vsync)
246 QualitySettings.vSyncCount = 1;
247 Application.targetFrameRate = 60;
250 QualitySettings.vSyncCount = 0;
251 Application.targetFrameRate = this._framerates[this.graphic.fps];
257 if (this.ignoreApply)
261 EInput.SetKeyMap(this.input.keys);
262 this.ApplyFPS(
false);
263 Application.runInBackground = (Application.isEditor || this.other.runBackground);
267 this.ApplyResolution(
false);
268 Window.openLastTab = this.ui.openLastTab;
269 Layer.closeOnRightClick = this.ui.rightClickClose;
270 RenderObject.animeSetting =
EClass.core.gameSetting.render.anime;
271 RenderObject.renderSetting = (RenderData.renderSetting =
EClass.core.gameSetting.render);
272 TC._setting =
EClass.core.gameSetting.render.tc;
273 UIScrollView.sensitivity = this.ui.ScrollSensitivity * 5f;
274 EClass.core.canvas.pixelPerfect = this.graphic.pixelperfectUI;
275 EClass.screen.RefreshScreenSize();
276 CharaRenderer._animeFrame =
EClass.setting.render.anime.animeStep[this.test.animeFrame];
277 CharaRenderer._animeFramePCC =
EClass.setting.render.anime.animeStep[this.test.animeFramePCC];
278 CharaRenderer.smoothmove = this.camera.smoothMove;
279 CharaRenderer._animeFramePC = (this.camera.smoothMove ? 6000 : this.camera.moveframe);
280 Scene.skipAnime =
true;
281 QualitySettings.maxQueuedFrames = 0;
282 PopManager.outlineAlpha = this.ui.outlineAlpha;
283 Window.animateWindow = this.ui.animeWindow;
284 EInput.rightScroll = this.game.rightScroll;
285 EInput.buttonScroll = (this.game.rightScroll ? EInput.rightMouse : EInput.middleMouse);
286 EInput.antiMissClick = 0.1f * (float)this.other.antiMissClick;
287 this.camSupport.bloom.enabled = this.graphic.bloom;
288 this.camSupport.beautify.bloom = this.test.bloom2;
289 this.camSupport.cam.allowHDR = this.graphic.hdr;
294 public void ApplyResolution(
bool force =
false)
296 if (this.graphic.fixedResolution)
302 Screen.SetResolution(this.graphic.w,
this.graphic.h,
this.graphic.fullScreen);
304 Screen.fullScreen = this.graphic.fullScreen;
308 public void ApplyScale()
310 float num = (float)this.ui.scale * 0.05f;
311 if (this.ui.autoscale)
314 float b = num + 0.05f;
315 num = 0.01f * (float)Mathf.RoundToInt(Mathf.Lerp(a, b, (
float)Screen.height / 1080f) * 100f);
317 if (this.ui.secureMinWidth && Screen.width <
EClass.core.ui.minWidth)
319 float num2 = (float)Screen.width / (
float)
EClass.core.ui.minWidth;
325 Debug.Log(
"#UI ApplyScale:" + num.ToString());
326 EClass.core.canvas.GetComponent<CanvasScaler>().scaleFactor = num;
330 public void ApplyHUD()
335 public void ApplyZoom(
float a)
337 this.camSupport.Zoom = a;
338 EClass.screen.RefreshScreenSize();
339 this.camSupport.OnChangeResolution();
345 string text = this.graphic.idPostProfile.IsEmpty(
"None");
346 if (replaceWorld &&
EClass.core.IsGameStarted &&
EClass.core.game.activeZone.IsRegion && text !=
"None")
350 return ResourceCache.Load<
PostEffectProfile>(
"Scene/Profile/PostEffect/" + text);
354 public void ApplyGrading()
357 ScreenGrading grading = this.camSupport.grading;
358 grading.userSaturation = this.graphic.saturation + postEffectProfile.Saturation;
359 grading.userBrightness = this.graphic.brightness + postEffectProfile.Brightness;
360 grading.userContrast = this.graphic.contrast + postEffectProfile.Contrast;
361 this.camSupport.beautify.saturate = this.graphic.vibrance + grading.profile.Vibrance;
362 this.camSupport.kuwahara.enabled = this.graphic.kuwahara;
363 this.camSupport.blur.enabled = (this.graphic.blur > 0);
364 this.camSupport.blur.Amount = 0.01f * (float)this.graphic.blur;
365 if (
EClass.core.IsGameStarted)
367 EClass.screen.RefreshGrading();
369 this.camSupport.OnChangeResolution();
370 this.RefreshUIBrightness();
371 postEffectProfile.Apply(
EClass.scene.cam);
375 public void RefreshUIBrightness()
377 ScreenGrading grading = this.camSupport.grading;
380 if (
EClass.core.IsGameStarted)
382 if (this.ui.dynamicBrightness && (
EClass.world.date.IsNight ||
EClass._map.config.indoor))
384 num -= 0.05f * this.ui.dynamicBrightnessMod;
391 Shader.SetGlobalFloat(
"_UIBrightness", 0.01f * (
float)this.ui.brightness + grading.profile.uiBrightness + num);
392 Shader.SetGlobalFloat(
"_UIContrast", 0.01f * (
float)this.ui.contrast + grading.profile.uiContrast +
EClass.core.ui.lightContrast + num2);
396 public void ApplyVolume()
398 this.SetVolume(
"VolumeMaster", this.sound.volumeMaster);
399 this.SetVolume(
"VolumeBGM",
EClass.Sound.muteBGM ? 0f :
this.sound.volumeBGM);
400 this.SetVolume(
"VolumeSpatialBGM", this.sound.volumeBGM);
401 this.SetVolume(
"VolumeSFX", this.sound.volumeSFX);
402 this.SetVolume(
"VolumeAmbience", this.sound.volumeAMB);
403 this.SetBGMInterval();
407 public void SetBGMInterval()
409 if (
EClass.core.IsGameStarted)
411 EClass._map.plDay.interval = this.other.bgmInterval * 5f;
416 public void SetVolume(
string id,
float v)
418 SoundManager.current.mixer.SetFloat(
id, Mathf.Log((v < 0.01f) ? 0.01f : v) * 20f);
422 public void OnSetLang()
424 SkinManager.Instance.InitFont();
429 public void ApplyFont()
431 EClass.core.ui.skins.SetFonts(this.font.fontUI,
this.font.fontChatbox,
this.font.fontBalloon,
this.font.fontDialog,
this.font.fontWidget,
this.font.fontNews);
435 public void ApplySkin()
437 Core.Instance.ui.skins.SetMainSkin(this.test.idSkin);
442 public global::Version version;
445 public string lang =
"JP";
448 public string nameReport;
451 public string emailReport;
454 public string rewardCode;
457 public bool compressSave;
496 public List<FontSource> customFonts;
499 public HashSet<string> helpFlags =
new HashSet<string>();
502 public int[] colors =
new int[10];
506 public bool ignoreApply;
509 private int[] _framerates =
new int[]
553 public enum GameFuncBuild
578 public enum ScreenSnapType
617 public bool edgeScroll;
620 public bool zoomToMouse;
623 public bool extendZoomMin;
626 public bool extendZoomMax;
629 public bool linearZoom;
632 public bool smoothFollow;
635 public bool smoothMove;
638 public float senseKeyboard;
641 public float sensEdge;
644 public float sensDrag;
647 public float momentum;
650 public float zoomSpeed;
653 public int defaultZoom;
656 public int moveframe;
659 public float[] zooms;
667 public bool autopause;
670 public bool showQuickMenuHint;
673 public bool dontRenderOutsideMap;
679 public bool showOffhand;
682 public bool confirmGive;
685 public bool confirmMapExit;
688 public bool holdMiddleButtonToHold;
691 public bool doubleClickToHold;
694 public bool useAbilityOnHotkey;
697 public float runDistance;
700 public float angleMargin;
703 public int newlineCount;
706 public int showBorder;
721 public bool altAbility;
724 public bool altCraft;
727 public bool autoSave;
730 public bool alwaysUpdateRecipe;
733 public bool showInvBG;
739 public bool rightScroll;
742 public bool tutorial;
745 public bool advancedMenu;
748 public bool warnCrime;
751 public bool warnMana;
754 public bool warnDisassemble;
757 public bool hideWeapons;
760 public bool backupOnSave;
763 public bool backupOnFirstSave;
766 public bool disableAutoStairs;
769 public bool smoothPick;
772 public bool markStack;
775 public bool waitOnRange;
778 public bool waitOnDebuff;
781 public bool waitOnMelee;
784 public bool highlightEnemy;
787 public bool showShippingResult;
790 public bool shiftToUseNegativeAbilityOnSelf;
795 public bool ignoreWarnCrime;
800 public bool ignoreWarnMana;
805 public bool ignoreWarnDisassemble;
816 public bool autowalk;
819 public bool altKeyAxis;
822 public bool keepRunning;
825 public bool rightClickExitBuildMode;
828 public bool ignoreNPCs;
831 public bool altExamine;
834 public CoreConfig.GameFunc middleClick;
837 public CoreConfig.GameFunc middlePressLong;
840 public CoreConfig.GameFunc mouse3Click;
843 public CoreConfig.GameFunc mouse3PressLong;
846 public CoreConfig.GameFunc mouse4Click;
849 public CoreConfig.GameFunc mouse4PressLong;
852 public CoreConfig.GameFuncBuild b_middleClick;
855 public CoreConfig.GameFuncBuild b_middlePressLong;
858 public CoreConfig.GameFuncBuild b_mouse3Click;
861 public CoreConfig.GameFuncBuild b_mouse3PressLong;
864 public CoreConfig.GameFuncBuild b_mouse4Click;
867 public CoreConfig.GameFuncBuild b_mouse4PressLong;
870 public EInput.KeyMapManager keys;
878 public float volumeMaster;
881 public float volumeBGM;
884 public float volumeSFX;
887 public float volumeAMB;
895 public string idPostProfile;
898 public bool fullScreen;
901 public bool pixelperfectUI;
904 public bool alwaysClearCamera;
910 public bool kuwahara;
913 public bool drawAllyLight;
919 public bool fixedResolution;
931 public bool gradientWater;
937 public bool enhanceRain;
940 public bool blizzard;
943 public bool disableShake;
949 public int fireflyCount = 150;
952 public int starCount = 200;
964 public int spriteFrameMode;
973 public float brightness;
976 public float contrast;
979 public float saturation;
982 public float vibrance;
985 public float gradientWaterLevel = 0.2f;
994 public float ScrollSensitivity
998 return this.baseScrollSens * this.scrollSens * this.scrollSens;
1003 public string defaultTheme;
1006 public bool openLastTab;
1009 public bool rightClickClose;
1015 public bool cornerHoard;
1018 public bool animeWindow;
1021 public bool autoscale;
1024 public bool dynamicBrightness;
1027 public bool secureMinWidth;
1030 public bool autoFocusWindow;
1033 public bool showFloatButtons;
1036 public bool balloonBG;
1039 public float scrollSens;
1042 public float baseScrollSens;
1045 public float blurSize;
1048 public float dynamicBrightnessMod;
1051 public int mouseDragMargin;
1057 public int brightness;
1060 public int contrast;
1063 public int outlineAlpha;
1071 public SkinManager.FontSaveData fontUI;
1074 public SkinManager.FontSaveData fontChatbox;
1077 public SkinManager.FontSaveData fontBalloon;
1080 public SkinManager.FontSaveData fontDialog;
1083 public SkinManager.FontSaveData fontWidget;
1086 public SkinManager.FontSaveData fontNews;
1108 public bool sendEvent;
1111 public bool receiveRealtime;
1114 public bool password;
1123 public bool FilterAll
1127 return this.filter == 2;
1133 public bool FilterLang
1137 return this.filter == 1;
1143 public bool FilterNone
1147 return this.filter == 0;
1152 public bool Show(
int id)
1154 return this.Show(
EClass.sources.backers.map.TryGetValue(
id,
null));
1164 if (this.FilterNone)
1172 bool flag = row.lang ==
"JP" || row.lang ==
"CN";
1173 string langCode = Lang.langCode;
1174 if (langCode ==
"JP" || langCode ==
"CN")
1182 public bool Show(
string s)
1184 if (this.FilterNone)
1192 bool flag = this.IsJapanese(s);
1193 string langCode = Lang.langCode;
1194 if (langCode ==
"JP" || langCode ==
"CN")
1202 private bool IsJapanese(
string text)
1204 return Regex.IsMatch(text,
"[\\p{IsHiragana}\\p{IsKatakana}\\p{IsCJKUnifiedIdeographs}]+");
1216 public int antiMissClick = 2;
1219 public float bgmInterval = 1f;
1222 public bool noCensor;
1225 public bool runBackground;
1228 public bool showTestOptions;
1231 public bool syncMods;
1234 public string idMainWidgetTheme;
1237 public string idSubWidgetTheme;
1248 public int animeFramePCC;
1251 public int animeFrame;
1254 public bool showNumbers;
1257 public bool aaPortrait;
1260 public bool extraTurnaround;
1266 public bool extraRace;
1269 public bool unsealWidgets;
1272 public bool extraMoveCancel;
1275 public bool showNetError;
1278 public bool alwaysRun;
1281 public bool allowBlockOnItem;
1284 public bool alwaysFixCamera;
1287 public bool ignoreBackerDestoryFlag;
1290 public bool showRefIcon;
1293 public bool showTrait;
1296 public float brightnessNight;
1304 public CameraSupport.Divider divider;
1307 public CoreConfig.ScreenSnapType snapType;