public static Rect DrawCancelButton(Rect rect)
 {
     if (BlindResearch.Active() &&
         BlindResearch.SelectedResearch() == Find.ResearchManager.currentProj &&
         BlindResearch.CanSeeCurrent())
     {
         Rect iconRect = rect.ContractedBy(2);
         iconRect.width = iconRect.height;
         if (Widgets.ButtonImage(iconRect, ContentFinder <Texture2D> .Get("UI/Designators/Cancel")))
         {
             Find.ResearchManager.currentProj = null;
         }
     }
     return(rect);
 }
Ejemplo n.º 2
0
        public static bool HideButtonText(Rect rect, string label, bool drawBackground, bool doMouseoverSound, bool active)
        {
            bool result = false;

            if (BlindResearch.CanChangeTo(BlindResearch.SelectedResearch()))
            {
                result = Widgets.ButtonText(rect, label, drawBackground, doMouseoverSound, active);
            }
            else
            {
                if (rect.height > 30)               //Debug buttons are 30, aeh, so don't draw this for them.
                //Same as 'in-progress'
                {
                    Widgets.DrawHighlight(rect);
                }
            }

            return(result);
        }