@@ -56,8 +56,8 @@ public class Plugin : BaseUnityPlugin
5656
5757 private ConfigEntry < bool > ? _disableAchievement { get ; set ; }
5858 public bool DisableAchievement => _disableAchievement ? . Value ?? true ;
59-
60- private ConfigEntry < bool > ? _decryptSaveFile { get ; set ; }
59+
60+ private ConfigEntry < bool > ? _decryptSaveFile { get ; set ; }
6161 public bool DecryptSaveFile => _decryptSaveFile ? . Value ?? false ;
6262
6363 internal static bool Started { get ; private set ; }
@@ -89,7 +89,7 @@ private void Awake()
8989 _disableAchievement = Config . Bind ( "Miscellaneous" , "Disable new achievement" , true ,
9090 "Should we disable saving new achievements? (You will still be able to get achievement but it won't save)" ) ;
9191 _decryptSaveFile = Config . Bind ( "Miscellaneous" , "Decrypt save file" , false ) ;
92-
92+
9393 _debug = Config . Bind ( "Debug" , "API debug" , false ,
9494 "API debug mode. Will add debug content to your game for testing. Not recommended for normal play." ) ;
9595 UnityDebug = Config . Bind ( "Debug" , "Unity debug logging" , false ,
@@ -165,7 +165,12 @@ private void Awake()
165165 AchievementsWrapper . LoadAchievementData ( ) ;
166166 AchievementsWrapper . compareAchievements ( ) ;
167167 } ) ;
168- CustomSettingsManager . AddBepInExConfig ( "API" , "Decrypt save file" , _decryptSaveFile ) ;
168+ CustomSettingsManager . AddBepInExConfig ( "API" , "Decrypt save file" , _decryptSaveFile , delegate ( bool isActivated )
169+ {
170+ if ( ! isActivated ) return ;
171+
172+ foreach ( var save in ModdedSaveManager . ModdedSaveDataList . Values ) save . Save ( ! _decryptSaveFile . Value ) ;
173+ } ) ;
169174
170175 CustomSettingsManager . AddBepInExConfig ( "API" , "Debug" , _debug , delegate ( bool isActivated )
171176 {
0 commit comments