diff options
Diffstat (limited to 'src/SMAPI')
-rw-r--r-- | src/SMAPI/Framework/ContentManagers/ModContentManager.cs | 1 | ||||
-rw-r--r-- | src/SMAPI/Framework/SCore.cs | 13 | ||||
-rw-r--r-- | src/SMAPI/SMAPI.csproj | 27 |
3 files changed, 15 insertions, 26 deletions
diff --git a/src/SMAPI/Framework/ContentManagers/ModContentManager.cs b/src/SMAPI/Framework/ContentManagers/ModContentManager.cs index fdf76b24..0a526fc8 100644 --- a/src/SMAPI/Framework/ContentManagers/ModContentManager.cs +++ b/src/SMAPI/Framework/ContentManagers/ModContentManager.cs @@ -154,6 +154,7 @@ namespace StardewModdingAPI.Framework.ContentManagers // unpacked map case ".tbin": + case ".tmx": { // validate if (typeof(T) != typeof(Map)) diff --git a/src/SMAPI/Framework/SCore.cs b/src/SMAPI/Framework/SCore.cs index 44c495ff..77c2fab8 100644 --- a/src/SMAPI/Framework/SCore.cs +++ b/src/SMAPI/Framework/SCore.cs @@ -234,7 +234,7 @@ namespace StardewModdingAPI.Framework #endif AppDomain.CurrentDomain.UnhandledException += (sender, e) => this.Monitor.Log($"Critical app domain exception: {e.ExceptionObject}", LogLevel.Error); - // add more lenient assembly resolvers + // add more lenient assembly resolver AppDomain.CurrentDomain.AssemblyResolve += (sender, e) => AssemblyLoader.ResolveAssembly(e.Name); // hook locale event @@ -420,6 +420,17 @@ namespace StardewModdingAPI.Framework return; } + // init TMX support + try + { + xTile.Format.FormatManager.Instance.RegisterMapFormat(new TMXTile.TMXFormat(Game1.tileSize / Game1.pixelZoom, Game1.tileSize / Game1.pixelZoom, Game1.pixelZoom, Game1.pixelZoom)); + } + catch (Exception ex) + { + this.Monitor.Log("SMAPI couldn't load TMX support. Some mods may not work correctly.", LogLevel.Warn); + this.Monitor.Log($"Technical details: {ex.GetLogSummary()}", LogLevel.Trace); + } + // load mod data ModToolkit toolkit = new ModToolkit(); ModDatabase modDatabase = toolkit.GetModDatabase(Constants.ApiMetadataPath); diff --git a/src/SMAPI/SMAPI.csproj b/src/SMAPI/SMAPI.csproj index 1376c8a2..579af423 100644 --- a/src/SMAPI/SMAPI.csproj +++ b/src/SMAPI/SMAPI.csproj @@ -19,6 +19,7 @@ <PackageReference Include="Lib.Harmony" Version="1.2.0.1" /> <PackageReference Include="Mono.Cecil" Version="0.11.1" /> <PackageReference Include="Newtonsoft.Json" Version="12.0.3" /> + <PackageReference Include="Platonymous.TMXTile" Version="1.0.0" /> </ItemGroup> <ItemGroup> @@ -98,31 +99,7 @@ <Link>SMAPI.metadata.json</Link> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </Content> - <None Update="i18n\de.json"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </None> - <None Update="i18n\es.json"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </None> - <None Update="i18n\fr.json"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </None> - <None Update="i18n\ja.json"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </None> - <None Update="i18n\default.json"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </None> - <None Update="i18n\pt.json"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </None> - <None Update="i18n\ru.json"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </None> - <None Update="i18n\tr.json"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </None> - <None Update="i18n\zh.json"> + <None Update="i18n\*"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> <None Update="steam_appid.txt"> |