diff --git a/SDVModTest/IconHandler.cs b/SDVModTest/IconHandler.cs index 06914791..aea4827a 100644 --- a/SDVModTest/IconHandler.cs +++ b/SDVModTest/IconHandler.cs @@ -31,7 +31,7 @@ public Point GetNewIconPosition() int xPosition = (int)Tools.GetWidthInPlayArea() - 70 - 48 * _amountOfVisibleIcons; if (Game1.player.questLog.Any()) { - x -= 65; + xPosition -= 65; } ++_amountOfVisibleIcons; return new Point(xPosition, yPos); diff --git a/SDVModTest/Tools.cs b/SDVModTest/Tools.cs index 193e3b67..3c3ecc38 100644 --- a/SDVModTest/Tools.cs +++ b/SDVModTest/Tools.cs @@ -1,5 +1,6 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using StardewModdingAPI; using StardewValley; using StardewValley.Menus; using System; @@ -90,27 +91,51 @@ public static void DrawMouseCursor() public static Item GetHoveredItem() { Item hoverItem = null; - - for (int i = 0; i < Game1.onScreenMenus.Count; ++i) + if (Game1.onScreenMenus != null) { - Toolbar onScreenMenu = Game1.onScreenMenus[i] as Toolbar; - if (onScreenMenu != null) + for (int i = 0; i < Game1.onScreenMenus.Count; ++i) { - FieldInfo hoverItemField = typeof(Toolbar).GetField("hoverItem", BindingFlags.Instance | BindingFlags.NonPublic); - hoverItem = hoverItemField.GetValue(onScreenMenu) as Item; - //hoverItemField.SetValue(onScreenMenu, null); + Toolbar onScreenMenu = Game1.onScreenMenus[i] as Toolbar; + if (onScreenMenu != null) + { + FieldInfo hoverItemField = typeof(Toolbar).GetField("hoverItem", BindingFlags.Instance | BindingFlags.NonPublic); + hoverItem = hoverItemField.GetValue(onScreenMenu) as Item; + //hoverItemField.SetValue(onScreenMenu, null); + } } } if (Game1.activeClickableMenu is GameMenu gameMenu) { - foreach (var menu in gameMenu.pages) + if (Constants.TargetPlatform != GamePlatform.Android) + { + foreach (var menu in gameMenu.pages) + { + if (menu is InventoryPage inventory) + { + FieldInfo hoveredItemField = typeof(InventoryPage).GetField("hoveredItem", BindingFlags.Instance | BindingFlags.NonPublic); + hoverItem = hoveredItemField.GetValue(inventory) as Item; + //typeof(InventoryPage).GetField("hoverText", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(menu, ""); + } + } + } + else { - if (menu is InventoryPage inventory) + if (gameMenu.pages[gameMenu.currentTab] is InventoryPage inventory) { - FieldInfo hoveredItemField = typeof(InventoryPage).GetField("hoveredItem", BindingFlags.Instance | BindingFlags.NonPublic); - hoverItem = hoveredItemField.GetValue(inventory) as Item; - //typeof(InventoryPage).GetField("hoverText", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(menu, ""); + FieldInfo heldItemField = typeof(InventoryPage).GetField("heldItem", BindingFlags.Instance | BindingFlags.NonPublic); + Item heldItem = heldItemField.GetValue(inventory) as Item; + int x = Game1.getMousePosition().X; + int y = Game1.getMousePosition().Y; + foreach (ClickableComponent component in inventory.inventory.inventory) + { + int num = Convert.ToInt32(component.name); + if (component.containsPoint(x, y) && (num < inventory.inventory.actualInventory.Count) && (inventory.inventory.actualInventory[num] != null)) + { + hoverItem = inventory.inventory.actualInventory[num]; + break; + } + } } } } diff --git a/SDVModTest/UIElements/ExperienceBar.cs b/SDVModTest/UIElements/ExperienceBar.cs index e7c9dd3c..7874ab4c 100644 --- a/SDVModTest/UIElements/ExperienceBar.cs +++ b/SDVModTest/UIElements/ExperienceBar.cs @@ -9,7 +9,6 @@ using System; using System.Collections.Generic; using System.IO; -using System.Media; using System.Threading; using System.Threading.Tasks; using System.Timers; @@ -46,7 +45,7 @@ public interface LevelExtenderEvents private bool _showLevelUpAnimation = true; private bool _showExperienceBar = true; private readonly IModHelper _helper; - private SoundPlayer _player; + private object _player; private LevelExtenderInterface _levelExtenderAPI; @@ -62,7 +61,7 @@ public ExperienceBar(IModHelper helper) try { path = Path.Combine(_helper.DirectoryPath, "LevelUp.wav"); - _player = new SoundPlayer(path); + _player = Type.GetType("System.Media.SoundPlayer")?.GetConstructor(new Type[] { }).Invoke(new object[] { }); //path = path.Replace(Environment.CurrentDirectory, ""); //path = path.TrimStart(Path.DirectorySeparatorChar); //_soundEffect = SoundEffect.FromStream(TitleContainer.OpenStream(path)).CreateInstance(); @@ -209,7 +208,7 @@ private void OnLevelChanged(object sender, LevelChangedEventArgs e) Task.Factory.StartNew(() => { Thread.Sleep(100); - _player.Play(); + Type.GetType("System.Media.SoundPlayer")?.GetMethod("Play").Invoke(this._player, new object[] { }); }); Task.Factory.StartNew(() => @@ -520,6 +519,15 @@ private void DrawExperienceBar(int barWidth, int experienceGainedThisLevel, int { float leftSide = Game1.graphics.GraphicsDevice.Viewport.TitleSafeArea.Left; + if(Constants.TargetPlatform == GamePlatform.Android) + { + if (this._helper.Reflection.GetField(Game1.options, "verticalToolbar", true).GetValue()) + { + Toolbar toolbar = this._helper.Reflection.GetField(typeof(Game1), "toolbar", true).GetValue(); + leftSide += this._helper.Reflection.GetField(typeof(Game1), "toolbarPaddingX", true).GetValue() + this._helper.Reflection.GetProperty(toolbar, "itemSlotSize", true).GetValue(); + } + } + if (Game1.isOutdoorMapSmallerThanViewport()) { int num3 = Game1.currentLocation.map.Layers[0].LayerWidth * Game1.tileSize; diff --git a/SDVModTest/UIElements/ExperiencePointDisplay.cs b/SDVModTest/UIElements/ExperiencePointDisplay.cs index d1b8c446..ee4e2ea8 100644 --- a/SDVModTest/UIElements/ExperiencePointDisplay.cs +++ b/SDVModTest/UIElements/ExperiencePointDisplay.cs @@ -1,4 +1,5 @@ using Microsoft.Xna.Framework; +using StardewModdingAPI; using StardewValley; using System; using System.Collections.Generic; @@ -24,6 +25,18 @@ public void Draw() { _position.Y -= 0.5f; --_alpha; + if(Constants.TargetPlatform == GamePlatform.Android) + { + Game1.drawWithBorder( + "Exp " + _experiencePoints, + Color.DarkSlateGray * ((float)_alpha / 100f), + Color.PaleTurquoise * ((float)_alpha / 100f), + new Vector2(_position.X - 28, _position.Y - 130) * Game1.options.zoomLevel, + 0.0f, + 0.8f, + 0.0f); + return; + } Game1.drawWithBorder( "Exp " + _experiencePoints, Color.DarkSlateGray * ((float)_alpha / 100f), diff --git a/SDVModTest/UIElements/LocationOfTownsfolk.cs b/SDVModTest/UIElements/LocationOfTownsfolk.cs index b5dff556..651aa3da 100644 --- a/SDVModTest/UIElements/LocationOfTownsfolk.cs +++ b/SDVModTest/UIElements/LocationOfTownsfolk.cs @@ -215,7 +215,7 @@ private void OnRenderedActiveMenu_DrawNPCLocationsOnMap(object sender, RenderedA { if (Game1.activeClickableMenu is GameMenu gameMenu) { - if (gameMenu.currentTab == 3) + if (gameMenu.currentTab == (Constants.TargetPlatform == GamePlatform.Android ? 4 : 3)) { List namesToShow = new List(); foreach (var character in _townsfolk) diff --git a/SDVModTest/UIElements/LuckOfDay.cs b/SDVModTest/UIElements/LuckOfDay.cs index 6659512a..a2660957 100644 --- a/SDVModTest/UIElements/LuckOfDay.cs +++ b/SDVModTest/UIElements/LuckOfDay.cs @@ -85,6 +85,12 @@ private void OnUpdateTicked(object sender, UpdateTickedEventArgs e) private void OnRenderedHud(object sender, RenderedHudEventArgs e) { // draw hover text + if (Constants.TargetPlatform == GamePlatform.Android) + { + if (_icon.containsPoint((int)(Game1.getMouseX() * Game1.options.zoomLevel), (int)(Game1.getMouseY() * Game1.options.zoomLevel))) + IClickableMenu.drawHoverText(Game1.spriteBatch, _hoverText, Game1.dialogueFont); + return; + } if (_icon.containsPoint(Game1.getMouseX(), Game1.getMouseY())) IClickableMenu.drawHoverText(Game1.spriteBatch, _hoverText, Game1.dialogueFont); } diff --git a/SDVModTest/UIElements/ShopHarvestPrices.cs b/SDVModTest/UIElements/ShopHarvestPrices.cs index 93002f84..ed7c1f6c 100644 --- a/SDVModTest/UIElements/ShopHarvestPrices.cs +++ b/SDVModTest/UIElements/ShopHarvestPrices.cs @@ -66,7 +66,7 @@ private void OnRenderedActiveMenu(object sender, RenderedActiveMenuEventArgs e) 1); text = " " + temp.Price; } - + var heldItem = menu.heldItem as Item; if (heldItem == null) { diff --git a/SDVModTest/UIElements/ShowAccurateHearts.cs b/SDVModTest/UIElements/ShowAccurateHearts.cs index f2c67169..bf60245f 100644 --- a/SDVModTest/UIElements/ShowAccurateHearts.cs +++ b/SDVModTest/UIElements/ShowAccurateHearts.cs @@ -1,4 +1,5 @@ using Microsoft.Xna.Framework; +using StardewModdingAPI; using StardewModdingAPI.Events; using StardewValley; using StardewValley.Menus; @@ -64,45 +65,95 @@ private void OnRenderedActiveMenu(object sender, RenderedActiveMenuEventArgs e) .GetValue(_socialPage); int yOffset = 0; - for (int i = slotPosition; i < slotPosition + 5 && i < _friendNames.Length; ++i) + if (Constants.TargetPlatform != GamePlatform.Android) { - int yPosition = Game1.activeClickableMenu.yPositionOnScreen + 130 + yOffset; - yOffset += 112; - Friendship friendshipValues; - String nextName = _friendNames[i]; - if (Game1.player.friendshipData.TryGetValue(nextName, out friendshipValues)) + for (int i = slotPosition; i < slotPosition + 5 && i < _friendNames.Length; ++i) { - int friendshipRawValue = friendshipValues.Points; - - if (friendshipRawValue > 0) + int yPosition = Game1.activeClickableMenu.yPositionOnScreen + 130 + yOffset; + yOffset += 112; + Friendship friendshipValues; + String nextName = _friendNames[i]; + if (Game1.player.friendshipData.TryGetValue(nextName, out friendshipValues)) { - int pointsToNextHeart = friendshipRawValue % 250; - int numHearts = friendshipRawValue / 250; + int friendshipRawValue = friendshipValues.Points; - if (friendshipRawValue < 3000 && - _friendNames[i] == Game1.player.spouse || - friendshipRawValue < 2500) + if (friendshipRawValue > 0) { - DrawEachIndividualSquare(numHearts, pointsToNextHeart, yPosition); - //if (!Game1.options.hardwareCursor) - // Game1.spriteBatch.Draw( - // Game1.mouseCursors, - // new Vector2(Game1.getMouseX(), Game1.getMouseY()), - // Game1.getSourceRectForStandardTileSheet( - // Game1.mouseCursors, Game1.mouseCursor, - // 16, - // 16), - // Color.White, - // 0.0f, - // Vector2.Zero, - // Game1.pixelZoom + (float)(Game1.dialogueButtonScale / 150.0), - // SpriteEffects.None, - // 1f); + int pointsToNextHeart = friendshipRawValue % 250; + int numHearts = friendshipRawValue / 250; + + if (friendshipRawValue < 3000 && + _friendNames[i] == Game1.player.spouse || + friendshipRawValue < 2500) + { + DrawEachIndividualSquare(numHearts, pointsToNextHeart, yPosition); + //if (!Game1.options.hardwareCursor) + // Game1.spriteBatch.Draw( + // Game1.mouseCursors, + // new Vector2(Game1.getMouseX(), Game1.getMouseY()), + // Game1.getSourceRectForStandardTileSheet( + // Game1.mouseCursors, Game1.mouseCursor, + // 16, + // 16), + // Color.White, + // 0.0f, + // Vector2.Zero, + // Game1.pixelZoom + (float)(Game1.dialogueButtonScale / 150.0), + // SpriteEffects.None, + // 1f); + } } } } } + else + { + List sprites = (List)_socialPage.GetType().GetField("sprites", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(_socialPage); + for (int i = 0; i < _friendNames.Length; ++i) + { + if(sprites[i].bounds.Y < 40) + { + continue; + } + if(sprites[i].bounds.Y > _socialPage.height) + { + break; + } + Friendship friendshipValues; + String nextName = _friendNames[i]; + if (Game1.player.friendshipData.TryGetValue(nextName, out friendshipValues)) + { + int friendshipRawValue = friendshipValues.Points; + if (friendshipRawValue > 0) + { + int pointsToNextHeart = friendshipRawValue % 250; + int numHearts = friendshipRawValue / 250; + + if (friendshipRawValue < 3000 && + _friendNames[i] == Game1.player.spouse || + friendshipRawValue < 2500) + { + DrawEachIndividualSquare(numHearts, pointsToNextHeart, sprites[i].bounds.Y + 40); + //if (!Game1.options.hardwareCursor) + // Game1.spriteBatch.Draw( + // Game1.mouseCursors, + // new Vector2(Game1.getMouseX(), Game1.getMouseY()), + // Game1.getSourceRectForStandardTileSheet( + // Game1.mouseCursors, Game1.mouseCursor, + // 16, + // 16), + // Color.White, + // 0.0f, + // Vector2.Zero, + // Game1.pixelZoom + (float)(Game1.dialogueButtonScale / 150.0), + // SpriteEffects.None, + // 1f); + } + } + } + } + } String hoverText = gameMenu.hoverText; IClickableMenu.drawHoverText( Game1.spriteBatch, @@ -164,14 +215,30 @@ private void DrawEachIndividualSquare(int friendshipLevel, int friendshipPoints, { if (_numArray[i][j] == 1) { - Game1.spriteBatch.Draw( - Game1.staminaRect, - new Rectangle( - Game1.activeClickableMenu.xPositionOnScreen + 316 + num2 + j * 4, - yPosition + 14 + i * 4, - 4, - 4), - Color.Crimson); + if(Constants.TargetPlatform != GamePlatform.Android) + { + Game1.spriteBatch.Draw( + Game1.staminaRect, + new Rectangle( + Game1.activeClickableMenu.xPositionOnScreen + 316 + num2 + j * 4, + yPosition + 14 + i * 4, + 4, + 4), + Color.Crimson); + } + else + { + int heartsX = (int)_socialPage.GetType().GetField("heartsX", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(_socialPage); + float widthMod = (float)_socialPage.GetType().GetField("widthMod", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(_socialPage); + Game1.spriteBatch.Draw( + Game1.staminaRect, + new Rectangle( + Game1.activeClickableMenu.xPositionOnScreen + heartsX + (int)(num2 * widthMod) + 24 + j * 4, + yPosition + i * 4, + 4, + 4), + Color.Crimson); + } } } } diff --git a/SDVModTest/UIElements/ShowBirthdayIcon.cs b/SDVModTest/UIElements/ShowBirthdayIcon.cs index 33f08d78..f53751fc 100644 --- a/SDVModTest/UIElements/ShowBirthdayIcon.cs +++ b/SDVModTest/UIElements/ShowBirthdayIcon.cs @@ -5,6 +5,7 @@ using StardewValley; using StardewValley.Menus; using System; +using StardewModdingAPI; namespace UIInfoSuite.UIElements { @@ -137,6 +138,20 @@ private void OnRenderingHud(object sender, EventArgs e) private void OnRenderedHud(object sender, RenderedHudEventArgs e) { // draw hover text + if (Constants.TargetPlatform == GamePlatform.Android) + { + if (_birthdayNPC != null && + (_birthdayIcon?.containsPoint((int)(Game1.getMouseX() * Game1.options.zoomLevel), (int)(Game1.getMouseY() * Game1.options.zoomLevel)) ?? false)) + { + String hoverText = String.Format("{0}'s Birthday", _birthdayNPC.Name); + IClickableMenu.drawHoverText( + Game1.spriteBatch, + hoverText, + Game1.dialogueFont); + } + return; + } + if (_birthdayNPC != null && (_birthdayIcon?.containsPoint(Game1.getMouseX(), Game1.getMouseY()) ?? false)) { diff --git a/SDVModTest/UIElements/ShowItemHoverInformation.cs b/SDVModTest/UIElements/ShowItemHoverInformation.cs index d18ab75a..ddfa6b26 100644 --- a/SDVModTest/UIElements/ShowItemHoverInformation.cs +++ b/SDVModTest/UIElements/ShowItemHoverInformation.cs @@ -9,6 +9,7 @@ using StardewValley.Tools; using System; using System.Collections.Generic; +using StardewModdingAPI; namespace UIInfoSuite.UIElements { @@ -213,6 +214,7 @@ private void DrawAdvancedTooltip() int itemTextWidth = (int)(Game1.smallFont.MeasureString(itemPrice.ToString()).Length()); largestTextWidth = (stackTextWidth > itemTextWidth) ? stackTextWidth : itemTextWidth; int windowWidth = Math.Max(largestTextWidth + 90, String.IsNullOrEmpty(requiredBundleName) ? 100 : 300); + float layerDepth = Constants.TargetPlatform != GamePlatform.Android ? 0.95f : 0f; int windowHeight = 75; @@ -264,7 +266,7 @@ private void DrawAdvancedTooltip() new Vector2(8, 8), Game1.pixelZoom, SpriteEffects.None, - 0.95f); + layerDepth); Game1.spriteBatch.DrawString( Game1.smallFont, @@ -291,7 +293,7 @@ private void DrawAdvancedTooltip() new Vector2(8, 8), Game1.pixelZoom, SpriteEffects.None, - 0.95f); + layerDepth); Game1.spriteBatch.Draw( Game1.debrisSpriteSheet, @@ -302,7 +304,7 @@ private void DrawAdvancedTooltip() new Vector2(8, 8), Game1.pixelZoom, SpriteEffects.None, - 0.95f); + layerDepth); Game1.spriteBatch.DrawString( Game1.smallFont, @@ -328,7 +330,7 @@ private void DrawAdvancedTooltip() // new Vector2(8, 8), // Game1.pixelZoom, // SpriteEffects.None, - // 0.95f); + // layerDepth); if (cropPrice > 0) { diff --git a/SDVModTest/UIElements/ShowQueenOfSauceIcon.cs b/SDVModTest/UIElements/ShowQueenOfSauceIcon.cs index c7109aae..478c1446 100644 --- a/SDVModTest/UIElements/ShowQueenOfSauceIcon.cs +++ b/SDVModTest/UIElements/ShowQueenOfSauceIcon.cs @@ -192,6 +192,17 @@ private void OnRenderingHud(object sender, RenderingHudEventArgs e) texture.draw(Game1.spriteBatch); + if(Constants.TargetPlatform == GamePlatform.Android) + { + if (texture.containsPoint((int)(Game1.getMouseX() * Game1.options.zoomLevel), (int)(Game1.getMouseY() * Game1.options.zoomLevel))) + { + IClickableMenu.drawHoverText( + Game1.spriteBatch, + "Gus is selling " + Game1.dishOfTheDay.DisplayName + " recipe today!", + Game1.dialogueFont); + } + return; + } if (texture.containsPoint(Game1.getMouseX(), Game1.getMouseY())) { IClickableMenu.drawHoverText( @@ -209,6 +220,19 @@ private void OnRenderingHud(object sender, RenderingHudEventArgs e) private void OnRenderedHud(object sender, RenderedHudEventArgs e) { // draw hover text + if (Constants.TargetPlatform == GamePlatform.Android) + { + if (_drawQueenOfSauceIcon && + _queenOfSauceIcon.containsPoint((int)(Game1.getMouseX() * Game1.options.zoomLevel), (int)(Game1.getMouseY() * Game1.options.zoomLevel))) + { + IClickableMenu.drawHoverText( + Game1.spriteBatch, + _helper.SafeGetString( + LanguageKeys.TodaysRecipe) + _todaysRecipe, + Game1.dialogueFont); + } + return; + } if (_drawQueenOfSauceIcon && _queenOfSauceIcon.containsPoint(Game1.getMouseX(), Game1.getMouseY())) { diff --git a/SDVModTest/UIElements/ShowToolUpgradeStatus.cs b/SDVModTest/UIElements/ShowToolUpgradeStatus.cs index 0debc5e4..4573c8ae 100644 --- a/SDVModTest/UIElements/ShowToolUpgradeStatus.cs +++ b/SDVModTest/UIElements/ShowToolUpgradeStatus.cs @@ -139,6 +139,18 @@ private void OnRenderingHud(object sender, RenderingHudEventArgs e) private void OnRenderedHud(object sender, RenderedHudEventArgs e) { // draw hover text + if (Constants.TargetPlatform == GamePlatform.Android) + { + if (_toolBeingUpgraded != null && + (_toolUpgradeIcon?.containsPoint((int)(Game1.getMouseX() * Game1.options.zoomLevel), (int)(Game1.getMouseY() * Game1.options.zoomLevel)) ?? false)) + { + IClickableMenu.drawHoverText( + Game1.spriteBatch, + _hoverText, Game1.dialogueFont); + } + return; + } + if (_toolBeingUpgraded != null && (_toolUpgradeIcon?.containsPoint(Game1.getMouseX(), Game1.getMouseY()) ?? false)) { diff --git a/SDVModTest/UIElements/ShowTravelingMerchant.cs b/SDVModTest/UIElements/ShowTravelingMerchant.cs index a9f8cb5e..8aa20af0 100644 --- a/SDVModTest/UIElements/ShowTravelingMerchant.cs +++ b/SDVModTest/UIElements/ShowTravelingMerchant.cs @@ -79,6 +79,19 @@ private void OnRenderingHud(object sender, RenderingHudEventArgs e) private void OnRenderedHud(object sender, RenderedHudEventArgs e) { // draw hover text + if (Constants.TargetPlatform == GamePlatform.Android) + { + if (_travelingMerchantIsHere && (_travelingMerchantIcon?.containsPoint((int)(Game1.getMouseX() * Game1.options.zoomLevel), (int)(Game1.getMouseY() * Game1.options.zoomLevel)) ?? false)) + { + string hoverText = _helper.SafeGetString( + LanguageKeys.TravelingMerchantIsInTown); + IClickableMenu.drawHoverText( + Game1.spriteBatch, + hoverText, Game1.dialogueFont); + } + return; + } + if (_travelingMerchantIsHere && (_travelingMerchantIcon?.containsPoint(Game1.getMouseX(), Game1.getMouseY()) ?? false)) { string hoverText = _helper.SafeGetString( diff --git a/SDVModTest/UIElements/ShowWhenAnimalNeedsPet.cs b/SDVModTest/UIElements/ShowWhenAnimalNeedsPet.cs index 219873db..dce4eadb 100644 --- a/SDVModTest/UIElements/ShowWhenAnimalNeedsPet.cs +++ b/SDVModTest/UIElements/ShowWhenAnimalNeedsPet.cs @@ -221,6 +221,11 @@ private void DrawIconForPets() private Vector2 GetPetPositionAboveAnimal(Character animal) { + if(Constants.TargetPlatform == GamePlatform.Android) + { + return new Vector2(Game1.viewport.Width <= Game1.currentLocation.map.DisplayWidth ? (animal.position.X - Game1.viewport.X + 16) * Game1.options.zoomLevel : (animal.position.X + ((Game1.viewport.Width - Game1.currentLocation.map.DisplayWidth) / 2 + 18)) * Game1.options.zoomLevel, + Game1.viewport.Height <= Game1.currentLocation.map.DisplayHeight ? (animal.position.Y - Game1.viewport.Y - 34) * Game1.options.zoomLevel : (animal.position.Y + ((Game1.viewport.Height - Game1.currentLocation.map.DisplayHeight) / 2 - 50)) * Game1.options.zoomLevel); + } return new Vector2(Game1.viewport.Width <= Game1.currentLocation.map.DisplayWidth ? animal.position.X - Game1.viewport.X + 16 : animal.position.X + ((Game1.viewport.Width - Game1.currentLocation.map.DisplayWidth) / 2 + 18), Game1.viewport.Height <= Game1.currentLocation.map.DisplayHeight ? animal.position.Y - Game1.viewport.Y - 34 : animal.position.Y + ((Game1.viewport.Height - Game1.currentLocation.map.DisplayHeight) / 2 - 50)); }