Example #1
0
        private static void DrawReticules(Slingshot slingshot, SpriteBatch spriteBatch)
        {
            Farmer lastFarmer = slingshot.getLastFarmerToUse();

            if (lastFarmer == null || !lastFarmer.usingSlingshot || !lastFarmer.IsLocalPlayer)
            {
                return;
            }

            if (BetterSlingshotsMod.Instance.Config.ShowActualMousePositionWhenAiming)
            {
                SlingshotDrawPatch.DrawTargetingReticule(spriteBatch, new Vector2(Game1.getMouseX(), Game1.getMouseY()));
            }

            Vector2 projectileVelocity = Utils.GetCorrectVelocity(new Vector2(slingshot.aimPos.X, slingshot.aimPos.Y), lastFarmer, !BetterSlingshotsMod.Instance.Config.DisableReverseAiming);

            projectileVelocity.Normalize();

            Vector2 farmerPosition = Utils.GetCorrectFarmerPosition(lastFarmer);

            SlingshotDrawPatch.DrawTargetingReticule(spriteBatch, Game1.GlobalToLocal(Game1.viewport, new Vector2(farmerPosition.X + projectileVelocity.X * 250, farmerPosition.Y + projectileVelocity.Y * 250)));
        }
Example #2
0
        private static bool Prefix(Slingshot __instance, SpriteBatch b)
        {
            SlingshotDrawPatch.DrawReticules(__instance, b);

            return(false);
        }