Skip to content

Commit

Permalink
Added Bookshelves to the FurnitureFinder and some misc changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirtle committed Jun 28, 2020
1 parent 65b4e31 commit d216f10
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Items/Accessories/CreativeWrench.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public override bool CanPlace(int i, int j, int type)

//Placement Anywhere
if (modPlayer.creativeWheelSelectedIndex.Contains((int)CreativeWheelItem.PlacementAnywhere) && !tile.active() &&
oldPosX != i && oldPosY != j)
oldPosX != i || oldPosY != j)
{
Item selectedItem = Main.LocalPlayer.inventory[Main.LocalPlayer.selectedItem];
WorldGen.PlaceTile(Player.tileTargetX, Player.tileTargetY, selectedItem.createTile, false, false, -1, selectedItem.placeStyle);
Expand Down
4 changes: 2 additions & 2 deletions UI/BasePanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,11 @@ public override void Update(GameTime gameTime)
if (element == elementsList[0])
text = "Middle Click to grab a block to your inventory";
if (element == elementsList[1])
text = "Allows infinite placements of any block/wall";
text = "Allows infinite placement of any block/wall";
if (element == elementsList[2])
text = "Select a slope and Left Mouse Click with an empty hand";
if (element == elementsList[3])
text = "Allows block placements in the middle of the air";
text = "Allows block placement in the middle of the air";

hoverText = new UIText(text, 1, false);
hoverText.VAlign = 0f;
Expand Down
4 changes: 0 additions & 4 deletions UI/TransparentSelection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ public override void Draw(SpriteBatch spriteBatch)
if ((MirrorWand.start.X != MirrorWand.end.X || MirrorWand.start.Y != MirrorWand.end.Y)
&& (MirrorWand.start != Vector2.Zero && MirrorWand.end != Vector2.Zero))
{
//TODO: MAKE THE SPRITEBATCH NOT DRAW OVER UI ELEMENTS
//layerDepth doesn't work as spriteBatch uses SpriteSortMode.Deferred which means last draw calls will draw over
//previous draw calls. Need to call this draw method before the UI for the player inventory/accessories is drawn

Texture2D texture = Main.extraTexture[2];
Rectangle value = new Rectangle(0, 0, 16, 16);
Color color = new Color(0.24f, 0.8f, 0.9f, 1f) * 0.8f;
Expand Down
105 changes: 105 additions & 0 deletions Utilities/FurnitureFinder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1580,6 +1580,111 @@ public static void FindFurniture(Tile tile, ref Item item)
break;
}
}
if (tile.type == TileID.Bookcases)
{
switch (tile.frameX / 70)
{
case 0:
item.SetDefaults(ItemID.Bookcase);
break;
case 1:
item.SetDefaults(ItemID.BlueDungeonBookcase);
break;
case 2:
item.SetDefaults(ItemID.GreenDungeonBookcase);
break;
case 3:
item.SetDefaults(ItemID.PinkDungeonBookcase);
break;
case 4:
item.SetDefaults(ItemID.ObsidianBookcase);
break;
case 5:
item.SetDefaults(ItemID.GothicBookcase);
break;
case 6:
item.SetDefaults(ItemID.CactusBookcase);
break;
case 7:
item.SetDefaults(ItemID.EbonwoodBookcase);
break;
case 8:
item.SetDefaults(ItemID.FleshBookcase);
break;
case 9:
item.SetDefaults(ItemID.HoneyBookcase);
break;
case 10:
item.SetDefaults(ItemID.SteampunkBookcase);
break;
case 11:
item.SetDefaults(ItemID.GlassBookcase);
break;
case 12:
item.SetDefaults(ItemID.RichMahoganyBookcase);
break;
case 13:
item.SetDefaults(ItemID.PearlwoodBookcase);
break;
case 14:
item.SetDefaults(ItemID.SpookyBookcase);
break;
case 15:
item.SetDefaults(ItemID.SkywareBookcase);
break;
case 16:
item.SetDefaults(ItemID.LihzahrdBookcase);
break;
case 17:
item.SetDefaults(ItemID.FrozenBookcase);
break;
case 18:
item.SetDefaults(ItemID.LivingWoodBookcase);
break;
case 19:
item.SetDefaults(ItemID.ShadewoodBookcase);
break;
case 20:
item.SetDefaults(ItemID.GoldenBookcase);
break;
case 21:
item.SetDefaults(ItemID.BoneBookcase);
break;
case 22:
item.SetDefaults(ItemID.DynastyBookcase);
break;
case 23:
item.SetDefaults(ItemID.PalmWoodBookcase);
break;
case 24:
item.SetDefaults(ItemID.MushroomBookcase);
break;
case 25:
item.SetDefaults(ItemID.BorealWoodBookcase);
break;
case 26:
item.SetDefaults(ItemID.SlimeBookcase);
break;
case 27:
item.SetDefaults(ItemID.PumpkinBookcase);
break;
case 28:
item.SetDefaults(ItemID.MartianHolobookcase);
break;
case 29:
item.SetDefaults(ItemID.MeteoriteBookcase);
break;
case 30:
item.SetDefaults(ItemID.GraniteBookcase);
break;
case 31:
item.SetDefaults(ItemID.MarbleBookcase);
break;
case 32:
item.SetDefaults(ItemID.CrystalBookCase);
break;
}
}
}
}
}

0 comments on commit d216f10

Please sign in to comment.