From af78a766b7dc270a2cbe1a38e7a4de7eb8d00973 Mon Sep 17 00:00:00 2001 From: Entoarox Date: Sat, 6 Jul 2019 09:28:59 +0200 Subject: [PATCH] EF ~ 2.4.6 --- Framework/ApiWrappers/IJsonAssetsAPI.cs | 28 +++++++++++++++++++++++++ Framework/EntoaroxFrameworkAPI.cs | 27 +++++------------------- Framework/RELEASE-NOTES.md | 8 +++++++ Framework/manifest.json | 2 +- SundropCity/SundropCityMod.cs | 18 ++++++++++------ 5 files changed, 54 insertions(+), 29 deletions(-) create mode 100644 Framework/ApiWrappers/IJsonAssetsAPI.cs diff --git a/Framework/ApiWrappers/IJsonAssetsAPI.cs b/Framework/ApiWrappers/IJsonAssetsAPI.cs new file mode 100644 index 0000000..0bf9ed0 --- /dev/null +++ b/Framework/ApiWrappers/IJsonAssetsAPI.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; + +namespace Entoarox.Framework.ApiWrappers +{ + + public interface IJsonAssetsAPI + { + void LoadAssets(string path); + + int GetObjectId(string name); + int GetCropId(string name); + int GetFruitTreeId(string name); + int GetBigCraftableId(string name); + int GetHatId(string name); + int GetWeaponId(string name); + + IDictionary GetAllObjectIds(); + IDictionary GetAllCropIds(); + IDictionary GetAllFruitTreeIds(); + IDictionary GetAllBigCraftableIds(); + IDictionary GetAllHatIds(); + IDictionary GetAllWeaponIds(); + + event EventHandler IdsAssigned; + event EventHandler AddedItemsToShop; + } +} diff --git a/Framework/EntoaroxFrameworkAPI.cs b/Framework/EntoaroxFrameworkAPI.cs index 9fc7046..cc008db 100644 --- a/Framework/EntoaroxFrameworkAPI.cs +++ b/Framework/EntoaroxFrameworkAPI.cs @@ -1,13 +1,17 @@ using System; using System.Collections.Generic; using System.Linq; -using Entoarox.Framework.Core; + using StardewValley; using SObject = StardewValley.Object; using StardewValley.Objects; using StardewValley.Tools; + using Microsoft.Xna.Framework; +using Entoarox.Framework.Core; +using Entoarox.Framework.ApiWrappers; + namespace Entoarox.Framework { public class EntoaroxFrameworkAPI @@ -21,27 +25,6 @@ public class EntoaroxFrameworkAPI private static readonly Dictionary WalkBoosts = new Dictionary(); private static readonly Dictionary> IdResolvers = new Dictionary>(); - private interface IJsonAssetsAPI - { - void LoadAssets(string path); - - int GetObjectId(string name); - int GetCropId(string name); - int GetFruitTreeId(string name); - int GetBigCraftableId(string name); - int GetHatId(string name); - int GetWeaponId(string name); - - IDictionary GetAllObjectIds(); - IDictionary GetAllCropIds(); - IDictionary GetAllFruitTreeIds(); - IDictionary GetAllBigCraftableIds(); - IDictionary GetAllHatIds(); - IDictionary GetAllWeaponIds(); - - event EventHandler IdsAssigned; - event EventHandler AddedItemsToShop; - } public EntoaroxFrameworkAPI() { diff --git a/Framework/RELEASE-NOTES.md b/Framework/RELEASE-NOTES.md index 4d4d023..4394cd8 100644 --- a/Framework/RELEASE-NOTES.md +++ b/Framework/RELEASE-NOTES.md @@ -1,4 +1,12 @@ ## Release notes +## 2.4.6 +Released 06 July 2019 +* Fixed JsonAssets error again, nested interfaces are also invalid + +## 2.4.5 +Released 04 July 2019 +* Fixed a error related to the JsonAssets integration + ## 2.4.4 Released 04 July 2019 * Fixed the ICustomItem `TerrainFeature` and `GameLocation` support diff --git a/Framework/manifest.json b/Framework/manifest.json index 7573ac1..9bfda0f 100644 --- a/Framework/manifest.json +++ b/Framework/manifest.json @@ -1,7 +1,7 @@ { "Name": "Entoarox Framework", "Author": "Entoarox", - "Version": "2.4.4", + "Version": "2.4.6", "Description": "A collection of APIs to make modding easier.", "UniqueID": "Entoarox.EntoaroxFramework", "EntryDll": "EntoaroxFramework.dll", diff --git a/SundropCity/SundropCityMod.cs b/SundropCity/SundropCityMod.cs index 9104385..e0b3ad9 100644 --- a/SundropCity/SundropCityMod.cs +++ b/SundropCity/SundropCityMod.cs @@ -297,7 +297,7 @@ private void OnButtonReleased(object sender, ButtonReleasedEventArgs e) switch(split[0]) { case "SundropMessage": - + Game1.drawDialogueNoTyping(this.Helper.Translation.Get(args[0])); break; } } @@ -322,13 +322,19 @@ private void OnWarped(object s, WarpedEventArgs e) { if (!e.IsLocalPlayer) return; - e.OldLocation.map.GetLayer("Back").BeforeDraw -= this.DrawExtraLayers; - e.NewLocation.map.GetLayer("Back").BeforeDraw += this.DrawExtraLayers; + e.OldLocation.map.GetLayer("Back").BeforeDraw -= this.DrawExtraLayers1; + e.NewLocation.map.GetLayer("Back").BeforeDraw += this.DrawExtraLayers1; + e.OldLocation.map.GetLayer("Front").AfterDraw -= this.DrawExtraLayers2; + e.NewLocation.map.GetLayer("Front").AfterDraw += this.DrawExtraLayers2; + } + private void DrawExtraLayers1(object s, LayerEventArgs e) + { + Game1.currentLocation.map.GetLayer("FarBack")?.Draw(Game1.mapDisplayDevice, Game1.viewport, Location.Origin, false, 4); + Game1.currentLocation.map.GetLayer("MidBack")?.Draw(Game1.mapDisplayDevice, Game1.viewport, Location.Origin, false, 4); } - private void DrawExtraLayers(object s, LayerEventArgs e) + private void DrawExtraLayers2(object s, LayerEventArgs e) { - Game1.currentLocation.map.GetLayer("FarBack")?.Draw(Game1.mapDisplayDevice, Game1.viewport, xTile.Dimensions.Location.Origin, false, 4); - Game1.currentLocation.map.GetLayer("MidBack")?.Draw(Game1.mapDisplayDevice, Game1.viewport, xTile.Dimensions.Location.Origin, false, 4); + Game1.currentLocation.map.GetLayer("Front2")?.Draw(Game1.mapDisplayDevice, Game1.viewport, Location.Origin, false, 4); } } }