public static void drawFilterButton(ref Bill_Production ___bill, ref bool ___absorbInputAroundWindow, ref bool ___closeOnClickedOutside, ref Rect ___windowRect)
 {
     if (foundSomeStuff(___bill))
     {
         ThingFilter filter     = ___bill.ingredientFilter;
         Vector2     buttonSize = new Vector2(122f, 25f);
         float       top        = ___windowRect.y;
         float       left       = ___windowRect.x + ___windowRect.width;
         if (Widgets.ButtonText(new Rect(642f, 25f, buttonSize.x, buttonSize.y), "Filter".Translate() + ">>"))
         {
             MaterialFilterWindow w = Find.WindowStack.WindowOfType <MaterialFilterWindow>();
             if (w != null)
             {
                 ___absorbInputAroundWindow = true;
                 ___closeOnClickedOutside   = true;
                 w.Close();
             }
             else
             {
                 ___absorbInputAroundWindow = false;
                 ___closeOnClickedOutside   = false;
                 Find.WindowStack.Add(new MaterialFilterWindow(filter, top, left, WindowLayer.Dialog));
             }
         }
     }
 }
 public static void drawFilterButton(Outfit ___selOutfitInt, ref bool ___absorbInputAroundWindow, ref bool ___closeOnClickedOutside, ref Rect ___windowRect)
 {
     if (___selOutfitInt != null)
     {
         ThingFilter filter     = ___selOutfitInt.filter;
         Vector2     buttonSize = new Vector2(80f, 30f);
         float       top        = ___windowRect.y;
         float       left       = ___windowRect.x + ___windowRect.width;
         if (Widgets.ButtonText(new Rect(215f, 50f, buttonSize.x, buttonSize.y), "Filter".Translate()))
         {
             MaterialFilterWindow w = Find.WindowStack.WindowOfType <MaterialFilterWindow>();
             if (w != null)
             {
                 ___absorbInputAroundWindow = true;
                 ___closeOnClickedOutside   = true;
                 w.Close();
             }
             else
             {
                 ___absorbInputAroundWindow = false;
                 ___closeOnClickedOutside   = false;
                 Find.WindowStack.Add(new MaterialFilterWindow(filter, top, left, WindowLayer.Dialog));
             }
         }
     }
 }
Exemple #3
0
        public static void drawFilterButton(ITab_Storage __instance, Vector2 ___WinSize)
        {
            // TabRect.y is top of window
            Rect        TabRect    = Traverse.Create(__instance).Property("TabRect").GetValue <Rect>();
            ThingFilter filter     = Traverse.Create(__instance).Property("SelStoreSettingsParent").GetValue <IStoreSettingsParent>().GetStoreSettings().filter;
            var         buttonSize = new Vector2(80f, 29f);

            if (Widgets.ButtonText(new Rect(180, 10, buttonSize.x, buttonSize.y), "Filter".Translate() + ">>"))
            {
                MaterialFilterWindow w = Find.WindowStack.WindowOfType <MaterialFilterWindow>();
                if (w != null)
                {
                    w.Close();
                }
                else
                {
                    Find.WindowStack.Add(new MaterialFilterWindow(filter, TabRect.y, ___WinSize.x, WindowLayer.GameUI));
                }
            }
        }