//Restore completion letter when there's no queue //DoCompletionLetter should probably go in ResearchPal inside TryStartNext but who wants to transpile that or tell them to fix it //public void FinishProject(ResearchProjectDef proj, bool doCompletionDialog = false, Pawn researcher = null) static void Prefix(ResearchProjectDef proj, bool doCompletionDialog) { if (!doCompletionDialog || !BlindResearch.Active()) { return; } try { DoCompletionDialogEx(proj); } catch (Exception) { } }
public static bool HideButtonInvisible(Rect butRect, bool doMouseoverSound, object obj) { ResearchProjectDef selected = Research.GetValue(obj) as ResearchProjectDef; if (selected == Find.ResearchManager.currentProj) { selected = null; } return(BlindResearch.CanChangeTo(selected) ? Widgets.ButtonInvisible(butRect, doMouseoverSound) : false); }
public static void Postfix(Rect canvas, bool interactible) { if (BlindResearch.Active() && BlindResearch.CanSeeCurrent()) { Rect iconRect = canvas.ContractedBy(4); iconRect.width = iconRect.height; if (Widgets.ButtonImage(iconRect, ContentFinder <Texture2D> .Get("UI/Designators/Cancel")) && interactible) { Find.ResearchManager.currentProj = null; } } }
public static float HideProgressPercent(float progress) { return(BlindResearch.CanSeeProgress(progress) ? progress : 0); }