public static void Execute()
 {
     harp.TryPatching(
         typeof(StardewValley.Farm),
         nameof(StardewValley.Farm.tryToAddHay),
         prefix: new HarmonyMethod(typeof(SiloSizePatcher), nameof(Farm_tryToAddHay_prefix))
         );
     //harp.TryPatching(
     //    typeof(StardewValley.Buildings.Building),
     //    nameof(StardewValley.Buildings.Building.doAction),
     //    transpiler: new HarmonyMethod(typeof(SiloSizePatcher), nameof(Buildings_Building_doAction_transp))
     //    );
     harp.TryPatching(
         typeof(StardewValley.Buildings.Building),
         nameof(StardewValley.Buildings.Building.doAction),
         prefix: new HarmonyMethod(typeof(SiloSizePatcher), nameof(Buildings_Building_doAction_prefix))
         );
     //harp.TryPatching(
     //    typeof(StardewValley.Object),
     //    nameof(StardewValley.Object.checkForAction),
     //    transpiler: new HarmonyMethod(typeof(Patcher), nameof(Object_checkForAction_transp))
     //    );
     harp.TryPatching(
         typeof(StardewValley.Object),
         nameof(StardewValley.Object.checkForAction),
         prefix: new HarmonyMethod(typeof(SiloSizePatcher), nameof(Object_checkForAction_prefix))
         );
 }
Esempio n. 2
0
        public static void Execute()
        {
            // For DayTimeMoneyBox.draw(), targetMethod needs to be hardcoded because method is private.
            // Furthermore, there are 2 draw() overrides, so we need to choose the one with the right signature
            harp.TryPatching(typeof(DayTimeMoneyBox), "draw", transpiler: nameof(Menus_DayTimeMoneyBox_draw_transp), targetParams: new Type[] { typeof(SpriteBatch) });

            harp.TryPatching(typeof(Game1), nameof(Game1.getTimeOfDayString), prefix: nameof(Patcher.G1_getTimeOfDayString_prefix));
        }