Skip to content

Commit

Permalink
EF ~ 2.4.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Entoarox committed Jul 6, 2019
1 parent 655a5ec commit af78a76
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 29 deletions.
28 changes: 28 additions & 0 deletions Framework/ApiWrappers/IJsonAssetsAPI.cs
Original file line number Diff line number Diff line change
@@ -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<string, int> GetAllObjectIds();
IDictionary<string, int> GetAllCropIds();
IDictionary<string, int> GetAllFruitTreeIds();
IDictionary<string, int> GetAllBigCraftableIds();
IDictionary<string, int> GetAllHatIds();
IDictionary<string, int> GetAllWeaponIds();

event EventHandler IdsAssigned;
event EventHandler AddedItemsToShop;
}
}
27 changes: 5 additions & 22 deletions Framework/EntoaroxFrameworkAPI.cs
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -21,27 +25,6 @@ public class EntoaroxFrameworkAPI
private static readonly Dictionary<string, int> WalkBoosts = new Dictionary<string, int>();
private static readonly Dictionary<string, Func<string, Item>> IdResolvers = new Dictionary<string, Func<string, Item>>();

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<string, int> GetAllObjectIds();
IDictionary<string, int> GetAllCropIds();
IDictionary<string, int> GetAllFruitTreeIds();
IDictionary<string, int> GetAllBigCraftableIds();
IDictionary<string, int> GetAllHatIds();
IDictionary<string, int> GetAllWeaponIds();

event EventHandler IdsAssigned;
event EventHandler AddedItemsToShop;
}

public EntoaroxFrameworkAPI()
{
Expand Down
8 changes: 8 additions & 0 deletions Framework/RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion Framework/manifest.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
18 changes: 12 additions & 6 deletions SundropCity/SundropCityMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand All @@ -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);
}
}
}

0 comments on commit af78a76

Please sign in to comment.