diff --git a/TEditXna/Editor/Tools/ArrowTool.cs b/TEditXna/Editor/Tools/ArrowTool.cs index 6830e750..fafd6d44 100644 --- a/TEditXna/Editor/Tools/ArrowTool.cs +++ b/TEditXna/Editor/Tools/ArrowTool.cs @@ -84,6 +84,15 @@ public override void MouseUp(TileMouseState e) } _wvm.SelectedRack = RackLocation; } + else if (curTile.Type == 171) + { + Vector2Int32 XmasLocation = _wvm.CurrentWorld.GetXmas(e.Location.X, e.Location.Y); + _wvm.SelectedXmasStar = _wvm.CurrentWorld.Tiles[XmasLocation.X, XmasLocation.Y].V & 7; + _wvm.SelectedXmasGarland = (_wvm.CurrentWorld.Tiles[XmasLocation.X, XmasLocation.Y].V >> 3) & 7; + _wvm.SelectedXmasBulb = (_wvm.CurrentWorld.Tiles[XmasLocation.X, XmasLocation.Y].V >> 6) & 0xf; + _wvm.SelectedXmasLight = (_wvm.CurrentWorld.Tiles[XmasLocation.X, XmasLocation.Y].V >> 10) & 0xf; + _wvm.SelectedXmas = XmasLocation; + } } } } diff --git a/TEditXna/Editor/Tools/SpriteTool.cs b/TEditXna/Editor/Tools/SpriteTool.cs index f1b2d96d..ff2ad9bd 100644 --- a/TEditXna/Editor/Tools/SpriteTool.cs +++ b/TEditXna/Editor/Tools/SpriteTool.cs @@ -38,7 +38,28 @@ public override void MouseDown(TileMouseState e) { if (_wvm.SelectedSprite == null) return; - if (_wvm.SelectedSprite.Size.X > 1 || _wvm.SelectedSprite.Size.Y > 1) + if (_wvm.SelectedSprite.Tile == 171) + { + for (int x = 0; x < _wvm.SelectedSprite.Size.X; x++) + { + int tilex = x + e.Location.X; + for (int y = 0; y < _wvm.SelectedSprite.Size.Y; y++) + { + int tiley = y + e.Location.Y; + _wvm.UndoManager.SaveTile(tilex, tiley); + Tile curtile = _wvm.CurrentWorld.Tiles[tilex, tiley]; + curtile.IsActive = true; + curtile.Type = _wvm.SelectedSprite.Tile; + if (x == 0 && y == 0) + curtile.U = 10; + else + curtile.U = (short)x; + curtile.V = (short)y; + _wvm.UpdateRenderPixel(tilex, tiley); + } + } + } + else if (_wvm.SelectedSprite.Size.X > 1 || _wvm.SelectedSprite.Size.Y > 1) { Vector2Short[,] tiles = _wvm.SelectedSprite.GetTiles(); for (int x = 0; x < _wvm.SelectedSprite.Size.X; x++) diff --git a/TEditXna/Terraria/World.cs b/TEditXna/Terraria/World.cs index 9851a298..ad37aa25 100644 --- a/TEditXna/Terraria/World.cs +++ b/TEditXna/Terraria/World.cs @@ -206,6 +206,17 @@ public Vector2Int32 GetRack(int x, int y) return new Vector2Int32(x, y); } + public Vector2Int32 GetXmas(int x, int y) + { + Tile tile = Tiles[x, y]; + if (tile.U < 10) + { + x -= tile.U; + y -= tile.V; + } + return new Vector2Int32(x, y); + } + // find upper left corner of sprites public Vector2Int32 GetAnchor(int x, int y) { diff --git a/TEditXna/View/SpecialTileView.xaml b/TEditXna/View/SpecialTileView.xaml index a6e0cd1a..62883142 100644 --- a/TEditXna/View/SpecialTileView.xaml +++ b/TEditXna/View/SpecialTileView.xaml @@ -1,9 +1,11 @@  @@ -95,10 +97,62 @@ + + + None + Star Topper 1 + Star Topper 2 + Star Topper 3 + Bow Topper + + + None + White + White and Red + Red + Red and Green + Green + Green and White + + + None + Multicolored + Red + Yellow + Green + Red and Green + Yellow and Green + Red and Yellow + White + White and Red + White and Yellow + White and Green + + + None + Multicolored + Red + Green + Blue + Yellow + Red and Yellow + Red and Green + Yellow and Green + Blue and Green + Red and Blue + Blue and Yellow + - + - + @@ -129,7 +183,7 @@ - @@ -151,7 +205,7 @@ - + - + @@ -326,5 +380,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +