public static bool Object_draw_Prefix(Object __instance, SpriteBatch spriteBatch, float alpha) { if (!(__instance is BedFurniture) || (__instance is BedFurniture && (__instance as BedFurniture)?.bedType != BedFurniture.BedType.Double)) { return(true); } if (!Config.EnableMod) { __instance.boundingBox.Width = 3 * 64; return(true); } int bedWidth = Math.Max(Config.BedWidth, 3); NetVector2 drawPosition = Helper.Reflection.GetField <NetVector2>(__instance as BedFurniture, "drawPosition").GetValue(); __instance.boundingBox.Width = bedWidth * 64; Rectangle drawn_rect = (__instance as BedFurniture).sourceRect.Value; int third = drawn_rect.Width / 3; Rectangle drawn_first = new Rectangle(drawn_rect.X, drawn_rect.Y, third, drawn_rect.Height); Rectangle drawn_second = new Rectangle(drawn_rect.X + third, drawn_rect.Y, third, drawn_rect.Height); Rectangle drawn_third = new Rectangle(drawn_rect.X + third + third, drawn_rect.Y, third, drawn_rect.Height); spriteBatch.Draw(Furniture.furnitureTexture, Game1.GlobalToLocal(Game1.viewport, drawPosition + ((__instance.shakeTimer > 0) ? new Vector2(Game1.random.Next(-1, 2), Game1.random.Next(-1, 2)) : Vector2.Zero)), new Rectangle?(drawn_first), Color.White * alpha, 0f, Vector2.Zero, 4f, __instance.Flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, (__instance.boundingBox.Value.Top + 1) / 10000f); for (int i = 1; i < bedWidth - 1; i++) { spriteBatch.Draw(Furniture.furnitureTexture, Game1.GlobalToLocal(Game1.viewport, drawPosition + ((__instance.shakeTimer > 0) ? new Vector2(Game1.random.Next(-1, 2), Game1.random.Next(-1, 2)) : Vector2.Zero)) + new Vector2(third * i * 4, 0), new Rectangle?(drawn_second), Color.White * alpha, 0f, Vector2.Zero, 4f, __instance.Flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, (__instance.boundingBox.Value.Top + 1) / 10000f); } spriteBatch.Draw(Furniture.furnitureTexture, Game1.GlobalToLocal(Game1.viewport, drawPosition + ((__instance.shakeTimer > 0) ? new Vector2(Game1.random.Next(-1, 2), Game1.random.Next(-1, 2)) : Vector2.Zero)) + new Vector2(third * (bedWidth - 1) * 4, 0), new Rectangle?(drawn_third), Color.White * alpha, 0f, Vector2.Zero, 4f, __instance.Flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, (__instance.boundingBox.Value.Top + 1) / 10000f); drawn_rect.X += drawn_rect.Width; drawn_first = new Rectangle(drawn_rect.X, drawn_rect.Y, third, drawn_rect.Height); drawn_second = new Rectangle(drawn_rect.X + third, drawn_rect.Y, third, drawn_rect.Height); drawn_third = new Rectangle(drawn_rect.X + third + third, drawn_rect.Y, third, drawn_rect.Height); int solidHeight = 41; Rectangle drawn_first_t = new Rectangle(drawn_rect.X, drawn_rect.Y + solidHeight, third, drawn_rect.Height - solidHeight); Rectangle drawn_second_t = new Rectangle(drawn_rect.X + third, drawn_rect.Y + solidHeight, third, drawn_rect.Height - solidHeight); Rectangle drawn_third_t = new Rectangle(drawn_rect.X + third * 2, drawn_rect.Y + solidHeight, third, drawn_rect.Height - solidHeight); float sheetAlpha = alpha; sheetAlpha *= Config.SheetTransparency; spriteBatch.Draw(Furniture.furnitureTexture, Game1.GlobalToLocal(Game1.viewport, drawPosition + ((__instance.shakeTimer > 0) ? new Vector2(Game1.random.Next(-1, 2), Game1.random.Next(-1, 2)) : Vector2.Zero)), new Rectangle?(drawn_first), Color.White * sheetAlpha, 0f, Vector2.Zero, 4f, __instance.Flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, (__instance.boundingBox.Value.Bottom - 1) / 10000f); spriteBatch.Draw(Furniture.furnitureTexture, Game1.GlobalToLocal(Game1.viewport, drawPosition + ((__instance.shakeTimer > 0) ? new Vector2(Game1.random.Next(-1, 2), Game1.random.Next(-1, 2)) : Vector2.Zero)) + new Vector2(0, solidHeight * 4), new Rectangle?(drawn_first_t), Color.White, 0f, Vector2.Zero, 4f, __instance.Flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, (__instance.boundingBox.Value.Bottom - 2) / 10000f); for (int i = 1; i < bedWidth - 1; i++) { spriteBatch.Draw(Furniture.furnitureTexture, Game1.GlobalToLocal(Game1.viewport, drawPosition + ((__instance.shakeTimer > 0) ? new Vector2(Game1.random.Next(-1, 2), Game1.random.Next(-1, 2)) : Vector2.Zero)) + new Vector2(third * i * 4, 0), new Rectangle?(drawn_second), Color.White * sheetAlpha, 0f, Vector2.Zero, 4f, __instance.Flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, (__instance.boundingBox.Value.Bottom - 1) / 10000f); spriteBatch.Draw(Furniture.furnitureTexture, Game1.GlobalToLocal(Game1.viewport, drawPosition + ((__instance.shakeTimer > 0) ? new Vector2(Game1.random.Next(-1, 2), Game1.random.Next(-1, 2)) : Vector2.Zero)) + new Vector2(0, solidHeight * 4) + new Vector2(third * i * 4, 0), new Rectangle?(drawn_second_t), Color.White, 0f, Vector2.Zero, 4f, __instance.Flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, (__instance.boundingBox.Value.Bottom - 1) / 10000f); } spriteBatch.Draw(Furniture.furnitureTexture, Game1.GlobalToLocal(Game1.viewport, drawPosition + ((__instance.shakeTimer > 0) ? new Vector2(Game1.random.Next(-1, 2), Game1.random.Next(-1, 2)) : Vector2.Zero)) + new Vector2(third * (bedWidth - 1) * 4, 0), new Rectangle?(drawn_third), Color.White * sheetAlpha, 0f, Vector2.Zero, 4f, __instance.Flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, (__instance.boundingBox.Value.Bottom - 1) / 10000f); spriteBatch.Draw(Furniture.furnitureTexture, Game1.GlobalToLocal(Game1.viewport, drawPosition + ((__instance.shakeTimer > 0) ? new Vector2(Game1.random.Next(-1, 2), Game1.random.Next(-1, 2)) : Vector2.Zero)) + new Vector2(0, solidHeight * 4) + new Vector2(third * (bedWidth - 1) * 4, 0), new Rectangle?(drawn_third_t), Color.White, 0f, Vector2.Zero, 4f, __instance.Flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, (__instance.boundingBox.Value.Bottom - 1) / 10000f); return(false); }
protected override void WriteDelta(BinaryWriter writer) { texture = new NetTexture2DExtended(Value.getExtendedTexture()); texture.Write(writer); which = new NetInt(Value.ParentSheetIndex); which.Write(writer); tilePos = new NetVector2(Value.TileLocation); tilePos.Write(writer); InventoryMaxSize = new NetInt(Value.inventoryMaxSize); InventoryMaxSize.Write(writer); sourceRect = new NetRectangle(Value.sourceRect); sourceRect.Write(writer); boundingBox = new NetRectangle(Value.boundingBox.Value); sourceRect.Write(writer); drawPosition = new NetVector2(Value.drawPosition); drawPosition.Write(writer); locationName = new NetString(Value.locationsName); locationName.Write(writer); /* * if (Value.animationManager == null) * { * throw new Exception("WTF, why is the animation manager null???????????"); * } * animationManager = new NetAnimationManager(Value.animationManager); * animationManager.Write(writer); */ }
protected override void ReadDelta(BinaryReader reader, NetVersion version) { texture = new NetTexture2DExtended(); texture.Read(reader, version); Value.setExtendedTexture(texture.Value); which = new NetInt(); which.Read(reader, version); Value.ParentSheetIndex = which.Value; tilePos = new NetVector2(); tilePos.Read(reader, version); Value.TileLocation = tilePos.Value; InventoryMaxSize = new NetInt(); InventoryMaxSize.Read(reader, version); Value.inventoryMaxSize = InventoryMaxSize.Value; sourceRect = new NetRectangle(); sourceRect.Read(reader, version); Value.sourceRect = sourceRect.Value; boundingBox = new NetRectangle(); boundingBox.Read(reader, version); Value.boundingBox.Value = boundingBox.Value; drawPosition = new NetVector2(); drawPosition.Read(reader, version); Value.drawPosition = drawPosition.Value; locationName = new NetString(); locationName.Read(reader, version); Value.locationsName = locationName.Value; Value.thisLocation = Game1.getLocationFromName(locationName.Value); /* * animationManager = new NetAnimationManager(); * animationManager.Read(reader, version); * Value.animationManager = animationManager.Value; */ }
private static bool DrawPrefix(BedFurniture __instance, NetVector2 ___drawPosition, SpriteBatch spriteBatch, int x, int y, float alpha = 1f) { if (__instance.modData.ContainsKey("AlternativeTextureName")) { var textureModel = AlternativeTextures.textureManager.GetSpecificTextureModel(__instance.modData["AlternativeTextureName"]); if (textureModel is null) { return(true); } var textureVariation = Int32.Parse(__instance.modData["AlternativeTextureVariation"]); if (textureVariation == -1 || AlternativeTextures.modConfig.IsTextureVariationDisabled(textureModel.GetId(), textureVariation)) { return(true); } var textureOffset = textureModel.GetTextureOffset(textureVariation); if (!__instance.isTemporarilyInvisible) { if (Furniture.isDrawingLocationFurniture) { Rectangle sourceRect = __instance.sourceRect.Value; sourceRect.X -= __instance.defaultSourceRect.X; sourceRect.Y = textureOffset; spriteBatch.Draw(textureModel.GetTexture(textureVariation), Game1.GlobalToLocal(Game1.viewport, ___drawPosition + ((__instance.shakeTimer > 0) ? new Vector2(Game1.random.Next(-1, 2), Game1.random.Next(-1, 2)) : Vector2.Zero)), sourceRect, Color.White * alpha, 0f, Vector2.Zero, 4f, __instance.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, (float)(__instance.boundingBox.Value.Top + 1) / 10000f); sourceRect.X += sourceRect.Width; spriteBatch.Draw(textureModel.GetTexture(textureVariation), Game1.GlobalToLocal(Game1.viewport, ___drawPosition + ((__instance.shakeTimer > 0) ? new Vector2(Game1.random.Next(-1, 2), Game1.random.Next(-1, 2)) : Vector2.Zero)), sourceRect, Color.White * alpha, 0f, Vector2.Zero, 4f, __instance.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, (float)(__instance.boundingBox.Value.Bottom - 1) / 10000f); } else { __instance.draw(spriteBatch, x, y, alpha); } } return(false); } return(true); }
private static void monsterDrop_prefix(MineShaft __instance, NetVector2 ___netTileBeneathLadder) { if (__instance.mustKillAllMonstersToAdvance()) { int monsters = 0; foreach (Character c in __instance.characters) { if (c is Monster && (c as Monster).health > 0) { monsters++; } } if (monsters <= 1) { Vector2 p = new Vector2((float)((int)___netTileBeneathLadder.X), (float)((int)___netTileBeneathLadder.Y)); __instance.createLadderAt(p, "newArtifact"); if (Game1.player.currentLocation == __instance) { Game1.showGlobalMessage(Game1.content.LoadString("Strings\\StringsFromCSFiles:MineShaft.cs.9484")); } } } }
private static bool DrawPrefix(FishTankFurniture __instance, NetInt ___sourceIndexOffset, NetVector2 ___drawPosition, SpriteBatch spriteBatch, int x, int y, float alpha = 1f) { if (__instance.modData.ContainsKey("AlternativeTextureName")) { var textureModel = AlternativeTextures.textureManager.GetSpecificTextureModel(__instance.modData["AlternativeTextureName"]); if (textureModel is null) { return(true); } var textureVariation = Int32.Parse(__instance.modData["AlternativeTextureVariation"]); if (textureVariation == -1 || AlternativeTextures.modConfig.IsTextureVariationDisabled(textureModel.GetId(), textureVariation)) { return(true); } var textureOffset = textureModel.GetTextureOffset(textureVariation); Vector2 shake = Vector2.Zero; if (!__instance.isTemporarilyInvisible) { Vector2 draw_position = ___drawPosition.Value; if (!Furniture.isDrawingLocationFurniture) { draw_position = new Vector2(x, y) * 64f; draw_position.Y -= __instance.sourceRect.Height * 4 - __instance.boundingBox.Height; } if (__instance.shakeTimer > 0) { shake = new Vector2(Game1.random.Next(-1, 2), Game1.random.Next(-1, 2)); } Rectangle sourceRect = new Rectangle(__instance.sourceRect.Value.Width, __instance.sourceRect.Value.Y, __instance.sourceRect.Value.Width, __instance.sourceRect.Value.Height); sourceRect.Y = textureOffset; spriteBatch.Draw(textureModel.GetTexture(textureVariation), Game1.GlobalToLocal(Game1.viewport, draw_position + shake), sourceRect, Color.White * alpha, 0f, Vector2.Zero, 4f, __instance.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, __instance.GetGlassDrawLayer()); if (Furniture.isDrawingLocationFurniture) { int hatsDrawn = 0; for (int i = 0; i < __instance.tankFish.Count; i++) { TankFish fish = __instance.tankFish[i]; float fish_layer = Utility.Lerp(__instance.GetFishSortRegion().Y, __instance.GetFishSortRegion().X, fish.zPosition / 20f); fish_layer += 1E-07f * (float)i; fish.Draw(spriteBatch, alpha, fish_layer); if (fish.fishIndex != 86) { continue; } int hatsSoFar = 0; foreach (Item h in __instance.heldItems) { if (h is Hat) { if (hatsSoFar == hatsDrawn) { h.drawInMenu(spriteBatch, Game1.GlobalToLocal(fish.GetWorldPosition() + new Vector2(-30 + (fish.facingLeft ? (-4) : 0), -55f)), 0.75f, 1f, fish_layer + 1E-08f, StackDrawType.Hide); hatsDrawn++; break; } hatsSoFar++; } } } for (int j = 0; j < __instance.floorDecorations.Count; j++) { if (__instance.floorDecorations[j].HasValue) { KeyValuePair <Rectangle, Vector2> decoration = __instance.floorDecorations[j].Value; Vector2 decoration_position = decoration.Value; Rectangle decoration_source_rect = decoration.Key; float decoration_layer = Utility.Lerp(__instance.GetFishSortRegion().Y, __instance.GetFishSortRegion().X, decoration_position.Y / 20f) - 1E-06f; spriteBatch.Draw(__instance.GetAquariumTexture(), Game1.GlobalToLocal(new Vector2((float)__instance.GetTankBounds().Left + decoration_position.X * 4f, (float)(__instance.GetTankBounds().Bottom - 4) - decoration_position.Y * 4f)), decoration_source_rect, Color.White * alpha, 0f, new Vector2(decoration_source_rect.Width / 2, decoration_source_rect.Height - 4), 4f, SpriteEffects.None, decoration_layer); } } foreach (Vector4 bubble in __instance.bubbles) { float layer = Utility.Lerp(__instance.GetFishSortRegion().Y, __instance.GetFishSortRegion().X, bubble.Z / 20f) - 1E-06f; spriteBatch.Draw(__instance.GetAquariumTexture(), Game1.GlobalToLocal(new Vector2((float)__instance.GetTankBounds().Left + bubble.X, (float)(__instance.GetTankBounds().Bottom - 4) - bubble.Y - bubble.Z * 4f)), new Rectangle(0, 240, 16, 16), Color.White * alpha, 0f, new Vector2(8f, 8f), 4f * bubble.W, SpriteEffects.None, layer); } } FurniturePatch.DrawPrefix(__instance, ___sourceIndexOffset, ___drawPosition, spriteBatch, x, y, alpha); } return(false); } return(true); }
public static bool BedFurniture_draw_Prefix(BedFurniture __instance, SpriteBatch spriteBatch, int x, int y, float alpha, NetVector2 ___drawPosition) { if (!Config.EnableMod || !Config.CustomBed || __instance.isTemporarilyInvisible || __instance.bedType != BedFurniture.BedType.Double) { return(true); } Vector2 drawPosition = Furniture.isDrawingLocationFurniture ? ___drawPosition : new Vector2(x * 64, y * 64 - (__instance.sourceRect.Height * 4 - __instance.boundingBox.Height)); int bedWidth = Misc.GetBedWidth(Utility.getHomeOfFarmer(Game1.getFarmer(__instance.owner))); __instance.boundingBox.Width = (bedWidth + 1) * 64; Rectangle drawn_rect = __instance.sourceRect.Value; int third = drawn_rect.Width / 3; Rectangle drawn_first = new Rectangle(drawn_rect.X, drawn_rect.Y, third, drawn_rect.Height); Rectangle drawn_second = new Rectangle(drawn_rect.X + third, drawn_rect.Y, third, drawn_rect.Height); Rectangle drawn_third = new Rectangle(drawn_rect.X + third + third, drawn_rect.Y, third, drawn_rect.Height); spriteBatch.Draw(Furniture.furnitureTexture, Game1.GlobalToLocal(Game1.viewport, drawPosition + ((__instance.shakeTimer > 0) ? new Vector2(Game1.random.Next(-1, 2), Game1.random.Next(-1, 2)) : Vector2.Zero)), new Rectangle?(drawn_first), Color.White * alpha, 0f, Vector2.Zero, 4f, __instance.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, (__instance.boundingBox.Value.Top + 1) / 10000f); for (int i = 1; i < bedWidth; i++) { spriteBatch.Draw(Furniture.furnitureTexture, Game1.GlobalToLocal(Game1.viewport, drawPosition + ((__instance.shakeTimer > 0) ? new Vector2(Game1.random.Next(-1, 2), Game1.random.Next(-1, 2)) : Vector2.Zero)) + new Vector2(third * i * 4, 0), new Rectangle?(drawn_second), Color.White * alpha, 0f, Vector2.Zero, 4f, __instance.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, (__instance.boundingBox.Value.Top + 1) / 10000f); } spriteBatch.Draw(Furniture.furnitureTexture, Game1.GlobalToLocal(Game1.viewport, drawPosition + ((__instance.shakeTimer > 0) ? new Vector2(Game1.random.Next(-1, 2), Game1.random.Next(-1, 2)) : Vector2.Zero)) + new Vector2(third * (bedWidth) * 4, 0), new Rectangle?(drawn_third), Color.White * alpha, 0f, Vector2.Zero, 4f, __instance.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, (__instance.boundingBox.Value.Top + 1) / 10000f); drawn_rect.X += drawn_rect.Width; drawn_first = new Rectangle(drawn_rect.X, drawn_rect.Y, third, drawn_rect.Height); drawn_second = new Rectangle(drawn_rect.X + third, drawn_rect.Y, third, drawn_rect.Height); drawn_third = new Rectangle(drawn_rect.X + third + third, drawn_rect.Y, third, drawn_rect.Height); int solidHeight = 41; Rectangle drawn_first_t = new Rectangle(drawn_rect.X, drawn_rect.Y + solidHeight, third, drawn_rect.Height - solidHeight); Rectangle drawn_second_t = new Rectangle(drawn_rect.X + third, drawn_rect.Y + solidHeight, third, drawn_rect.Height - solidHeight); Rectangle drawn_third_t = new Rectangle(drawn_rect.X + third * 2, drawn_rect.Y + solidHeight, third, drawn_rect.Height - solidHeight); if (Config.TransparentSheets) { alpha = Config.SheetTransparency; } spriteBatch.Draw(Furniture.furnitureTexture, Game1.GlobalToLocal(Game1.viewport, drawPosition + ((__instance.shakeTimer > 0) ? new Vector2(Game1.random.Next(-1, 2), Game1.random.Next(-1, 2)) : Vector2.Zero)), new Rectangle?(drawn_first), Color.White * alpha, 0f, Vector2.Zero, 4f, __instance.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, (__instance.boundingBox.Value.Bottom - 1) / 10000f); if (Config.TransparentSheets) { spriteBatch.Draw(Furniture.furnitureTexture, Game1.GlobalToLocal(Game1.viewport, drawPosition + ((__instance.shakeTimer > 0) ? new Vector2(Game1.random.Next(-1, 2), Game1.random.Next(-1, 2)) : Vector2.Zero)) + new Vector2(0, solidHeight * 4), new Rectangle?(drawn_first_t), Color.White, 0f, Vector2.Zero, 4f, __instance.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, (__instance.boundingBox.Value.Bottom - 2) / 10000f); } for (int i = 1; i < bedWidth; i++) { spriteBatch.Draw(Furniture.furnitureTexture, Game1.GlobalToLocal(Game1.viewport, drawPosition + ((__instance.shakeTimer > 0) ? new Vector2(Game1.random.Next(-1, 2), Game1.random.Next(-1, 2)) : Vector2.Zero)) + new Vector2(third * i * 4, 0), new Rectangle?(drawn_second), Color.White * alpha, 0f, Vector2.Zero, 4f, __instance.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, (__instance.boundingBox.Value.Bottom - 1) / 10000f); if (Config.TransparentSheets) { spriteBatch.Draw(Furniture.furnitureTexture, Game1.GlobalToLocal(Game1.viewport, drawPosition + ((__instance.shakeTimer > 0) ? new Vector2(Game1.random.Next(-1, 2), Game1.random.Next(-1, 2)) : Vector2.Zero)) + new Vector2(0, solidHeight * 4) + new Vector2(third * i * 4, 0), new Rectangle?(drawn_second_t), Color.White, 0f, Vector2.Zero, 4f, __instance.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, (__instance.boundingBox.Value.Bottom - 1) / 10000f); } } spriteBatch.Draw(Furniture.furnitureTexture, Game1.GlobalToLocal(Game1.viewport, drawPosition + ((__instance.shakeTimer > 0) ? new Vector2(Game1.random.Next(-1, 2), Game1.random.Next(-1, 2)) : Vector2.Zero)) + new Vector2(third * (bedWidth) * 4, 0), new Rectangle?(drawn_third), Color.White * alpha, 0f, Vector2.Zero, 4f, __instance.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, (__instance.boundingBox.Value.Bottom - 1) / 10000f); if (Config.TransparentSheets) { spriteBatch.Draw(Furniture.furnitureTexture, Game1.GlobalToLocal(Game1.viewport, drawPosition + ((__instance.shakeTimer > 0) ? new Vector2(Game1.random.Next(-1, 2), Game1.random.Next(-1, 2)) : Vector2.Zero)) + new Vector2(0, solidHeight * 4) + new Vector2(third * (bedWidth) * 4, 0), new Rectangle?(drawn_third_t), Color.White, 0f, Vector2.Zero, 4f, __instance.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, (__instance.boundingBox.Value.Bottom - 1) / 10000f); } return(false); }
public static bool Prefix(Furniture __instance, SpriteBatch spriteBatch, int x, int y, float alpha, NetVector2 ___drawPosition) { if (!Config.EnableMod || !__instance.modData.ContainsKey(trampolineKey)) { return(true); } Rectangle drawn_source_rect = new Rectangle(0, 0, 32, 48); bool touching = IsOnTrampoline() && __instance == Game1.player.sittingFurniture && Game1.player.yOffset < 12; if (touching) { drawn_source_rect.X += 32; } Rectangle cutoffRect1 = new Rectangle(32, 0, 32, 30); Rectangle cutoffRect2 = new Rectangle(32, 30, 32, 18); if (Furniture.isDrawingLocationFurniture) { if (touching) { spriteBatch.Draw(trampolineTexture, Game1.GlobalToLocal(Game1.viewport, ___drawPosition.Value + ((__instance.shakeTimer > 0) ? new Vector2((float)Game1.random.Next(-1, 2), (float)Game1.random.Next(-1, 2)) : Vector2.Zero)), new Rectangle?(cutoffRect1), Color.White * alpha, 0f, Vector2.Zero, 4f, __instance.Flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 2E-09f + __instance.TileLocation.Y / 100000f); spriteBatch.Draw(trampolineTexture, Game1.GlobalToLocal(Game1.viewport, ___drawPosition.Value + ((__instance.shakeTimer > 0) ? new Vector2((float)Game1.random.Next(-1, 2), (float)Game1.random.Next(-1, 2)) : Vector2.Zero)) + new Vector2(0, 120), new Rectangle?(cutoffRect2), Color.White * alpha, 0f, Vector2.Zero, 4f, __instance.Flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, ((float)(__instance.boundingBox.Value.Bottom - 48) / 10000f)); } else { spriteBatch.Draw(trampolineTexture, Game1.GlobalToLocal(Game1.viewport, ___drawPosition.Value + ((__instance.shakeTimer > 0) ? new Vector2((float)Game1.random.Next(-1, 2), (float)Game1.random.Next(-1, 2)) : Vector2.Zero)), new Rectangle?(drawn_source_rect), Color.White * alpha, 0f, Vector2.Zero, 4f, __instance.Flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 2E-09f + __instance.TileLocation.Y / 100000f); } } else { spriteBatch.Draw(trampolineTexture, Game1.GlobalToLocal(Game1.viewport, new Vector2((float)(x * 64 + ((__instance.shakeTimer > 0) ? Game1.random.Next(-1, 2) : 0)), (float)(y * 64 - (__instance.sourceRect.Height * 4 - __instance.boundingBox.Height) + ((__instance.shakeTimer > 0) ? Game1.random.Next(-1, 2) : 0)))), new Rectangle?(drawn_source_rect), Color.White * alpha, 0f, Vector2.Zero, 4f, __instance.Flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 2E-09f + __instance.TileLocation.Y / 100000f); } return(false); }
private static bool FurnitureDrawPrefix(Furniture __instance, NetVector2 ___drawPosition, SpriteBatch spriteBatch, int x, int y, float alpha = 1f) { if (__instance.heldObject.Value is not { ParentSheetIndex : Globals.MEAD_INDEX_I, preservedParentSheetIndex.Value : > 0 } mead) { return(true); // run original logic } var parameters = new object?[] { __instance, null, null, null }; var got = (bool)_GetDrawInfo.Invoke(null, parameters) !; if (!got) { return(true); // run original logic } var spritesheet = (Texture2D)parameters[1] !; var sourceRectangle = (Rectangle)parameters[2] !; // draw the furniture if (x == -1) { spriteBatch.Draw( texture: Furniture.furnitureTexture, position: Game1.GlobalToLocal(Game1.viewport, ___drawPosition), sourceRectangle: __instance.sourceRect.Value, color: Color.White * alpha, rotation: 0f, origin: Vector2.Zero, scale: 4f, effects: __instance.Flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, layerDepth: __instance.furniture_type.Value == 12 ? 0f : (__instance.boundingBox.Bottom - 8) / 10000f ); } else { spriteBatch.Draw( texture: Furniture.furnitureTexture, position: Game1.GlobalToLocal(Game1.viewport, globalPosition: new Vector2( x: x * 64, y: y * 64 - (__instance.sourceRect.Height * 4 - __instance.boundingBox.Height))), sourceRectangle: __instance.sourceRect.Value, color: Color.White * alpha, rotation: 0f, origin: Vector2.Zero, scale: 4f, effects: __instance.Flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, layerDepth: __instance.furniture_type.Value == 12 ? 0f : (__instance.boundingBox.Bottom - 8) / 10000f ); } // draw shadow spriteBatch.Draw( texture: Game1.shadowTexture, position: Game1.GlobalToLocal(Game1.viewport, globalPosition: new Vector2( x: __instance.boundingBox.Value.Center.X - 32, y: __instance.boundingBox.Value.Center.Y - (__instance.drawHeldObjectLow.Value ? 32 : 85))) + new Vector2(32f, 53.3333321f), sourceRectangle: Game1.shadowTexture.Bounds, color: Color.White * alpha, rotation: 0f, origin: new(Game1.shadowTexture.Bounds.Center.X, Game1.shadowTexture.Bounds.Center.Y), scale: 4f, effects: SpriteEffects.None, __instance.boundingBox.Value.Bottom / 10000f ); // draw the held item spriteBatch.Draw( texture: spritesheet, position: Game1.GlobalToLocal(Game1.viewport, globalPosition: new Vector2( x: __instance.boundingBox.Value.Center.X - 32, y: __instance.boundingBox.Value.Center.Y - (__instance.drawHeldObjectLow.Value ? 32 : 85))), sourceRectangle: sourceRectangle, color: Color.White * alpha, rotation: 0f, origin: Vector2.Zero, scale: 4f, effects: SpriteEffects.None, layerDepth: (__instance.boundingBox.Value.Bottom + 1) / 10000f ); return(false); // run original logic }
internal static bool DrawPrefix(Furniture __instance, NetInt ___sourceIndexOffset, NetVector2 ___drawPosition, SpriteBatch spriteBatch, int x, int y, float alpha = 1f) { if (__instance.modData.ContainsKey("AlternativeTextureName")) { var textureModel = AlternativeTextures.textureManager.GetSpecificTextureModel(__instance.modData["AlternativeTextureName"]); if (textureModel is null) { return(true); } var textureVariation = Int32.Parse(__instance.modData["AlternativeTextureVariation"]); if (textureVariation == -1 || AlternativeTextures.modConfig.IsTextureVariationDisabled(textureModel.GetId(), textureVariation)) { return(true); } var textureOffset = textureModel.GetTextureOffset(textureVariation); // Replicate the base draw if (__instance.isTemporarilyInvisible) { return(true); } // Set xTileOffset if AlternativeTextureModel has an animation var xTileOffset = 0; if (textureModel.HasAnimation(textureVariation)) { if (!__instance.modData.ContainsKey("AlternativeTextureCurrentFrame") || !__instance.modData.ContainsKey("AlternativeTextureFrameDuration") || !__instance.modData.ContainsKey("AlternativeTextureElapsedDuration")) { __instance.modData["AlternativeTextureCurrentFrame"] = "0"; __instance.modData["AlternativeTextureFrameDuration"] = textureModel.GetAnimationDataAtIndex(textureVariation, 0).Duration.ToString();// Animation.ElementAt(0).Duration.ToString(); __instance.modData["AlternativeTextureElapsedDuration"] = "0"; } var currentFrame = Int32.Parse(__instance.modData["AlternativeTextureCurrentFrame"]); var frameDuration = Int32.Parse(__instance.modData["AlternativeTextureFrameDuration"]); var elapsedDuration = Int32.Parse(__instance.modData["AlternativeTextureElapsedDuration"]); if (elapsedDuration >= frameDuration) { currentFrame = currentFrame + 1 >= textureModel.GetAnimationData(textureVariation).Count() ? 0 : currentFrame + 1; __instance.modData["AlternativeTextureCurrentFrame"] = currentFrame.ToString(); __instance.modData["AlternativeTextureFrameDuration"] = textureModel.GetAnimationDataAtIndex(textureVariation, currentFrame).Duration.ToString(); __instance.modData["AlternativeTextureElapsedDuration"] = "0"; } else { __instance.modData["AlternativeTextureElapsedDuration"] = (elapsedDuration + Game1.currentGameTime.ElapsedGameTime.Milliseconds).ToString(); } xTileOffset = currentFrame; } Rectangle sourceRect = __instance.sourceRect.Value; sourceRect.X -= __instance.defaultSourceRect.X; sourceRect.X += (___sourceIndexOffset * sourceRect.Width) + (xTileOffset * sourceRect.Width); sourceRect.Y = textureOffset; if (Furniture.isDrawingLocationFurniture) { if (__instance.HasSittingFarmers() && __instance.sourceRect.Right <= Furniture.furnitureFrontTexture.Width && __instance.sourceRect.Bottom <= Furniture.furnitureFrontTexture.Height) { spriteBatch.Draw(textureModel.GetTexture(textureVariation), Game1.GlobalToLocal(Game1.viewport, ___drawPosition + ((__instance.shakeTimer > 0) ? new Vector2(Game1.random.Next(-1, 2), Game1.random.Next(-1, 2)) : Vector2.Zero)), sourceRect, Color.White * alpha, 0f, Vector2.Zero, 4f, __instance.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, (float)(__instance.boundingBox.Value.Top + 16) / 10000f); var rotationSourceRect = sourceRect; rotationSourceRect.Y += textureModel.TextureHeight / 2; spriteBatch.Draw(textureModel.GetTexture(textureVariation), Game1.GlobalToLocal(Game1.viewport, ___drawPosition + ((__instance.shakeTimer > 0) ? new Vector2(Game1.random.Next(-1, 2), Game1.random.Next(-1, 2)) : Vector2.Zero)), rotationSourceRect, Color.White * alpha, 0f, Vector2.Zero, 4f, __instance.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, (float)(__instance.boundingBox.Value.Bottom - 8) / 10000f); } else { spriteBatch.Draw(textureModel.GetTexture(textureVariation), Game1.GlobalToLocal(Game1.viewport, ___drawPosition + ((__instance.shakeTimer > 0) ? new Vector2(Game1.random.Next(-1, 2), Game1.random.Next(-1, 2)) : Vector2.Zero)), sourceRect, Color.White * alpha, 0f, Vector2.Zero, 4f, __instance.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, ((int)__instance.furniture_type == 12) ? (2E-09f + __instance.tileLocation.Y / 100000f) : ((float)(__instance.boundingBox.Value.Bottom - (((int)__instance.furniture_type == 6 || (int)__instance.furniture_type == 17 || (int)__instance.furniture_type == 13) ? 48 : 8)) / 10000f)); } } else { spriteBatch.Draw(textureModel.GetTexture(textureVariation), Game1.GlobalToLocal(Game1.viewport, new Vector2(x * 64 + ((__instance.shakeTimer > 0) ? Game1.random.Next(-1, 2) : 0), y * 64 - (__instance.sourceRect.Height * 4 - __instance.boundingBox.Height) + ((__instance.shakeTimer > 0) ? Game1.random.Next(-1, 2) : 0))), __instance.sourceRect, Color.White * alpha, 0f, Vector2.Zero, 4f, __instance.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, ((int)__instance.furniture_type == 12) ? (2E-09f + __instance.tileLocation.Y / 100000f) : ((float)(__instance.boundingBox.Value.Bottom - (((int)__instance.furniture_type == 6 || (int)__instance.furniture_type == 17 || (int)__instance.furniture_type == 13) ? 48 : 8)) / 10000f)); } if (__instance.heldObject.Value != null) { if (__instance.heldObject.Value is Furniture) { (__instance.heldObject.Value as Furniture).drawAtNonTileSpot(spriteBatch, Game1.GlobalToLocal(Game1.viewport, new Vector2(__instance.boundingBox.Center.X - 32, __instance.boundingBox.Center.Y - (__instance.heldObject.Value as Furniture).sourceRect.Height * 4 - (__instance.drawHeldObjectLow ? (-16) : 16))), (float)(__instance.boundingBox.Bottom - 7) / 10000f, alpha); } else if (HeldObjectDraw(__instance.heldObject, spriteBatch, Game1.GlobalToLocal(Game1.viewport, new Vector2(__instance.boundingBox.Center.X - 32, __instance.boundingBox.Center.Y - (__instance.drawHeldObjectLow ? 32 : 85))), (float)(__instance.boundingBox.Bottom + 1) / 10000f, alpha)) { spriteBatch.Draw(Game1.shadowTexture, Game1.GlobalToLocal(Game1.viewport, new Vector2(__instance.boundingBox.Center.X - 32, __instance.boundingBox.Center.Y - (__instance.drawHeldObjectLow ? 32 : 85))) + new Vector2(32f, 53f), Game1.shadowTexture.Bounds, Color.White * alpha, 0f, new Vector2(Game1.shadowTexture.Bounds.Center.X, Game1.shadowTexture.Bounds.Center.Y), 4f, SpriteEffects.None, (float)__instance.boundingBox.Bottom / 10000f); spriteBatch.Draw(Game1.objectSpriteSheet, Game1.GlobalToLocal(Game1.viewport, new Vector2(__instance.boundingBox.Center.X - 32, __instance.boundingBox.Center.Y - (__instance.drawHeldObjectLow ? 32 : 85))), GameLocation.getSourceRectForObject(__instance.heldObject.Value.ParentSheetIndex), Color.White * alpha, 0f, Vector2.Zero, 4f, SpriteEffects.None, (float)(__instance.boundingBox.Bottom + 1) / 10000f); } } if ((bool)__instance.isOn && (int)__instance.furniture_type == 14) { spriteBatch.Draw(Game1.mouseCursors, Game1.GlobalToLocal(Game1.viewport, new Vector2(__instance.boundingBox.Center.X - 12, __instance.boundingBox.Center.Y - 64)), new Rectangle(276 + (int)((Game1.currentGameTime.TotalGameTime.TotalMilliseconds + (double)(x * 3047) + (double)(y * 88)) % 400.0 / 100.0) * 12, 1985, 12, 11), Color.White, 0f, Vector2.Zero, 4f, SpriteEffects.None, (float)(__instance.getBoundingBox(new Vector2(x, y)).Bottom - 2) / 10000f); spriteBatch.Draw(Game1.mouseCursors, Game1.GlobalToLocal(Game1.viewport, new Vector2(__instance.boundingBox.Center.X - 32 - 4, __instance.boundingBox.Center.Y - 64)), new Rectangle(276 + (int)((Game1.currentGameTime.TotalGameTime.TotalMilliseconds + (double)(x * 2047) + (double)(y * 98)) % 400.0 / 100.0) * 12, 1985, 12, 11), Color.White, 0f, Vector2.Zero, 4f, SpriteEffects.None, (float)(__instance.getBoundingBox(new Vector2(x, y)).Bottom - 1) / 10000f); } else if ((bool)__instance.isOn && (int)__instance.furniture_type == 16) { spriteBatch.Draw(Game1.mouseCursors, Game1.GlobalToLocal(Game1.viewport, new Vector2(__instance.boundingBox.Center.X - 20, (float)__instance.boundingBox.Center.Y - 105.6f)), new Rectangle(276 + (int)((Game1.currentGameTime.TotalGameTime.TotalMilliseconds + (double)(x * 3047) + (double)(y * 88)) % 400.0 / 100.0) * 12, 1985, 12, 11), Color.White, 0f, Vector2.Zero, 4f, SpriteEffects.None, (float)(__instance.getBoundingBox(new Vector2(x, y)).Bottom - 2) / 10000f); } return(false); } return(true); }
public static bool draw_Prefix(ref Furniture __instance, NetInt ___sourceIndexOffset, NetVector2 ___drawPosition, SpriteBatch spriteBatch, int x, int y, float alpha = 1f) { if (__instance.isTemporarilyInvisible) { return(false); } Rectangle drawn_source_rect = __instance.sourceRect.Value; drawn_source_rect.X += drawn_source_rect.Width * ___sourceIndexOffset.Value; if (Furniture.isDrawingLocationFurniture) { if (__instance.HasSittingFarmers() && __instance.sourceRect.Right <= Furniture.furnitureFrontTexture.Width && __instance.sourceRect.Bottom <= Furniture.furnitureFrontTexture.Height) { spriteBatch.Draw(Furniture.furnitureTexture, Game1.GlobalToLocal(Game1.viewport, ___drawPosition + ((__instance.shakeTimer > 0) ? new Vector2(Game1.random.Next(-1, 2), Game1.random.Next(-1, 2)) : Vector2.Zero)), drawn_source_rect, Color.White * alpha, 0f, Vector2.Zero, 4f, __instance.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, (float)(__instance.boundingBox.Value.Top + 16) / 10000f); spriteBatch.Draw(Furniture.furnitureFrontTexture, Game1.GlobalToLocal(Game1.viewport, ___drawPosition + ((__instance.shakeTimer > 0) ? new Vector2(Game1.random.Next(-1, 2), Game1.random.Next(-1, 2)) : Vector2.Zero)), drawn_source_rect, Color.White * alpha, 0f, Vector2.Zero, 4f, __instance.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, (float)(__instance.boundingBox.Value.Bottom - 8) / 10000f); } else { spriteBatch.Draw(Furniture.furnitureTexture, Game1.GlobalToLocal(Game1.viewport, ___drawPosition + ((__instance.shakeTimer > 0) ? new Vector2(Game1.random.Next(-1, 2), Game1.random.Next(-1, 2)) : Vector2.Zero)), drawn_source_rect, Color.White * alpha, 0f, Vector2.Zero, 4f, __instance.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, ((int)__instance.furniture_type == 12) ? (2E-09f + __instance.tileLocation.Y / 100000f) : ((float)(__instance.boundingBox.Value.Bottom - (((int)__instance.furniture_type == 6 || (int)__instance.furniture_type == 17 || (int)__instance.furniture_type == 13) ? 48 : 8)) / 10000f)); } } else { spriteBatch.Draw(Furniture.furnitureTexture, Game1.GlobalToLocal(Game1.viewport, new Vector2(x * 64 + ((__instance.shakeTimer > 0) ? Game1.random.Next(-1, 2) : 0), y * 64 - (__instance.sourceRect.Height * 4 - __instance.boundingBox.Height) + ((__instance.shakeTimer > 0) ? Game1.random.Next(-1, 2) : 0))), __instance.sourceRect, Color.White * alpha, 0f, Vector2.Zero, 4f, __instance.flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, ((int)__instance.furniture_type == 12) ? (2E-09f + __instance.tileLocation.Y / 100000f) : ((float)(__instance.boundingBox.Value.Bottom - (((int)__instance.furniture_type == 6 || (int)__instance.furniture_type == 17 || (int)__instance.furniture_type == 13) ? 48 : 8)) / 10000f)); } if (__instance.heldObject.Value != null) { if (__instance.heldObject.Value is Furniture) { (__instance.heldObject.Value as Furniture).drawAtNonTileSpot(spriteBatch, Game1.GlobalToLocal(Game1.viewport, new Vector2(__instance.boundingBox.Center.X - 32, __instance.boundingBox.Center.Y - (__instance.heldObject.Value as Furniture).sourceRect.Height * 4 - (__instance.drawHeldObjectLow ? (-16) : 16))), (float)(__instance.boundingBox.Bottom - 7) / 10000f, alpha); } else { spriteBatch.Draw(Game1.shadowTexture, Game1.GlobalToLocal(Game1.viewport, new Vector2(__instance.boundingBox.Center.X - 32, __instance.boundingBox.Center.Y - (__instance.drawHeldObjectLow ? 32 : 85))) + new Vector2(32f, 53f), Game1.shadowTexture.Bounds, Color.White * alpha, 0f, new Vector2(Game1.shadowTexture.Bounds.Center.X, Game1.shadowTexture.Bounds.Center.Y), 4f, SpriteEffects.None, (float)__instance.boundingBox.Bottom / 10000f); // Add support for rendering weapons on tables. if (__instance.heldObject.Value is WeaponProxy weapon) { spriteBatch.Draw(Tool.weaponsTexture, Game1.GlobalToLocal(Game1.viewport, new Vector2(__instance.boundingBox.Center.X - 32, __instance.boundingBox.Center.Y - (__instance.drawHeldObjectLow ? 32 : 85))), MeleeWeapon.getSourceRect(weapon.Weapon.IndexOfMenuItemView), Color.White * alpha, 0f, Vector2.Zero, 4f, SpriteEffects.None, (float)(__instance.boundingBox.Bottom + 1) / 10000f); } else if (__instance.heldObject.Value is SlingshotProxy slingshot) { spriteBatch.Draw(Tool.weaponsTexture, Game1.GlobalToLocal(Game1.viewport, new Vector2(__instance.boundingBox.Center.X - 32, __instance.boundingBox.Center.Y - (__instance.drawHeldObjectLow ? 32 : 85))), MeleeWeapon.getSourceRect(slingshot.Weapon.IndexOfMenuItemView), Color.White * alpha, 0f, Vector2.Zero, 4f, SpriteEffects.None, (float)(__instance.boundingBox.Bottom + 1) / 10000f); } else { spriteBatch.Draw(Game1.objectSpriteSheet, Game1.GlobalToLocal(Game1.viewport, new Vector2(__instance.boundingBox.Center.X - 32, __instance.boundingBox.Center.Y - (__instance.drawHeldObjectLow ? 32 : 85))), GameLocation.getSourceRectForObject(__instance.heldObject.Value.ParentSheetIndex), Color.White * alpha, 0f, Vector2.Zero, 4f, SpriteEffects.None, (float)(__instance.boundingBox.Bottom + 1) / 10000f); } } } if ((bool)__instance.isOn && (int)__instance.furniture_type == 14) { spriteBatch.Draw(Game1.mouseCursors, Game1.GlobalToLocal(Game1.viewport, new Vector2(__instance.boundingBox.Center.X - 12, __instance.boundingBox.Center.Y - 64)), new Rectangle(276 + (int)((Game1.currentGameTime.TotalGameTime.TotalMilliseconds + (double)(x * 3047) + (double)(y * 88)) % 400.0 / 100.0) * 12, 1985, 12, 11), Color.White, 0f, Vector2.Zero, 4f, SpriteEffects.None, (float)(__instance.getBoundingBox(new Vector2(x, y)).Bottom - 2) / 10000f); spriteBatch.Draw(Game1.mouseCursors, Game1.GlobalToLocal(Game1.viewport, new Vector2(__instance.boundingBox.Center.X - 32 - 4, __instance.boundingBox.Center.Y - 64)), new Rectangle(276 + (int)((Game1.currentGameTime.TotalGameTime.TotalMilliseconds + (double)(x * 2047) + (double)(y * 98)) % 400.0 / 100.0) * 12, 1985, 12, 11), Color.White, 0f, Vector2.Zero, 4f, SpriteEffects.None, (float)(__instance.getBoundingBox(new Vector2(x, y)).Bottom - 1) / 10000f); } else if ((bool)__instance.isOn && (int)__instance.furniture_type == 16) { spriteBatch.Draw(Game1.mouseCursors, Game1.GlobalToLocal(Game1.viewport, new Vector2(__instance.boundingBox.Center.X - 20, (float)__instance.boundingBox.Center.Y - 105.6f)), new Rectangle(276 + (int)((Game1.currentGameTime.TotalGameTime.TotalMilliseconds + (double)(x * 3047) + (double)(y * 88)) % 400.0 / 100.0) * 12, 1985, 12, 11), Color.White, 0f, Vector2.Zero, 4f, SpriteEffects.None, (float)(__instance.getBoundingBox(new Vector2(x, y)).Bottom - 2) / 10000f); } if (Game1.debugMode) { spriteBatch.DrawString(Game1.smallFont, string.Concat((object)__instance.parentSheetIndex), Game1.GlobalToLocal(Game1.viewport, ___drawPosition), Color.Yellow, 0f, Vector2.Zero, 1f, SpriteEffects.None, 1f); } return(false); }
public static bool Prefix(Furniture __instance, SpriteBatch spriteBatch, int x, int y, float alpha, NetVector2 ___drawPosition) { if (!Config.EnableMod || __instance is not TV || (!__instance.Name.Contains("Plasma") && !__instance.Name.Contains("Tropical")) || !typeof(DecoratableLocation).IsAssignableFrom(Game1.currentLocation.GetType())) { return(true); } if (!(Game1.currentLocation as DecoratableLocation).isTileOnWall((int)__instance.TileLocation.X, (int)__instance.TileLocation.Y)) { return(true); } Rectangle source = new Rectangle(0, 0, 48, 48); if (Furniture.isDrawingLocationFurniture) { spriteBatch.Draw(__instance.Name.Contains("Plasma") ? plasmaTexture : tropicalTexture, Game1.GlobalToLocal(Game1.viewport, ___drawPosition + ((__instance.shakeTimer > 0) ? new Vector2((float)Game1.random.Next(-1, 2), (float)Game1.random.Next(-1, 2)) : Vector2.Zero)), source, Color.White * alpha, 0f, Vector2.Zero, 4f, __instance.Flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, (__instance.boundingBox.Value.Bottom - 8) / 10000f); } else { spriteBatch.Draw(__instance.Name.Contains("Plasma") ? plasmaTexture : tropicalTexture, Game1.GlobalToLocal(Game1.viewport, new Vector2((float)(x * 64 + ((__instance.shakeTimer > 0) ? Game1.random.Next(-1, 2) : 0)), (float)(y * 64 - (__instance.sourceRect.Height * 4 - __instance.boundingBox.Height) + ((__instance.shakeTimer > 0) ? Game1.random.Next(-1, 2) : 0)))), source, Color.White * alpha, 0f, Vector2.Zero, 4f, __instance.Flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None, (__instance.boundingBox.Value.Bottom - 8) / 10000f); } return(false); }