Beispiel #1
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;
       }
     }
   }
 }
Beispiel #2
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;
   }
 }