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(); }
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; }
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; }
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; }
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(); }
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; } } } }
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; } }
internal void ResetBombList() { this.settings.disallowedBombs.Clear(); this.settings.allowedBombs.Clear(); SRTSHelper.PopulateAllowedBombs(); }