Esempio n. 1
0
 static void BillIngredientSearchRadius(ITab_Bills __instance)
 {
     // Apply the buffered value for smooth rendering
     // (the actual syncing happens in BillIngredientSearchRadius below)
     if (__instance.mouseoverBill is { } mouseover)
     {
         SyncIngredientSearchRadius.Watch(mouseover);
     }
 }
        public static bool Prefix(ref ITab_Bills __instance)
        {
            var bill = MouseOverBillGetter.GetValue(__instance) as Bill_Production;

            if (bill == null)
            {
                return(true);
            }

            Main.Instance.GetExtendedBillDataStorage().MirrorBillToLinkedBills(bill);
            return(true);
        }
Esempio n. 3
0
        public static bool Prefix(ref ITab_Bills __instance)
        {
            if (!(MouseOverBillGetter.GetValue(__instance) is Bill_Production bill))
            {
                return(true);
            }

            if (BillUtility.Clipboard != null)
            {
                Main.Instance.BillCopyPasteHandler.DoCopy(bill);
                BillUtility.Clipboard = null;
            }

            Main.Instance.GetExtendedBillDataStorage().MirrorBillToLinkedBills(bill);
            return(true);
        }
Esempio n. 4
0
        public static void Prefix(ref Func <List <FloatMenuOption> > recipeOptionsMaker, ITab_Bills __instance)
        {
            Func <List <FloatMenuOption> > bill_source = recipeOptionsMaker;
            Building_WorkTable             selThing    = (Building_WorkTable)Find.Selector.SingleSelectedThing;
            List <RecipeDef> rdef = selThing.def.AllRecipes;

            recipeOptionsMaker = () =>
            {
                List <FloatMenuOption> optList = bill_source();
                int ii = 0;

                foreach (FloatMenuOption opt in optList)
                {
                    int       iii   = ii;
                    RecipeDef _rdef = rdef[ii];
                    opt.action = () => { Utilities.RimLog.Message("recipe option clicked for recipe " + _rdef); MakeNewBillAt(selThing, _rdef); };
                    ii++;
                }

                return(optList);
            };
        }