public static void LoadAllBios()
 {
     foreach (PawnBio current in DirectXmlLoader.LoadXmlDataInResourcesFolder <PawnBio>("Backstories/Solid"))
     {
         current.name.ResolveMissingPieces(null);
         if (current.childhood == null || current.adulthood == null)
         {
             PawnNameDatabaseSolid.AddPlayerContentName(current.name, current.gender);
         }
         else
         {
             current.PostLoad();
             current.ResolveReferences();
             foreach (string current2 in current.ConfigErrors())
             {
                 Log.Error(current2, false);
             }
             SolidBioDatabase.allBios.Add(current);
             current.childhood.shuffleable = false;
             current.childhood.slot        = BackstorySlot.Childhood;
             current.adulthood.shuffleable = false;
             current.adulthood.slot        = BackstorySlot.Adulthood;
             BackstoryHardcodedData.InjectHardcodedData(current);
             BackstoryDatabase.AddBackstory(current.childhood);
             BackstoryDatabase.AddBackstory(current.adulthood);
         }
     }
 }
 public static void LoadAllBios()
 {
     foreach (PawnBio item in DirectXmlLoader.LoadXmlDataInResourcesFolder <PawnBio>("Backstories/Solid"))
     {
         item.name.ResolveMissingPieces(null);
         if (item.childhood == null || item.adulthood == null)
         {
             PawnNameDatabaseSolid.AddPlayerContentName(item.name, item.gender);
         }
         else
         {
             item.PostLoad();
             item.ResolveReferences();
             foreach (string item2 in item.ConfigErrors())
             {
                 Log.Error(item2);
             }
             SolidBioDatabase.allBios.Add(item);
             item.childhood.shuffleable = false;
             item.childhood.slot        = BackstorySlot.Childhood;
             item.adulthood.shuffleable = false;
             item.adulthood.slot        = BackstorySlot.Adulthood;
             BackstoryHardcodedData.InjectHardcodedData(item);
             BackstoryDatabase.AddBackstory(item.childhood);
             BackstoryDatabase.AddBackstory(item.adulthood);
         }
     }
 }
Beispiel #3
0
 public static void LoadAllBios()
 {
     foreach (PawnBio pawnBio in DirectXmlLoader.LoadXmlDataInResourcesFolder <PawnBio>("Backstories/Solid"))
     {
         pawnBio.name.ResolveMissingPieces(null);
         if (pawnBio.childhood == null || pawnBio.adulthood == null)
         {
             PawnNameDatabaseSolid.AddPlayerContentName(pawnBio.name, pawnBio.gender);
         }
         else
         {
             pawnBio.PostLoad();
             pawnBio.ResolveReferences();
             foreach (string text in pawnBio.ConfigErrors())
             {
                 Log.Error(text, false);
             }
             SolidBioDatabase.allBios.Add(pawnBio);
             pawnBio.childhood.shuffleable = false;
             pawnBio.childhood.slot        = BackstorySlot.Childhood;
             pawnBio.adulthood.shuffleable = false;
             pawnBio.adulthood.slot        = BackstorySlot.Adulthood;
             BackstoryHardcodedData.InjectHardcodedData(pawnBio);
             BackstoryDatabase.AddBackstory(pawnBio.childhood);
             BackstoryDatabase.AddBackstory(pawnBio.adulthood);
         }
     }
 }
Beispiel #4
0
 public static bool Prefix()
 {
     if (REB_Initializer.REB_Backstories.Count < 1)
     {
         return(true);
     }
     foreach (PawnBio pawnBio in DirectXmlLoader.LoadXmlDataInResourcesFolder <PawnBio>("Backstories/Solid"))
     {
         pawnBio.name.ResolveMissingPieces(null);
         PawnNameDatabaseSolid.AddPlayerContentName(pawnBio.name, pawnBio.gender);
     }
     return(false);
 }
Beispiel #5
0
 public static void ReloadAllBackstories()
 {
     foreach (Backstory current in DirectXmlLoader.LoadXmlDataInResourcesFolder <Backstory>("Backstories/Shuffled"))
     {
         current.PostLoad();
         current.ResolveReferences();
         foreach (string current2 in current.ConfigErrors(false))
         {
             Log.Error(current.Title + ": " + current2);
         }
         BackstoryDatabase.AddBackstory(current);
     }
     SolidBioDatabase.LoadAllBios();
 }
