Skip to content

Commit

Permalink
Merge branch 'develop' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
Pathoschild committed Dec 28, 2021
2 parents 670864e + d12ac89 commit 5453fdc
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
11 changes: 10 additions & 1 deletion StardewXnbHack/Framework/Writers/MapWriter.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml.Linq;
using StardewModdingAPI.Toolkit.Utilities;
using StardewValley;
using TMXTile;
Expand Down Expand Up @@ -69,9 +70,17 @@ public override bool TryWriteFile(object asset, string toPathWithoutExtension, s
}

// save file
using (Stream stream = File.Create($"{toPathWithoutExtension}.tmx"))
using (Stream stream = new MemoryStream())
{
// serialize to stream
this.Format.Store(map, stream, DataEncodingType.CSV);

// workaround: TMXTile doesn't indent the XML in newer .NET versions
stream.Position = 0;
var doc = XDocument.Load(stream);
File.WriteAllText($"{toPathWithoutExtension}.tmx", "<?xml version=\"1.0\"?>\n" + doc.ToString());
}

// undo changes
foreach (var layer in map.Layers)
layer.TileSize = tileSizes[layer];
Expand Down
2 changes: 1 addition & 1 deletion StardewXnbHack/StardewXnbHack.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryUrl>https://github.com/Pathoschild/StardewXnbHack</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Version>1.0.6</Version>
<Version>1.0.7</Version>

<!--build-->
<TargetFramework>net6.0</TargetFramework>
Expand Down
1 change: 1 addition & 0 deletions build-scripts/prepare-release-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ cd "`dirname "$0"`/.."
echo "Clearing old builds..."
echo "-----------------------"
for path in **/bin **/obj; do
echo "$path"
rm -rf "$path"
done
rm -rf "bin"
Expand Down
5 changes: 5 additions & 0 deletions release-notes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
[← back to readme](README.md)

# Release notes
## 1.0.7
Released 28 December 2021.

* Fixed exported `.tmx` files no longer indented.

## 1.0.6
Released 04 December 2021.

Expand Down

0 comments on commit 5453fdc

Please sign in to comment.