Beispiel #1
0
        public override void Entry(IModHelper helper)
        {
            Config = helper.ReadConfig <ModConfig>();
            if (!Config.EnableMod)
            {
                return;
            }

            SMonitor = Monitor;

            SHelper = helper;

            ObjectPatches.Initialize(Monitor, helper, Config);

            var harmony = new Harmony(ModManifest.UniqueID);

            harmony.Patch(
                original: AccessTools.Method(typeof(Crop), nameof(Crop.draw), new Type[] { typeof(SpriteBatch), typeof(Vector2), typeof(Color), typeof(float) }),
                prefix: new HarmonyMethod(typeof(ObjectPatches), nameof(ObjectPatches.Crop_draw_Prefix))
                );

            harmony.Patch(
                original: AccessTools.Method(typeof(Object), nameof(Object.draw), new Type[] { typeof(SpriteBatch), typeof(int), typeof(int), typeof(float) }),
                prefix: new HarmonyMethod(typeof(ObjectPatches), nameof(ObjectPatches.Object_draw_Prefix))
                );

            helper.Events.Input.ButtonPressed += Input_ButtonPressed;
        }
Beispiel #2
0
        public override void Entry(IModHelper helper)
        {
            config = Helper.ReadConfig <ModConfig>();
            if (!config.EnableMod)
            {
                return;
            }

            //HarmonyInstance.DEBUG = true;


            SMonitor = Monitor;


            ObjectPatches.Initialize(Monitor, helper, config);

            var harmony = HarmonyInstance.Create(ModManifest.UniqueID);

            harmony.Patch(
                original: AccessTools.Method(typeof(StardewValley.Object), nameof(StardewValley.Object.draw), new Type[] { typeof(SpriteBatch), typeof(int), typeof(int), typeof(float) }),
                prefix: new HarmonyMethod(typeof(ObjectPatches), nameof(ObjectPatches.Object_draw_Prefix))
                );
        }