@@ -27,7 +27,7 @@ public class Settings : UnityModManager.ModSettings
27
27
public int SCREEN_MODE = 0 ;
28
28
29
29
// AA
30
- public PostProcessLayer . Antialiasing AA_MODE = new PostProcessLayer . Antialiasing ( ) ;
30
+ public PostProcessLayer . Antialiasing AA_MODE = PostProcessLayer . Antialiasing . SubpixelMorphologicalAntialiasing ;
31
31
public float TAA_sharpness = new TemporalAntialiasing ( ) . sharpness ;
32
32
public float TAA_jitter = new TemporalAntialiasing ( ) . jitterSpread ;
33
33
public float TAA_stationary = new TemporalAntialiasing ( ) . stationaryBlending ;
@@ -67,30 +67,36 @@ public override void Save(UnityModManager.ModEntry modEntry) {
67
67
68
68
public Task Save ( ) {
69
69
return Task . Run ( ( ) => {
70
- var filepath = Main . modEntry . Path ;
70
+ var filepath = $ " { Main . modEntry . Path } Settings.xml" ;
71
71
try {
72
- using ( var writer = new StreamWriter ( $ " { filepath } Settings.xml" ) ) {
72
+ using ( var writer = new StreamWriter ( filepath ) ) {
73
73
XmlSerializer xmlSerializer = new XmlSerializer ( typeof ( Settings ) ) ;
74
74
xmlSerializer . Serialize ( writer , this ) ;
75
75
}
76
76
}
77
77
catch ( Exception e ) {
78
- Logger . Log ( $ "Can't save { filepath } Settings.xml . ex: { e } ") ;
78
+ Logger . Log ( $ "Can't save { filepath } . ex: { e } ") ;
79
79
}
80
80
} ) ;
81
81
}
82
82
83
83
public static Settings Load ( ) {
84
- var filepath = Main . modEntry . Path ;
84
+ var filepath = $ " { Main . modEntry . Path } Settings.xml" ;
85
85
Settings settings = null ;
86
- try {
87
- using ( var reader = new StreamReader ( $ "{ filepath } Settings.xml") ) {
88
- XmlSerializer xmlSerializer = new XmlSerializer ( typeof ( Settings ) ) ;
89
- settings = ( Settings ) xmlSerializer . Deserialize ( reader ) ;
86
+ if ( File . Exists ( filepath ) ) {
87
+ try {
88
+ using ( var reader = new StreamReader ( filepath ) ) {
89
+ XmlSerializer xmlSerializer = new XmlSerializer ( typeof ( Settings ) ) ;
90
+ settings = ( Settings ) xmlSerializer . Deserialize ( reader ) ;
91
+ }
92
+ }
93
+ catch ( Exception e ) {
94
+ Logger . Log ( $ "Can't read { filepath } . ex: { e } ") ;
90
95
}
91
96
}
92
- catch ( Exception e ) {
93
- Logger . Log ( $ "Can't read { filepath } Settings.xml. ex: { e } ") ;
97
+ else {
98
+ Logger . Log ( $ "No settings found, using defaults") ;
99
+ settings = new Settings ( ) ;
94
100
}
95
101
return settings ;
96
102
}
0 commit comments