Beispiel #1
0
 public void Save(QaeConfig config)
 {
     try
     {
         byte[] cfgBytes = System.Text.Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(this));
         config.RootFileProvider.Write(config.ModsStatusFile, cfgBytes, true);
     }
     catch (Exception ex)
     {
         Log.LogErr($"Failed to write mod status file to {config.ModsStatusFile}!  Mod statuses will be lost!", ex);
         throw;
     }
 }
Beispiel #2
0
 /// <summary>
 /// Create a new instance of the class and open the apk file
 /// </summary>
 public QuestomAssetsEngine(QaeConfig config)
 {
     _config          = config;
     _assetsLoadOrder = GetAssetsLoadOrderFile();
     if (_assetsLoadOrder == null)
     {
         _assetsLoadOrder = new List <string>()
         {
             "globalgamemanagers",
             "globalgamemanagers.assets",
             "sharedassets1.assets",
             "231368cb9c1d5dd43988f2a85226e7d7",
             "sharedassets11.assets",
             "sharedassets18.assets",
             "sharedassets20.assets"
         };
     }
     _manager = new AssetsManager(_config.FileProvider, _config.AssetsPath, BSConst.GetAssetTypeMap());
 }
Beispiel #3
0
 public static ModConfig Load(QaeConfig config)
 {
     try
     {
         if (config.ModsStatusFile != null && config.RootFileProvider.FileExists(config.ModsStatusFile))
         {
             string modCfgTxt = System.Text.Encoding.UTF8.GetString(config.RootFileProvider.Read(config.ModsStatusFile));
             return(JsonConvert.DeserializeObject <ModConfig>(modCfgTxt));
         }
         else
         {
             return(new ModConfig());
         }
     }
     catch (Exception ex)
     {
         Log.LogErr($"Unable to read/parse mod status file from {config.ModsStatusFile}!  Mod statuses will be lost!", ex);
         return(new ModConfig());
     }
 }