Beispiel #6
0
 public static void ReloadAllBackstories()
 {
     foreach (Backstory item in DirectXmlLoader.LoadXmlDataInResourcesFolder <Backstory>("Backstories/Shuffled"))
     {
         item.PostLoad();
         item.ResolveReferences();
         foreach (string item2 in item.ConfigErrors(false))
         {
             Log.Error(item.Title + ": " + item2);
         }
         BackstoryDatabase.AddBackstory(item);
     }
     SolidBioDatabase.LoadAllBios();
 }
 public static void ReloadAllBackstories()
 {
     foreach (Backstory backstory in DirectXmlLoader.LoadXmlDataInResourcesFolder <Backstory>("Backstories/Shuffled"))
     {
         backstory.PostLoad();
         backstory.ResolveReferences();
         foreach (string str in backstory.ConfigErrors(false))
         {
             Log.Error(backstory.title + ": " + str, false);
         }
         BackstoryDatabase.AddBackstory(backstory);
     }
     SolidBioDatabase.LoadAllBios();
 }
Beispiel #8
0
 public static bool Prefix()
 {
     PawnBioAndBacktoryUtility.duplicateCount      = new Dictionary <string, int>();
     PawnBioAndBacktoryUtility.pendingResolveNames = new Dictionary <string, NameTriple>();
     foreach (PawnBio curPawnBio in DirectXmlLoader.LoadXmlDataInResourcesFolder <PawnBio>("Backstories/Solid"))
     {
         string curDefName = curPawnBio.name.ToDefName(curPawnBio.gender);
         if (PawnBioAndBacktoryUtility.duplicateCount.ContainsKey(curDefName))
         {
             PawnBioAndBacktoryUtility.duplicateCount[curDefName]++;
             curDefName += "_" + PawnBioAndBacktoryUtility.duplicateCount[curDefName];
         }
         else
         {
             PawnBioAndBacktoryUtility.duplicateCount.Add(curDefName, 0);
         }
         PawnBioAndBacktoryUtility.pendingResolveNames.Add(curDefName, curPawnBio.name);
         if (curPawnBio.childhood == null || curPawnBio.adulthood == null)
         {
             PawnNameDatabaseSolid.AddPlayerContentName(curPawnBio.name, curPawnBio.gender);
         }
         else
         {
             curPawnBio.PostLoad();
             curPawnBio.ResolveReferences();
             foreach (string curError in curPawnBio.ConfigErrors())
             {
                 Log.Error(curError);
             }
             SolidBioDatabase.allBios.Add(curPawnBio);
             curPawnBio.childhood.shuffleable = false;
             curPawnBio.childhood.slot        = BackstorySlot.Childhood;
             BackstoryDatabase.AddBackstory(curPawnBio.childhood);
             curPawnBio.adulthood.shuffleable = false;
             curPawnBio.adulthood.slot        = BackstorySlot.Adulthood;
             BackstoryDatabase.AddBackstory(curPawnBio.adulthood);
         }
     }
     return(false);
 }
Beispiel #9
0
 public static void ReloadAllBackstories()
 {
     foreach (Backstory item in DirectXmlLoader.LoadXmlDataInResourcesFolder <Backstory>("Backstories/Shuffled"))
     {
         DeepProfiler.Start("Backstory.PostLoad");
         try
         {
             item.PostLoad();
         }
         finally
         {
             DeepProfiler.End();
         }
         DeepProfiler.Start("Backstory.ResolveReferences");
         try
         {
             item.ResolveReferences();
         }
         finally
         {
             DeepProfiler.End();
         }
         foreach (string item2 in item.ConfigErrors(ignoreNoSpawnCategories: false))
         {
             Log.Error(item.title + ": " + item2);
         }
         DeepProfiler.Start("AddBackstory");
         try
         {
             AddBackstory(item);
         }
         finally
         {
             DeepProfiler.End();
         }
     }
     SolidBioDatabase.LoadAllBios();
 }