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 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/TEditXna/View/WorldRenderXna.xaml.cs b/TEditXna/View/WorldRenderXna.xaml.cs
index a08ced48..0d7f2101 100644
--- a/TEditXna/View/WorldRenderXna.xaml.cs
+++ b/TEditXna/View/WorldRenderXna.xaml.cs
@@ -255,6 +255,8 @@ private void LoadTerrariaTextures(GraphicsDeviceEventArgs e)
for (int y = 0; y < sprite.Size.Y; y++)
{
var source = new Rectangle(x * (tile.TextureGrid.X + 2) + sprite.Origin.X, y * (tile.TextureGrid.Y + 2) + sprite.Origin.Y, tile.TextureGrid.X, tile.TextureGrid.Y);
+ if (sprite.Tile == 171)
+ source = new Rectangle(x * (tile.TextureGrid.X) + sprite.Origin.X, y * (tile.TextureGrid.Y) + sprite.Origin.Y, tile.TextureGrid.X, tile.TextureGrid.Y);
if (source.Bottom > tileTex.Height)
source.Height -= (source.Bottom - tileTex.Height);
if (source.Right > tileTex.Width)
diff --git a/TEditXna/ViewModel/WorldViewModel.Commands.cs b/TEditXna/ViewModel/WorldViewModel.Commands.cs
index cc1ccd54..f279ab5a 100644
--- a/TEditXna/ViewModel/WorldViewModel.Commands.cs
+++ b/TEditXna/ViewModel/WorldViewModel.Commands.cs
@@ -32,6 +32,7 @@ public partial class WorldViewModel
private ICommand _saveChestCommand;
private ICommand _saveSignCommand;
private ICommand _saveMannCommand;
+ private ICommand _saveXmasCommand;
private ICommand _saveTileEntityCommand;
private ICommand _saveRackCommand;
private ICommand _npcRemoveCommand;
@@ -127,6 +128,11 @@ public ICommand SaveMannCommand
get { return _saveMannCommand ?? (_saveMannCommand = new RelayCommand(SaveMannequin)); }
}
+ public ICommand SaveXmasCommand
+ {
+ get { return _saveXmasCommand ?? (_saveXmasCommand = new RelayCommand(SaveXmasTree)); }
+ }
+
public ICommand SaveTileEntityCommand
{
get { return _saveTileEntityCommand ?? (_saveTileEntityCommand = new RelayCommand(SaveTileEntity)); }
@@ -170,6 +176,25 @@ private void SaveMannequin(bool save)
}
}
+ private void SaveXmasTree(bool save)
+ {
+ if (save)
+ {
+ if (SelectedXmas != null)
+ {
+ int tree = SelectedXmasStar;
+ tree += (SelectedXmasGarland << 3);
+ tree += (SelectedXmasBulb << 6);
+ tree += (SelectedXmasLight << 10);
+ CurrentWorld.Tiles[SelectedXmas.X, SelectedXmas.Y].V = (short)tree;
+ }
+ }
+ else
+ {
+ SelectedSpecialTile = 0;
+ }
+ }
+
private void SaveSign(bool save)
{
if (save)
diff --git a/TEditXna/ViewModel/WorldViewModel.cs b/TEditXna/ViewModel/WorldViewModel.cs
index b2ea2976..eb07a546 100644
--- a/TEditXna/ViewModel/WorldViewModel.cs
+++ b/TEditXna/ViewModel/WorldViewModel.cs
@@ -68,6 +68,11 @@ public partial class WorldViewModel : ViewModelBase
private TileEntity _selectedItemFrame;
private Vector2Int32 _selectedMannequin;
private Vector2Int32 _selectedRack;
+ private Vector2Int32 _selectedXmas;
+ private int _selectedXmasStar;
+ private int _selectedXmasGarland;
+ private int _selectedXmasBulb;
+ private int _selectedXmasLight;
private byte _selectedRackPrefix;
private int _selectedRackNetId;
private int _selectedMannHead;
@@ -269,6 +274,41 @@ public int SelectedRackNetId
set { Set("SelectedRackNetId", ref _selectedRackNetId, value); }
}
+ public Vector2Int32 SelectedXmas
+ {
+ get { return _selectedXmas; }
+ set
+ {
+ Set("SelectedXmas", ref _selectedXmas, value);
+ SelectedTabIndex = 1;
+ SelectedSpecialTile = 6;
+ }
+ }
+
+ public int SelectedXmasStar
+ {
+ get { return _selectedXmasStar; }
+ set { Set("SelectedXmasStar", ref _selectedXmasStar, value); }
+ }
+
+ public int SelectedXmasGarland
+ {
+ get { return _selectedXmasGarland; }
+ set { Set("SelectedXmasGarland", ref _selectedXmasGarland, value); }
+ }
+
+ public int SelectedXmasBulb
+ {
+ get { return _selectedXmasBulb; }
+ set { Set("SelectedXmasBulb", ref _selectedXmasBulb, value); }
+ }
+
+ public int SelectedXmasLight
+ {
+ get { return _selectedXmasLight; }
+ set { Set("SelectedXmasLight", ref _selectedXmasLight, value); }
+ }
+
public Sign SelectedSign
{
get { return _selectedSign; }
@@ -609,7 +649,7 @@ public async void CheckVersion(bool auto = true)
var versions = Regex.Match(githubReleases, versionRegex);
isoutofdate = versions.Success && IsVersionNewerThanApplicationVersion(versions?.Groups?[1].Value);
-
+
// ignore revision, build should be enough
// if ((revis != -1) && (revis > App.Version.ProductPrivatePart)) return true;
}
diff --git a/TEditXna/settings.xml b/TEditXna/settings.xml
index f11e7686..395cbaba 100644
--- a/TEditXna/settings.xml
+++ b/TEditXna/settings.xml
@@ -3647,7 +3647,7 @@ PLEASE KEEP FORMATTING IF SUBMITTING PULL REQUEST FOR THIS FILE. THANKS!
-
+