Esempio n. 1
0
 public static void RecacheData()
 {
     scenariosLocal.Clear();
     foreach (FileInfo allCustomScenarioFile in GenFilePaths.AllCustomScenarioFiles)
     {
         if (GameDataSaveLoader.TryLoadScenario(allCustomScenarioFile.FullName, ScenarioCategory.CustomLocal, out Scenario scen))
         {
             scenariosLocal.Add(scen);
         }
     }
     scenariosWorkshop.Clear();
     foreach (WorkshopItem allSubscribedItem in WorkshopItems.AllSubscribedItems)
     {
         WorkshopItem_Scenario workshopItem_Scenario = allSubscribedItem as WorkshopItem_Scenario;
         if (workshopItem_Scenario != null)
         {
             scenariosWorkshop.Add(workshopItem_Scenario.GetScenario());
         }
     }
 }
Esempio n. 2
0
 public static void RecacheData()
 {
     ScenarioFiles.scenariosLocal.Clear();
     foreach (FileInfo fileInfo in GenFilePaths.AllCustomScenarioFiles)
     {
         Scenario item;
         if (GameDataSaveLoader.TryLoadScenario(fileInfo.FullName, ScenarioCategory.CustomLocal, out item))
         {
             ScenarioFiles.scenariosLocal.Add(item);
         }
     }
     ScenarioFiles.scenariosWorkshop.Clear();
     foreach (WorkshopItem workshopItem in WorkshopItems.AllSubscribedItems)
     {
         WorkshopItem_Scenario workshopItem_Scenario = workshopItem as WorkshopItem_Scenario;
         if (workshopItem_Scenario != null)
         {
             ScenarioFiles.scenariosWorkshop.Add(workshopItem_Scenario.GetScenario());
         }
     }
 }