示例#1
0
 public static void ResearchFinishAllSRTS(ResearchManager __instance, ref Dictionary<ResearchProjectDef, float> ___progress)
 {
   foreach (ResearchProjectDef researchProjectDef in SRTSHelper.srtsDefProjects.Values)
   {
     ___progress[researchProjectDef] = SRTSHelper.GetResearchStat(researchProjectDef);
   }
   __instance.ReapplyAllMods();
 }
        static InitializeDefProperties()
        {
            SRTSMod.mod.settings.CheckDictionarySavedValid();
            SRTS_ModSettings.CheckNewDefaultValues();
            SRTSHelper.PopulateDictionary();
            SRTSHelper.PopulateAllowedBombs();

            ModCompatibilityInitialized();
        }
示例#3
0
 public static bool ResearchProgressPercent(ResearchProjectDef __instance, ref float __result)
 {
   if (SRTSHelper.srtsDefProjects.Any(x => x.Value == __instance))
   {
     __result = Find.ResearchManager.GetProgress(__instance) / SRTSHelper.GetResearchStat(__instance);
     return false;
   }
   return true;
 }
示例#4
0
 public static bool ResearchIsFinished(ResearchProjectDef __instance, ref bool __result)
 {
   if (SRTSHelper.srtsDefProjects.Any(x => x.Value == __instance))
   {
     __result = __instance.ProgressReal >= SRTSHelper.GetResearchStat(__instance);
     return false;
   }
   return true;
 }
示例#5
0
 public static bool ResearchCostApparent(ResearchProjectDef __instance, ref float __result)
 {
   if (SRTSHelper.srtsDefProjects.Any(x => x.Value == __instance))
   {
     __result = SRTSHelper.GetResearchStat(__instance) * __instance.CostFactor(Faction.OfPlayer.def.techLevel);
     return false;
   }
   return true;
 }
示例#6
0
 private void ResetMainSettings()
 {
     SoundDefOf.RadioButtonClicked.PlayOneShotOnCamera();
     this.settings.passengerLimits              = true;
     this.settings.dynamicWorldDrawingSRTS      = true;
     this.settings.displayHomeItems             = true;
     this.settings.allowEvenIfDowned            = true;
     this.settings.allowEvenIfPrisonerUnsecured = false;
     this.settings.allowCapturablePawns         = true;
     this.settings.disallowedBombs.Clear();
     this.settings.allowedBombs.Clear();
     SRTSHelper.PopulateAllowedBombs();
 }
示例#7
0
 public static void CustomPrerequisitesCompleted(ResearchProjectDef __instance, ref bool __result, List<ResearchProjectDef> ___prerequisites)
 {
   if (SRTSHelper.ContainedInDefProjects(__instance) && ___prerequisites != null && __result is true)
   {
     List<ResearchProjectDef> projects = SRTSMod.mod.settings.defProperties[SRTSHelper.srtsDefProjects.FirstOrDefault(x => x.Value == __instance).Key.defName].CustomResearch;
     foreach (ResearchProjectDef proj in projects)
     {
       if (!proj.IsFinished)
       {
         __result = false;
       }
     }
   }
 }
示例#8
0
 public static void DrawCustomResearchPrereqs(ResearchProjectDef project, Rect rect, ref float __result)
 {
   if (SRTSHelper.ContainedInDefProjects(project))
   {
     List<ResearchProjectDef> projects = SRTSMod.mod.settings.defProperties[SRTSHelper.srtsDefProjects.FirstOrDefault(x => x.Value == project).Key.defName].CustomResearch;
     float yMin = rect.yMin;
     rect.yMin += rect.height;
     var oldResult = __result;
     foreach (ResearchProjectDef proj in projects)
     {
       if (!project.IsFinished)
       {
         if (proj.IsFinished)
           GUI.color = Color.green;
         else
           GUI.color = Color.red;
       }
       Widgets.LabelCacheHeight(ref rect, "  " + proj.LabelCap, true, false);
       rect.yMin += rect.height;
     }
     GUI.color = Color.white;
     __result = rect.yMin - yMin + oldResult;
   }
 }
示例#9
0
 internal void ResetBombList()
 {
     this.settings.disallowedBombs.Clear();
     this.settings.allowedBombs.Clear();
     SRTSHelper.PopulateAllowedBombs();
 }