Exemplo n.º 1
0
        public static void Postfix(ref bool __result, FloatMenuOption __instance)
        {
            if (!Ad2Mod.settings.useRightClickMenu || !PatchFloatMenu.IsTracked(__instance))
            {
                return;
            }

            if (!__result || Event.current.button != 1)
            {
                return;
            }

            __result = false;
            var recipe = Ad2.GetRecipeByLabel(__instance.Label);

            if (recipe == null || !Ad2.IsSrcRecipe(recipe))
            {
                return;
            }

            var nlst = Ad2.GetNewRecipesList(recipe);

            if (nlst == null)
            {
                return;
            }

            Find.WindowStack.Add(new FloatMenu(RecipeOptionsMaker(nlst)));
        }