Example #1
0
 public void onGameStatePostLoad(ConfigNode node)
 {
     RSTLogWriter.Log("onGameStatePostLoad");
     if (HighLogic.CurrentGame != null)
     {
         RB_SettingsParms = HighLogic.CurrentGame.Parameters.CustomParams <ResearchBodies_SettingsParms>();
         ApplySettings();
         foreach (KeyValuePair <CelestialBody, CelestialBodyInfo> CB in CelestialBodies)
         {
             CB.Value.ignore = CB.Value.IgnoreData.GetLevel(HighLogic.CurrentGame.Parameters.CustomParams <ResearchBodies_SettingsParms>().difficulty);
             if (CB.Value.ignore)
             {
                 CB.Value.isResearched  = true;
                 CB.Value.researchState = 100;
             }
             //else
             //{
             //    CB.Value.isResearched = false;
             //    CB.Value.researchState = 0;
             //}
         }
     }
     else
     {
         RSTLogWriter.Log("Highlogic.CurrentGame is NULL cannot set Settings!!");
     }
 }
Example #2
0
 public void ApplySettings()
 {
     RSTLogWriter.Log("Database ApplySettings");
     if (HighLogic.CurrentGame != null)
     {
         //if (RB_SettingsParms == null)
         RB_SettingsParms = HighLogic.CurrentGame.Parameters.CustomParams <ResearchBodies_SettingsParms>();
         if (ResearchBodies.Instance != null)
         {
             ResearchBodies.Enabled = RB_SettingsParms.RBEnabled;
         }
         chances       = RB_SettingsParms.DiscoverySeed;
         allowTSlevel1 = RB_SettingsParms.Enabledtslvl1;
         if (RB_SettingsParms.french)
         {
             if (Locales.currentLocale.LocaleFull != "Français")
             {
                 Locales.setLocale("Français");
                 if (ResearchBodiesController.instance != null)
                 {
                     ResearchBodiesController.instance.French = true;
                 }
             }
         }
         else
         {
             Locales.setLocale("");
         }
         RSTLogWriter.debuggingOn = HighLogic.CurrentGame.Parameters.CustomParams <ResearchBodies_SettingsParms>().DebugLogging;
     }
     else
     {
         RSTLogWriter.Log("Database Failed to apply settings - Fatal Error");
     }
 }
Example #3
0
 public void ApplySettings()
 {
     RSTLogWriter.Log("Database ApplySettings");
     if (HighLogic.CurrentGame != null)
     {
         //if (RB_SettingsParms == null)
         RB_SettingsParms = HighLogic.CurrentGame.Parameters.CustomParams <ResearchBodies_SettingsParms>();
         if (ResearchBodies.Instance != null)
         {
             ResearchBodies.Enabled = RB_SettingsParms.RBEnabled;
         }
         chances                  = RB_SettingsParms.DiscoverySeed;
         allowTSlevel1            = RB_SettingsParms.Enabledtslvl1;
         RSTLogWriter.debuggingOn = HighLogic.CurrentGame.Parameters.CustomParams <ResearchBodies_SettingsParms>().DebugLogging;
     }
     else
     {
         RSTLogWriter.Log("Database Failed to apply settings - Fatal Error");
     }
 }